G
Guest
I am working through the manual for course 2524 (Developing XML web services
using ASP.NET). It is at least 4 years old so hopeless outdated -) but I
think I can salvage it to still be useful. I actually tried this with just
the express editions of visual web developer, C#, and sql server 2005. I
loaded the demo web service project (Woodgrove) and launced it via the
internal web server in visual web developer. I was successful in getting the
services page to the web service but ran into a problem when I tried to
execute a web method that accessed the service's database. The exact error
was:
"System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server 2005,
this failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)"
After winding down the path of that error (enabling remote connections,
enabling the sql server browser, and adding exceptions in the firewall for
sql server and sql server browser) I finally realized that that was not the
problem at all. The issue was the connection string in the demo project. The
original was:
data source=.\MOC;initial catalog=Woodgrove;user id=sa;pwd=Course_2524
But attempting to connect to this as a datasource with the "sa" login failed
(though I did setup my sql server to accept either sql or windows
authentication).
I achieved a successful connection with this connection string:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Program
Files\Msdntrain\2524\Database\Woodgrove_Data.MDF";Integrated
Security=True;Connect Timeout=30;User Instance=True
So I solved my problem. The purpose of this post, then, is to see if someone
could enlighten me on the differences between these two connection strings
including, but not limited to, these:
Why did the original use a different data source? Why did the original not
name a specific file, but instead named a catalog? Are the other parameters
in the second string new with VS2005 but now needed?
using ASP.NET). It is at least 4 years old so hopeless outdated -) but I
think I can salvage it to still be useful. I actually tried this with just
the express editions of visual web developer, C#, and sql server 2005. I
loaded the demo web service project (Woodgrove) and launced it via the
internal web server in visual web developer. I was successful in getting the
services page to the web service but ran into a problem when I tried to
execute a web method that accessed the service's database. The exact error
was:
"System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server 2005,
this failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)"
After winding down the path of that error (enabling remote connections,
enabling the sql server browser, and adding exceptions in the firewall for
sql server and sql server browser) I finally realized that that was not the
problem at all. The issue was the connection string in the demo project. The
original was:
data source=.\MOC;initial catalog=Woodgrove;user id=sa;pwd=Course_2524
But attempting to connect to this as a datasource with the "sa" login failed
(though I did setup my sql server to accept either sql or windows
authentication).
I achieved a successful connection with this connection string:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Program
Files\Msdntrain\2524\Database\Woodgrove_Data.MDF";Integrated
Security=True;Connect Timeout=30;User Instance=True
So I solved my problem. The purpose of this post, then, is to see if someone
could enlighten me on the differences between these two connection strings
including, but not limited to, these:
Why did the original use a different data source? Why did the original not
name a specific file, but instead named a catalog? Are the other parameters
in the second string new with VS2005 but now needed?