By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?

Thanks,

Jerry
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
the servers can't communicate. firewall perhaps?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Jerry Higgins" <je*************@yahoo.com> wrote in message
news:1c****************************@phx.gbl...
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?

Thanks,

Jerry

Nov 18 '05 #2

P: n/a
I can connect fine through SQL Enterprise manager. Also,
as I mentioned in the post, I can right click on the
SqlDataAdapter and read the data fine.

-----Original Message-----
the servers can't communicate. firewall perhaps?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Jerry Higgins" <je*************@yahoo.com> wrote in messagenews:1c****************************@phx.gbl...
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?

Thanks,

Jerry

.

Nov 18 '05 #3

P: n/a
is this where the server that you are publishing to? or do you mean locally
even?
Try IP instead of NAME for server also

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<je*************@yahoo.com> wrote in message
news:1e****************************@phx.gbl...
I can connect fine through SQL Enterprise manager. Also,
as I mentioned in the post, I can right click on the
SqlDataAdapter and read the data fine.

-----Original Message-----
the servers can't communicate. firewall perhaps?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Jerry Higgins" <je*************@yahoo.com> wrote in

message
news:1c****************************@phx.gbl...
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?

Thanks,

Jerry

.

Nov 18 '05 #4

P: n/a
Jerry, when using Enterprise Manager or right clicking on the
SqlDataAdapter, you are logged in as yourself, through the Web form, you
connect as the ASP.NET user. I would examine the "Login failed for user sa"
a bit closer, sounds like it can be true.

<je*************@yahoo.com> wrote in message
news:1e****************************@phx.gbl...
I can connect fine through SQL Enterprise manager. Also,
as I mentioned in the post, I can right click on the
SqlDataAdapter and read the data fine.

-----Original Message-----
the servers can't communicate. firewall perhaps?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Jerry Higgins" <je*************@yahoo.com> wrote in

message
news:1c****************************@phx.gbl...
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?

Thanks,

Jerry

.

Nov 18 '05 #5

P: n/a
I see what you are saying but not sure how to resolve
it. In order to get this to work on my machine I had to
add ASPNET as a user in the SQL Server database on my
machine. When I try to add ASPNET as a user in SqlServer
on the other machine I get the error

"Error 15401: Windows NT user or
group '<machinename>\ASPNET' not found. Check the name
again."

Thanks,

Jerry
-----Original Message-----
Jerry, when using Enterprise Manager or right clicking on theSqlDataAdapter, you are logged in as yourself, through the Web form, youconnect as the ASP.NET user. I would examine the "Login failed for user sa"a bit closer, sounds like it can be true.

<je*************@yahoo.com> wrote in message
news:1e****************************@phx.gbl...
I can connect fine through SQL Enterprise manager. Also, as I mentioned in the post, I can right click on the
SqlDataAdapter and read the data fine.

>-----Original Message-----
>the servers can't communicate. firewall perhaps?
>
>--
>Curt Christianson
>Owner/Lead Developer, DF-Software
>www.Darkfalz.com
>
>
>"Jerry Higgins" <je*************@yahoo.com> wrote in

message
>news:1c****************************@phx.gbl...
>> 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?
>>
>> Thanks,
>>
>> Jerry
>
>
>.
>

.

Nov 18 '05 #6

P: n/a
I'm not sure I understand. I don't think I'm publishing
to a server. I am simply trying to read the data out of
a database on another machine and display it in the
grid. When I get the data from my machine
(locally) everything is fine. Do you mean change the
name of the server in the connection string to and IP
address? I can try that. I'm still wondering why I can
get the data from the SqlDataAdapter but not the grid.

-----Original Message-----
is this where the server that you are publishing to? or do you mean locallyeven?
Try IP instead of NAME for server also

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
<je*************@yahoo.com> wrote in message
news:1e****************************@phx.gbl...
I can connect fine through SQL Enterprise manager. Also, as I mentioned in the post, I can right click on the
SqlDataAdapter and read the data fine.

>-----Original Message-----
>the servers can't communicate. firewall perhaps?
>
>--
>Curt Christianson
>Owner/Lead Developer, DF-Software
>www.Darkfalz.com
>
>
>"Jerry Higgins" <je*************@yahoo.com> wrote in

message
>news:1c****************************@phx.gbl...
>> 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?
>>
>> Thanks,
>>
>> Jerry
>
>
>.
>

.

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.