473,378 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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
6 2404
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Seth Guard | last post by:
(Sorry for the cross-post, but no one responded to my other thread.) When developing a web page in VS.Net, I see everything in WYSIWYG format. And when I am creating a User Control, I see that...
4
by: Jerry Higgins | last post by:
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...
0
by: Dave | last post by:
Can I create a user control so that when I drop it on the web form I can put text between the start and end tags as listed <uc1:KeyFeatures id="KeyFeatures1" runat="server"...
4
by: Guadala Harry | last post by:
Is there any way for one Session to remove and update objects in another Session? I seriously doubt it, but thought I'd ask. Here's why: I have some data that is unique per user (or per session -...
2
by: Shane | last post by:
I'm creating a user control that has a textbox along with a couple of other controls in it. I'm mapping most of the textbox methods and properties to my control using the textbox names. I'm...
2
by: Robert Zahm | last post by:
I have created a C# user control which display certain filesystem information, and allows the user to drag an drop files into and out of the control. I then placed this user form in IE using an...
0
by: obs | last post by:
Hi all. I have a page with a login control. I was wondering what's the way to use the remember me login control. I know it has something to do with cookies, but since I am a total noobie, I...
4
by: Scott McNair | last post by:
Hi, I'm creating a user control that has absolutely no visual pieces to it... it's essentially a piece that sniffs a serial port awaiting incoming data. I know that there are several controls...
1
by: Fresno Bob | last post by:
I am using the ajax modal popup. The panel I am popping up has a lot css formatting to give it things like drop shadows rounded edges. This formatting will be used on all the popups. Is there any...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.