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

Posted on 2006-04-18
Last Modified: 2006-11-18

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

Question by:cmlawson
    LVL 12

    Expert Comment

         <add key="ConnectionString" value="server=localhost;database=testdb;User ID=xxx;Password=xxxx" />

    LVL 3

    Accepted Solution

    Try browsing the database from the 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?

    Author Comment

    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!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now