Hi Guys,
Here I am looking for very small application by which I can use the MS Access as a database.
How the connectivity is doing with c# and all this things how the table is created in MS access.
Please help...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
carle laiPosted Jan 21, 2010, 3:30 AM
paul danielPosted Jan 18, 2010, 7:40 AM
public void ConnectToAccess()
{
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data source= C:\Documents and Settings\username\" +
@"My Documents\AccessFile.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
}
}
cyber budPosted Jan 18, 2010, 7:06 AM
Lalit MPosted Jan 18, 2010, 6:50 AM
connection string you will get here
more information