Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2011, 03:46 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Default Chap 12 - Login failed for user....

In Chap 12, I'm having consistent trouble either using or creating a database. I keep getting an error msg, "Login failed for user 'Gateway_64\Jack.

I should be logging onto my server at 'Gateway_64\SQLEXPRESS'

How can I correct this situation permanently so that whenever I create a database the system knows that I should be logging into Gateway_64\SQLEXPRESS without any intervention from me.

Thanks in advance,

JKoyle
 
Old August 4th, 2011, 05:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post your connection string? Is your account an administrator on your machine? And do you run this using the local development server or are you using IIS?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 4th, 2011, 07:01 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Connection String = Data Source=GATEWAY_64\SQLEXPRESS;AttachDbFilename=C:\B egASPNET\Site\App_Data\PlanetWrox.mdf;Integrated Security=True

Account is Administrator

I'm running this on my local machine.


I created a workaround by Modifying my connection so everything works. However, I would like to avoid having to modify my connection. Isn't there a default setting somewhere that I can set?

JKoyle
 
Old August 5th, 2011, 02:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
However, I would like to avoid having to modify my connection. Isn't there a default setting somewhere that I can set?
Not sure what you mean by that. What did you have to change? And what did you change it from?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 5th, 2011, 09:51 AM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Default Chap 12 - Can' t logon to server Page 407, Item 4.

I received this error today...Login failed for user 'Gateway_64\Jack'.

here is the INCORRECT connection string

Data Source=.\SQLEXPRESS;AttachDbFilename=C:\BegASPNET\ Site\App_Data\PlanetWrox.mdf;Integrated Security=True;User Instance=True

I SELECTED MODIFY CONNECTION WHEN I RIGHT MOUSE PlanetWrox.mdf in the Server Explorer

Data Source was incorrect. It had Microsoft SQL Server Database File (SqlClient).

I changed it to Microsoft SQL Server.

The Data Provider had .NET Framework Data Provider for SQL Server. I DID NOT CHANGE THAT.

At the bottom I CHECKED 'Always use this selection. I clicked OK

From the drop down arrow, I selected GATEWAY_64\SQLEXPRESS. They were all in caps.

The next option was to connect to a database. There were 2 choices (radio buttons).

The first one, Select or enter a database name did not work, even with the correct database name, C:\BegASPNET\Site\App_Data\PlanetWrox.mdf

I then chose the 2nd radio button, Attach a database file, C:\BegASPNET\Site\App_Data\PlanetWrox.mdf and then clicked on Test Connection. The results were positive, a dialog box told me Test connection succeeded

I then clicked OK.

My new correct connection string = Data Source=GATEWAY_64\SQLEXPRESS;AttachDbFilename=C:\B egASPNET\Site\App_Data\PlanetWrox.mdf;Integrated Security=True

EVERYTHING WORKS, HOWEVER, HERE IS MY PROBLEM:

WHY DO I HAVE TO DO THIS EACH AND EVERYTIME I OPEN VWD and select my Project name of Site. Why to I have to Modify the Connection AGAIN?

PLEASE HELP. THIS SHOULD NOT BE NECESSARY AND IT IS VERY FRUSTRATINNG.

Thanks,

JKoyle
 
Old August 5th, 2011, 10:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

No need to shout; we hear you loud and clear (writing in ALL CAPS is considered shouting in public forums and comes across as a bit impolite).

That said, the change I see in the connection string is the machine name versus the dot (.), and the use rinstance, right?

If so, you may want to look at Appendix B and follow the instructions around page 760 and enable TCP ID and Named Pipes.

You may also want to verify the settings under Tool | Options | Database Tools | Data Connections and see if SqlExpress is the named instance.

If this doesn't help, I don't know what's going on.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
login failed for user Domain\User ID GailCG SQL Server 2005 0 June 29th, 2009 10:45 AM
Getting 'Login failed for user ' Squeakrz44 VB.NET 2002/2003 Basics 0 November 18th, 2006 06:09 PM
login failed for user domain\user babakwx SQL Server 2000 2 May 30th, 2006 12:28 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.