fuffens
June 10th, 2002, 07:54 AM
Hi!
I'm trying to use a web service to connect to a database, read some data and return it. I used the following code in a console application to connect to the database:
SqlConnection thisConnection = new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;" + "Initial Catalog=northwind");
thisConnection.Open();
It works fine and I can read and present my data. But if I transfer the code to a web service, the connection causes an exception! I get the following exception message:
System.Data.SqlClient.SqlException: Login failed for user 'S0068\ASPNET'. at System.Data.SqlClient.SqlConnection.Open() at DatabaseLibrary.DataQuery.GetCompanyName() in c:\dotnet\test2\databaselibrary\dataquery.cs:line 2
Does the connection from the web service require some other login than the console application? What should I do about it?
Thanks,
Fredrik
I'm trying to use a web service to connect to a database, read some data and return it. I used the following code in a console application to connect to the database:
SqlConnection thisConnection = new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;" + "Initial Catalog=northwind");
thisConnection.Open();
It works fine and I can read and present my data. But if I transfer the code to a web service, the connection causes an exception! I get the following exception message:
System.Data.SqlClient.SqlException: Login failed for user 'S0068\ASPNET'. at System.Data.SqlClient.SqlConnection.Open() at DatabaseLibrary.DataQuery.GetCompanyName() in c:\dotnet\test2\databaselibrary\dataquery.cs:line 2
Does the connection from the web service require some other login than the console application? What should I do about it?
Thanks,
Fredrik