Connecting to a Text File : ODBC « ADO.Net « C# / CSharp Tutorial






using System;
using System.Data;
using System.Data.OleDb;

    class Program
    {
        static void Main(string[] args)
        {
            string connectString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=;Extended Properties=\"text;HDR=yes;FMT=Delimited\";";

            OleDbConnection connection = new OleDbConnection(connectString);
            connection.Open(  );

            Console.WriteLine("Connection.String = {0}\n",connectString);
            Console.WriteLine("Connection.State = {0}",connection.State);
            Console.WriteLine("Connection.Provider = {0}",connection.Provider);
            Console.WriteLine("Connection.ServerVersion = {0}",connection.ServerVersion);
            connection.Close(  );
        }
    }








32.48.ODBC
32.48.1.Creating Connection To ODBC
32.48.2.Connecting to a Text File
32.48.3.Connecting to an ODBC Data Source
32.48.4.Connect to SqlServer using OdbcConnection
32.48.5.Odbc Provider