Groups | Blog | Home
all groups > sql server connect > october 2003 >

sql server connect : Unhandled Exception: System.Data.SqlClient.SqlException: Login failed for user 'sa'.


epmcj38 NO[at]SPAM yahoo.com
10/20/2003 1:11:43 PM
Ok.......... I'm new to this so please bare with me. I'm trying to
connect to a SQL database via a SqlDataAdapter. I have a Load button
that should be loading the info onto a DataGrid. I can preview the
information view the Data Adapter Preview but I can't load it onto my
Datagrid when I run the program. I get the following message:

Unhandled Exception: System.Data.SqlClient.SqlException: Login failed
for
user 'sa'.

I'm 100% sure the password is correct. What else could it be?

Starving for help!

I_AM_DON_AND_YOU?
10/20/2003 1:42:14 PM
try with this:

in the sql server's instance registration properties uncheck the box always
prompt for login and password (and before that set the password for sa
there)..



[quoted text, click to view]

ben.ong NO[at]SPAM natoil.com
1/27/2005 2:53:44 PM
I have this problem too. I have also tried your suggestion and still
recieve the same error. My code is setup as follows:

I have a class file called measures. In the code behind of my aspx
file i create an instance of measures. This instance of measures has a
method called createDataTable() which connects to the db and returns a
dataTable. When i run the database connection code found in
createDataTable in the aspx.cs (code behind) instead of the class file
i dont receive any errors. However, when i keep the code as is i get
that log in failed error. I double checked the command string and
connection string and all is correct.

thanks,

ben
[quoted text, click to view]
AddThis Social Bookmark Button