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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lalit MRank #1,186 · 1.5K reputationPosted Jan 18, 2010, 1:50 AM EST
connection string you will get here
more information
cyber bud4 reputationPosted Jan 18, 2010, 2:06 AM EST
paul daniel189 reputationPosted Jan 18, 2010, 2:40 AM EST
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();
}
}
carle lai40 reputationPosted Jan 20, 2010, 10:30 PM EST