I am running a web service on my local machine (using standard VS.NET test
pages) that is attempting to access a SQL database on a network server. C#
code looks something like this:
[WebMethod]
public string GetSomething()
{
SqlConnection con = new SqlConnection() ;
con.ConnectionS tring =
ConfigurationSe ttings.AppSetti ngs["connectstr ing"].ToString();
con.Open();
...
}
The problem is that the Open() statement always yields a "SQL Server does
not exist or access denied" message. The same code works fine when run from
a WinForms app, so I know that my connection string is good. Is this a
permissions issue or am I missing a setting somewhere?
Thanks in advance.
David
pages) that is attempting to access a SQL database on a network server. C#
code looks something like this:
[WebMethod]
public string GetSomething()
{
SqlConnection con = new SqlConnection() ;
con.ConnectionS tring =
ConfigurationSe ttings.AppSetti ngs["connectstr ing"].ToString();
con.Open();
...
}
The problem is that the Open() statement always yields a "SQL Server does
not exist or access denied" message. The same code works fine when run from
a WinForms app, so I know that my connection string is good. Is this a
permissions issue or am I missing a setting somewhere?
Thanks in advance.
David
Comment