Login failed for user 'sa'" datagrid control - SqlDataAdapter

J

Jerry Higgins

Curt and Chris,

Original post - April 20.

I added a SqlDataAdapter to a web form, created a data
connection, and generated a dataset. I then connected it
to a DataGrid control. When I do this using the
SqlServer database on my machine everything works fine.
When I do it using a SqlServer database on another
machine I get the "Login failed for user sa" error.
However, when I right click on the SqlDataAdapter and
click "Preview Data" it brings back the data OK. Why
would it bring back the data on this but not work in the
DataGrid control?

The problem was this. When you configure the data
adapter and it enters the connect string into the
SqlConnection tool it doesn't add the password even
though the configuration wizard asks you for it.
 
C

Curt_C [MVP]

manually create your connection string and populate it that way.
I never use the wizards for any of that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top