Hi, Do you know to use a provider for MS Access in ADO.NET Entity Framework?
+1
A:
ADO.NET Entity Framework is designed to work with anything that as standard ADO.NET provider. Access does.
AnthonyWJones
2009-03-15 16:53:55
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?
2009-03-15 17:11:27
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
2009-03-15 22:14:52
Thank you Anthony
2009-03-17 08:24:21
A:
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();
Matt
2009-03-16 15:36:53
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
2010-07-24 07:51:38