Problem Opening Query In .Net - TechRepublic
General discussion
March 25, 2005 at 07:41 AM
jkaufmann

Problem Opening Query In .Net

by jkaufmann . Updated 21 years, 3 months ago

To: Larry Toole
Subject: SQL Server

I have been studying .NET and most of the reference materials use MS SQL Server in their examples. I am running Windows2003 professional as my server and IIS 6.0.
I am running SQL Server 2000 service pack 3.

I am going through the samples in Apress’s book “Beginning Visual Web Programming in C#”

I am able to utilize SQL server from within Visual Studio using the Server Explorer option so I know that it is running and that on some level I have rights.

In the sample app from the tutorial that I am currently working through the command string is:

“data source=instance;initial catalog=FriendsData; user=John Kaufmann;pwd=mypassword”

when I run the app and it attempts to open the SqlConnection I get a run time error: SQL Server does not exist or access denied
It references that the exception occurs on the line con.Open().

I am assuming that the problem is with my user name and/or password.

If I go into Internet Information Services (IIS) Manager and go to Local Computer->Web Site->FriendsReunion (Where Friends Reunion is the virtual directory)

I select properties. I select the tab Directory Security and the click on the Edit Button in the group box titled Authentication and access control I get a dialogue box with Enable anonymous access checked and Integrated Windows authentication checked. I get the user name as IUSR_OLDDELL and the pass word as a string that is ten (10) characters long.

I am assuming that this is the user name and password that I need to open the FriendsReunion database.

The first odd thing that I do not understand the source of both this user name and password. I always use my own name as the user name and a standard password of six characters. The name of the local computer is OLDDELL so it appears that some where IIS created the user name as the default utilizing the local computer name as part of the user name. I do not know where the password came from. When I attempt to change the password to the one I normally use (six characters long) it appears to let me do it. I get no errors when I change it and click OK, but if I reopen the dialogue window by clicking the EDIT Button again, the original string with ten characters is back again.

I have reached the rat in the maze stage with this, having done a number of searches of the microsoft knowledge base and Google and explored all kinds of options in both the SQL manager, the IIS manager, and playing with different user and password text.

Any help would be appreciated.

This discussion is locked

All Comments