Dataset and Web.Config. Help Needed. Thank You.

S

Shapper

Hello,

I created a dataset in web matrix:

....
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole
DB Services=-4; Data Source=C:\myDatabase.mdb"
....

I want to place the connection in the Web.Config file:
<appSettings>
<add key="connectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;
Ole DB Services=-4; Data Source= myDatabase.mdb" />
</appSettings>

Then I used this code line:
Dim connectionString As String =
System.Configuration.ConfigurationSettings.AppSettings("connectionString");

I tried in many ways but I can't make it work.

Can someone tell me what am I doing wrong or point me a resource where I
can read something about it?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top