Connects to a Microsoft Access database : Access « Database ADO.net « C# / C Sharp






Connects to a Microsoft Access database

Connects to a Microsoft Access database

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

public class Connect {    
 public static void Main () { 
   String connect = "Provider=Microsoft.JET.OLEDB.4.0;data source=.\\Employee.mdb";
   OleDbConnection con = new OleDbConnection(connect);
   con.Open();
   Console.WriteLine("Made the connection to the Sales database");
   con.Close();
 }
}
           
       








Related examples in the same category

1.Reading Access Data
2.How to use an OleDbConnection object to connect to an Access database
3.Use OdbcCommand to read data in Access database and fill the DataGrid
4.Read query result data from Access database
5.Connect to an Access database file