I am unable to connect to the database.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kannanmahalingam
    New Member
    • Sep 2006
    • 1

    I am unable to connect to the database.

    My frontend is an interface application in ASP.Net(VB.NET language). Backend is SQLSERVER.
    The connection string I have written is as follows:-

    cn=new SqlConnection(" server=MUM2\SQL SERVER;Initial Catalog=Pubs;ui d=sa;pwd=;")

    The program compiles but gives the following Runtime Error:

    Server does Not Exist.

    From Where I could find out the name of the Server.
  • Habeebuddin
    New Member
    • Sep 2006
    • 8

    #2
    Instead of using server=MUM2\SQL SERVER, write the follwing


    data source=MUM2\SQL SERVER

    Comment

    • nmsreddi
      Contributor
      • Jul 2006
      • 366

      #3
      hi

      if you are using sqlserver existed in your system then write

      server=localhos t


      if you are using a remote server then first make sure the server exist by opening it from query analizer

      hope may help u

      Comment

      • polygonVB
        New Member
        • Sep 2006
        • 15

        #4
        click
        [START] >> [RUN] >> then type "services.m sc"

        if you see MSSQL$SQLSERVER then you can use
        "Data Source=(local)\ SQLSERVER;Initi al Catalog=pubs;Us er Id=;Password=;"
        or
        "Server=(local) \SQLSERVER;Data base=pubs;User ID=;Password=;T rusted_Connecti on=False"

        if you don't see that then I'm guessing that MUM2 is the name of your computer and in that case you can use

        "Data Source=(local); Initial Catalog=pubs;Us er Id=;Password=;"
        or
        "Server=(local) ;Database=pubs; User ID=;Password=;T rusted_Connecti on=False"

        Check out http://www.connections trings.com/
        its a really good resource because well you can't remember every connection string can you?

        Paul

        Comment

        Working...