Friday, March 9, 2012

Error Connecting To SQL 2005 through Webservice using SQL Authentication

Running a SQL 2005 Database under a Default instance. i.e. (SERVERNAME) and not (SERVERNAME/SQL2005)

I have a SQL Login sa password.

When I connect to SQL 2005 from anywhere other then the webservice it works fine.

In my webservice i am using System.Data.SqlClient.

SqlConnection, SqlCommand, SqlDataAdapter are being used to called a stored procedure and return the data into a System.Data.DataSet.

I get the following error when calling DataAdapter.Fill(dataSet);

{"TCP Provider: An existing connection was forcibly closed by the remote host.\r\n\r\nLogin failed for user 'sa'."}

I have no resolutions as of yet. Any help would be greatly appreciated.

Did you mean you can connect to the SQL2005 from anywhere with 'sa' login, except webservice? You can check the status of 'sa' login in management studio under Security->Logins, also make sure the Authentication Mode is SQL Server and Windows.|||

I have checked the status of the login for user "sa" and it has access rights and grant levels to everything it needs to.

I have also created a new account specifically for that database which does not work either. Same error.

And yes my SQL 2005 Instance is configured to use both SQL Authentication and Windows Authentication. (Mixed Mode).

Any Ideas?

|||

If you encountered this issue when you're trying to establish encrypted connection , you may take a look at this article:

http://blogs.msdn.com/sql_protocols/archive/2006/07/26/678596.aspx

No comments:

Post a Comment