tags:

views:

259

answers:

1

Hi all,

I am creating a simple C# CMS system using a Microsoft Access database

This is my connection string in the web.config file

<add name="VirtualCMSConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|ASPNetDB.mdb" providerName="System.Data.OleDB"/>

I have used the "Access Provider" module found here: http://blog.krisvandermast.com/UsingAccessInsteadOfSQLServerForYourASPNETApplicationServices.aspx

The problem I am having is that when I try to create a Dataset with the dataset designing I recieve an error when I try to choose the connection string for the table adapter.

Failed to open a connection to the database

"Cannot obtain provider factory for data provider named 'System.Data.OleDb'

Check the connection and try again

Could anyone please help me on this matter.

Thanks.

A: 

Have you downloaded the .vsi, extracted it, built the SampleAccessProviders.dll and added it to your project?

Now that we have created the assembly it's time to actually use it. Open your Visual Studio or Visual Web Developer Express and create a new website. In the project you create a new subfolder called bin. After creation right click on it and choose Add existing item... from the context menu that appears. Navigate to the place where the built assembly is. Add it to the bin folder of the website project. After that repeat the same thing with the access database (ASPNetDB.mdb) file but this time put it in the dedicated folder App_Data which is one of the predefined ASP.NET 2.0 subfolders.

Mitch Wheat
Hi Mitch,Yes I followed the tutorial to the letter.I have a file named "SampleAccessProviders.dll" in my bin directory.The only thing I did do was rename the coonection string from "AccessFileName" to "VirtualCMSConnectionString" but I updated all references to it in the web.config file.
Jason