11

Do you know to use a provider for MS Access in ADO.NET Entity Framework?

BIBD
  • 15,107
  • 25
  • 85
  • 137

2 Answers2

3

ADO.NET Entity Framework is designed to work with anything that as standard ADO.NET provider. Access does.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
  • when i add ADO.NET Entity Data Model to project,i see 3 Providers(All of them are Microsoft Sql Server Drivers)Should i add a referance for it? –  Mar 15 '09 at 17:11
  • 1
    The designer in VS only supports SQL Server when it comes to building an initial entity set, for Access you will need to use the OLE DB provider and build the entity set the hard way. Sadly that is literally the hard way. My suggestion would be use SQL 2008 Express instead. – AnthonyWJones Mar 15 '09 at 22:14
  • I have the same question, so u mentioned about use SQL 2008 Express instead. I'm concerning that this change will cause problems??? My website has many users. Is the change will be a problem? – Scott 混合理论 Jun 01 '12 at 09:32
-4

I don't know if this will help you, but take it for what it is worth. Following is my connection string in C# to connect to a MS-Access database.

I have a strongly typed dataset that I put the data into and them manipulate it there. Use the System.Data.OleDb namespace.

sourceString = "\\\DatabaseServer\DatabaseFolder\database.mdb";

conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sourceString;
string strSql1 = "SELECT * FROM IDTable";
OleDbConnection con = new OleDbConnection(conString);

currentDataSet.IDTable.Rows.Clear();
con.Open();
OleDbDataAdapter dAdapter = new OleDbDataAdapter();
dAdapter.SelectCommand = new OleDbCommand(strSql1, con);
dAdapter.Fill(currentDataSet, "IDTable");
con.Close();
p.campbell
  • 98,673
  • 67
  • 256
  • 322
Matt
  • 1,862
  • 2
  • 17
  • 19
  • How did this get voted up? It is irrelevant to the question at hand. EF is completely different from using DataSets and DataAdapters (ewww, gross). – Mateo Jul 24 '10 at 07:51