I have the following in an .aspx page, which works perfectly:
Code:
Dim strConnection As String = "Data Source=127.0.0.1,1433;" & _
"Network Library=DBMSSOCN;Initial Catalog=Northwind;" & _
"User ID=userid;Password=seekrit;"
In the book Beginning ASP.Net Databases using
VB.Net, page 91, it gives an example of moving this connection string to /web.config. I've modified the example code to read:
Code:
value="Data Source=127.0.0.1,1433;Network Library=DBMSSOCN;Initial Catalog=Northwind;User ID=userid;Password=seekrit;" />
I've made the following change to my .aspx script:
Code:
Dim strConnection As String = ConfigurationSettings.AppSettings("NWind")
However, when I execute the script, I get the "SQL Server does not exist or access denied" message.
My scripts are in /examples/ch03, and again, web.config is in /. Does this matter? The book seems to indicate that it does not.
Anyone see what I've done wrong or where I may be missing it? I'm stumped ...