Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem when connect to sql server

problem when connect to sql server

Scheduled Pinned Locked Moved C#
databasehelpjavasql-serversysadmin
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mjawadkhatri
    wrote on last edited by
    #1

    hi, when i connect to sql server give error Error is "Cannot open database "PENTIUMD" requested by the login. The login failed. Login failed for user 'sa'." i am using blow code SqlConnection con = new SqlConnection("Data Source=(local); Initial Catalog =PENTIUMD;User ID=sa;Password=java;"); servername=pentiumd user=sa password=java thanks in advance mjawadkhatri

    C P 2 Replies Last reply
    0
    • M mjawadkhatri

      hi, when i connect to sql server give error Error is "Cannot open database "PENTIUMD" requested by the login. The login failed. Login failed for user 'sa'." i am using blow code SqlConnection con = new SqlConnection("Data Source=(local); Initial Catalog =PENTIUMD;User ID=sa;Password=java;"); servername=pentiumd user=sa password=java thanks in advance mjawadkhatri

      C Offline
      C Offline
      Calla
      wrote on last edited by
      #2

      And is "pentiumd" your local machine where you run your code? What if you change the Data Source=(local) to the actual IP-address?

      1 Reply Last reply
      0
      • M mjawadkhatri

        hi, when i connect to sql server give error Error is "Cannot open database "PENTIUMD" requested by the login. The login failed. Login failed for user 'sa'." i am using blow code SqlConnection con = new SqlConnection("Data Source=(local); Initial Catalog =PENTIUMD;User ID=sa;Password=java;"); servername=pentiumd user=sa password=java thanks in advance mjawadkhatri

        P Offline
        P Offline
        puri keemti
        wrote on last edited by
        #3

        (1) Check either SQL Login is enabled or not? (2) Use the Instance name instead of (local) and check the enabled protocols for the same.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups