Last post Apr 08, 2010 03:55 PM by Fliz
Apr 08, 2010 02:50 PM|Fliz|LINK
I am adapting a book example of a shopping cart application, and have almost, got it complety working. I am using an access database rather than a sql server one used in the example. Earlier on I found I had an issue with the sql datasource where I had to
specify the provider name as below of I would get the error about provider keyname not being supported
="<%$ ConnectionStrings:OICConnectString %>"
within once of the classes, it refers to the database connection string and this is now where the same error occurs, when the page requires this class and it must be because the provider name is not specified, but i'm new to C# so I'm not sure how to do it.
Here is this part of the class
bool WriteOrder(Order o)
string cs =
tran = con.BeginTransaction();
provider name C# class
Apr 08, 2010 03:16 PM|Mikesdotnetting|LINK
con = new
You need to change that to new OleDbConnection. You'll find the same thing if you have references to
SqlCommand (becomes OleDbCommand), SqlDataReader (becomes
It's because with Sql Server, you use the Stsrem.Data.SqlClient classes, whereas with Jet (Access), it's System.Data.OleDb.
Apr 08, 2010 03:51 PM|Fliz|LINK
Ok, I changed it, but now I get the error :
CS0246: The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or an assembly reference?)
Apr 08, 2010 03:55 PM|Fliz|LINK
Ok, I solved it, I had to change settings in visual web developer to use the right provider, by right clicking and it works now, thanks