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. Database & SysAdmin
  3. Database
  4. ConnectionString for Server

ConnectionString for Server

Scheduled Pinned Locked Moved Database
databasequestionsysadminsecuritytutorial
6 Posts 4 Posters 0 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.
  • V Offline
    V Offline
    Vector7
    wrote on last edited by
    #1

    I want my client app connecting to an external server with IP 1.1.1.1 for example. The database is called "WORK" I tried to use URI Uri url = new Uri("http://1.1.1.1/); connDB = new SqlConnection(); connDB.ConnectionString="data source="+url.Host+" + "initial catalog=WORK;" + "user id=me;" + "pwd=me;" + "packet size=4096;" + "persist security info=false;"; connDB.Open(); doesn't work... Also if I am trying to access the local server db, it fails. Even if data source is (local). How can I access external server's db by IP ?

    D L L 3 Replies Last reply
    0
    • V Vector7

      I want my client app connecting to an external server with IP 1.1.1.1 for example. The database is called "WORK" I tried to use URI Uri url = new Uri("http://1.1.1.1/); connDB = new SqlConnection(); connDB.ConnectionString="data source="+url.Host+" + "initial catalog=WORK;" + "user id=me;" + "pwd=me;" + "packet size=4096;" + "persist security info=false;"; connDB.Open(); doesn't work... Also if I am trying to access the local server db, it fails. Even if data source is (local). How can I access external server's db by IP ?

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      Vector7 wrote: doesn't work... Could you give more details? What is the error message? Yes, even I am blogging now!

      V 1 Reply Last reply
      0
      • D Daniel Turini

        Vector7 wrote: doesn't work... Could you give more details? What is the error message? Yes, even I am blogging now!

        V Offline
        V Offline
        Vector7
        wrote on last edited by
        #3

        'SQL Server does not exist or access denied' If I am right, there only can one instance of SQL Server at the same time ?

        L 1 Reply Last reply
        0
        • V Vector7

          I want my client app connecting to an external server with IP 1.1.1.1 for example. The database is called "WORK" I tried to use URI Uri url = new Uri("http://1.1.1.1/); connDB = new SqlConnection(); connDB.ConnectionString="data source="+url.Host+" + "initial catalog=WORK;" + "user id=me;" + "pwd=me;" + "packet size=4096;" + "persist security info=false;"; connDB.Open(); doesn't work... Also if I am trying to access the local server db, it fails. Even if data source is (local). How can I access external server's db by IP ?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Try to copare your code and the library of connection string.[^]. Learn from it and let me know if it is working or not.


          A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office

          1 Reply Last reply
          0
          • V Vector7

            I want my client app connecting to an external server with IP 1.1.1.1 for example. The database is called "WORK" I tried to use URI Uri url = new Uri("http://1.1.1.1/); connDB = new SqlConnection(); connDB.ConnectionString="data source="+url.Host+" + "initial catalog=WORK;" + "user id=me;" + "pwd=me;" + "packet size=4096;" + "persist security info=false;"; connDB.Open(); doesn't work... Also if I am trying to access the local server db, it fails. Even if data source is (local). How can I access external server's db by IP ?

            L Offline
            L Offline
            Luis Alonso Ramos
            wrote on last edited by
            #5

            I don't know if it may be the case, but try removing that http:// prefix in the URL. That prefix indicates it is HTTP protocol (for web pages) and the server address is only the IP. -- LuisR


            Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

            1 Reply Last reply
            0
            • V Vector7

              'SQL Server does not exist or access denied' If I am right, there only can one instance of SQL Server at the same time ?

              L Offline
              L Offline
              Luis Alonso Ramos
              wrote on last edited by
              #6

              Vector7 wrote: If I am right, there only can one instance of SQL Server at the same time ? Actually there can be many (I think up to 16, but I'm not sure). Suppose the server is called SERVER. The default instance is unnamed and thus is accessed with SERVER. The other instances are named (say SQLSRV1) and it's accessed with SERVER\SQLSRV1. -- LuisR


              Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

              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