SQL Server Does Not Exist... & ASP.NET/VB.NET 1.1


I have a web app on my local computer and I can't seem to get it to talk with my database. I keep getting that error message in the title of this message.  I have SQL Server 2K running locally. My web app is running locally with IIS 5.

**** Homepage code ************

' Create Instance of Connection and Command Object
        Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
        Dim myConnection2 As String = ConfigurationSettings.AppSettings("ConnectionString")
        Trace.Warn("Connection String: ", myConnection2)

        Dim myCommand As SqlCommand = New SqlCommand("GetHomepageProducts", myConnection)

        ' Mark the Command as a SPROC
        myCommand.CommandType = CommandType.StoredProcedure

        ' Execute the command
        Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)

        repFeatureProduct.DataSource = result


**** web.config *****

<add key="ConnectionString" value="server=localhost;uid=cmlawson;pwd=balboa;database=DPX;" />


I've also tried the following string in the web.config file:

<add key="ConnectionString" value="data source=localhost;initial catalog=DPX;integrated security=SSPI;persist security info=False;Trusted_Connection=Yes;"></add>

In my SQL Server Enterprise Manager, under the 'Users' tab of my dB called 'DPX' I have the following users:

NAME                              LOGIN ACCESS                         DATABASE ACCESS
BUILTIN/Administrators     BUILTIN/Administrators         Permit
cmlawson                        cmlawson                            Permit
dbo                                 DELL1/Chad Michael Lawson  Permit
DELL1/ASPNET                 DELL1/ASPNET                     Permit
DELL1/IUSR_DELL1           DELL1/IUSR_DELL1               Permit
Guest                                                                        Via group membership

I've read almost all the posts related to this topic on this site and others but I can't seem to figure out what's going wrong so I'm hoping someone can help me out?

If I'm leaving out any relevant info please ask me and I'll do what I can to give it too you. Keep in mind I'm not a whiz in SQL Server but can get around OK in asp.net.

Who is Participating?
Try browsing the database from the VS.net server browser and add the database from there. Then look at the connection property and check the connection string. Also, when installing the DB did you specify an instance name?
     <add key="ConnectionString" value="server=localhost;database=testdb;User ID=xxx;Password=xxxx" />

cmlawsonAuthor Commented:
bsdotnet: tried your suggestion but it didn't work out for me.

meomar: tried that out and worked great. I've never used Visual Studio in that manner and I think it's a great little trick! After I compared the connection string in VS.NET with mine the only difference was my data source was set to 'localhost' and it's was set to 'DELL1'. I don't know why this matters but I'm guessing it's a permission's thing. Anyway, all said and done, I have a new trick in my bag now and I also have my problem solved.

Thanks so much!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.