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. Web Development
  3. ASP.NET
  4. accsess database on host

accsess database on host

Scheduled Pinned Locked Moved ASP.NET
databasesysadminhelpsql-servercom
8 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.
  • F Offline
    F Offline
    fattycode
    wrote on last edited by
    #1

    Hi, I have bought hosting and I put there all my web project,in folder App_Data I have database which I have created in SQLExpress. Problem is that I cant connect in databse which is in host,in localhost works good without problem. My connection string in webconfig file is <add name="DBConn" connectionString="Server=www.mydomainname.com;Database=myDatabaseName;Trusted_Connection=True;" providerName="System.Data.SqlClient" /> </connectionStrings> I get error

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    How can I make connection string to access in database.

    M N G 3 Replies Last reply
    0
    • F fattycode

      Hi, I have bought hosting and I put there all my web project,in folder App_Data I have database which I have created in SQLExpress. Problem is that I cant connect in databse which is in host,in localhost works good without problem. My connection string in webconfig file is <add name="DBConn" connectionString="Server=www.mydomainname.com;Database=myDatabaseName;Trusted_Connection=True;" providerName="System.Data.SqlClient" /> </connectionStrings> I get error

      A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

      How can I make connection string to access in database.

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      fattycode wrote:

      Server=www.mydomainname.com

      This should be the url. Check with your hosting provider regarding the Server name/ipaddress.

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      F 1 Reply Last reply
      0
      • M Manas Bhardwaj

        fattycode wrote:

        Server=www.mydomainname.com

        This should be the url. Check with your hosting provider regarding the Server name/ipaddress.

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        F Offline
        F Offline
        fattycode
        wrote on last edited by
        #3

        www.mydomainname.com I used only to explain problem,that is not my real domain name. I tried too most of connection strings from www.connectionstrings.com but still is not working :((

        1 Reply Last reply
        0
        • F fattycode

          Hi, I have bought hosting and I put there all my web project,in folder App_Data I have database which I have created in SQLExpress. Problem is that I cant connect in databse which is in host,in localhost works good without problem. My connection string in webconfig file is <add name="DBConn" connectionString="Server=www.mydomainname.com;Database=myDatabaseName;Trusted_Connection=True;" providerName="System.Data.SqlClient" /> </connectionStrings> I get error

          A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

          How can I make connection string to access in database.

          N Offline
          N Offline
          Nisha Agrawal
          wrote on last edited by
          #4

          i think u have to provide the access credentials to the database in the connection string.

          F 1 Reply Last reply
          0
          • F fattycode

            Hi, I have bought hosting and I put there all my web project,in folder App_Data I have database which I have created in SQLExpress. Problem is that I cant connect in databse which is in host,in localhost works good without problem. My connection string in webconfig file is <add name="DBConn" connectionString="Server=www.mydomainname.com;Database=myDatabaseName;Trusted_Connection=True;" providerName="System.Data.SqlClient" /> </connectionStrings> I get error

            A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

            How can I make connection string to access in database.

            G Offline
            G Offline
            GauravKP
            wrote on last edited by
            #5

            Try it by using the IP address, Database server User ID and password... it will work

            F 1 Reply Last reply
            0
            • G GauravKP

              Try it by using the IP address, Database server User ID and password... it will work

              F Offline
              F Offline
              fattycode
              wrote on last edited by
              #6

              My database is inside App_Data folder and I used this connection string but again I cant access my database. Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbname.mdf; Database=mydbname;Trusted_Connection=Yes;

              1 Reply Last reply
              0
              • N Nisha Agrawal

                i think u have to provide the access credentials to the database in the connection string.

                F Offline
                F Offline
                fattycode
                wrote on last edited by
                #7

                Can you give me any example or any link to read about it?

                N 1 Reply Last reply
                0
                • F fattycode

                  Can you give me any example or any link to read about it?

                  N Offline
                  N Offline
                  Nisha Agrawal
                  wrote on last edited by
                  #8

                  try this sample connection string

                  Data Source=yourdataserver;Initial Catalog=databasename;Persist Security Info=True;User ID=DBusername;Password=DBpassword

                  just replace the values from the actual value.

                  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