Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » ASP & MSQLServer Nightmare - Help!
Closed Thread
Old 08-08-2004, 05:08 PM   #1 (permalink)
 
Newb Techie

Join Date: Aug 2004

Posts: 9

ralph.wigham

Default ASP & MSQLServer Nightmare - Help!

Hi,

I am trying to develop a database driven web application. I have read the books, installed the software, followed the pointless example in the book to the letter but keep hitting this hurdle.

System.Data.SqlClient.SqlException: Login failed for user

Here is the code i habe typed in, it is an example from a book, the end product is supposed to be a pizza order system:

Line 50: SqlCommand1.Parameters("@pizzatype").Value = radlPizzatype.SelectedItem.Value
Line 51: SqlCommand1.Parameters("@comments").Value = txtComments.Text
Line 52: SqlConnection1.Open()
Line 53: SqlCommand1.ExecuteNonQuery()
Line 54: SqlConnection1.Close()

It is falling over at line 52: and giving me the following stack trace:

[SqlException: Login failed for user 'ASHLEY\ASPNET'.]
System.Data.SqlClient.SqlConnection.Open() +761
chapter9.InsertPizzaOrders.Button1_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\chapter9\InsertPizzaOrders.aspx .vb:52
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

I am reaching the end of my teather with this, if anyone could help me and point me in the right direction to get everything configured properly i will be very grateful.

Cheers
ralph.wigham is offline  
Old 08-08-2004, 11:16 PM   #2 (permalink)
 
Super Techie

Join Date: Apr 2004

Posts: 316

BlazingWolf

Default

Does it tell you anything anything at all about a 'Trusted' connection?
__________________
BlazingWolf
<font color=\'red\'>
<b>
<a href=\'http://www.gaming-forums.org\'>
Gaming-Forums.org
<a/>
</b>
</font>
BlazingWolf is offline  
Old 08-09-2004, 05:17 AM   #3 (permalink)
 
Newb Techie

Join Date: Aug 2004

Posts: 9

ralph.wigham

Default

Hi BlazingWolf,

Cheers for replying.

No, unfortunately it doesn't say anything about a Trusted connection.

I am running Visual Studio.NET 2003 and MySQL Server 2000. Do I need to get a more up to date SQL Server? I found some posts on the net last night about the error message I was getting @

http://weblogs.asp.net/coltk/archive...7/10/9920.aspx

but i do not seem to have the SQL Server in My Programs, i have tried to access it in other ways but cannot seem to find the section the forum is talking about, once i find it I think i can sort this. That is why i am unsure as to whether my SQL Server is the correct version.

Thanks for your reply, first time i have used a forum like this and to get a reply so quick was really nice

Ta
ralph.wigham is offline  
Old 08-11-2004, 09:14 AM   #4 (permalink)
 
Newb Techie

Join Date: Aug 2004

Posts: 9

ralph.wigham

Default

OK, if anyone out there can help you are a beautiful person.

I am running Visual Studio 2003, Microsoft Server 2000 Developer Edition and Windows XP Pro.

I have followed everything I have found on the internet about login issues, but still I keep getting the login failure messages that i originally posted.

I am starting to get quite desperate now as I have a project deadline getting ever closer, but until I can get my ASP.NET Applications to login to the server properly I am screwed.

Having read the posts via the link above, other people have had this problem and also it appears that people have managed to solve the problem also. So it can be done, I just need a helping hand please.

Cheers

R
ralph.wigham is offline  
Old 08-16-2004, 04:56 AM   #5 (permalink)
 
Monster Techie

Join Date: Nov 2002

Posts: 1,368

shan

Send a message via AIM to shan
Default

here's a stupid question, it's failing on line 52 (the sql open) becuase of the username or password. has this userid & password been added to be able to acces the db server....

try using the root account to see if you can access that? if so, looks like there could be a problem with the ASHLEY account.
__________________
<center><h2><font color=\"red\">C:\\ Is the root of all evil</font></h2>
<hr width=\"50%\">
phiber@sysdum.com
spam this account, it's fun.
shan is offline  
Old 08-16-2004, 12:58 PM   #6 (permalink)
 
Newb Techie

Join Date: Aug 2004

Posts: 9

ralph.wigham

Default

Hi Shan,

Thanks for the reply, I have sorted what I was doing wrong, you were perfectly correct, the username and ID were not registered correctly. After downloading a free asp.net forum (which configured my server to work on it properly), I was able to see how it should work, and so copied the configuration. I feel a bit stupid as it was a really stupid mistake.

Just for info. I've been to Spokane, a friend of mine used to live there, I am jealous of you for being there, but jealous in a nice way.

Thanks

Ralph
ralph.wigham is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On