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. sqlconnection

sqlconnection

Scheduled Pinned Locked Moved C#
helpdatabasequestionsql-serversysadmin
3 Posts 3 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.
  • R Offline
    R Offline
    reza assar
    wrote on last edited by
    #1

    hi how can i fix this problem in my connection string ? LocalConnection = new SqlConnection("data source=localhost;database=Alarms;Integrated Security=True"); it will fixed when i substitute "localhost" with ".\\sqlexpress" i want to work with sqlServer 2005 not sqlexpress the error is: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    B S 2 Replies Last reply
    0
    • R reza assar

      hi how can i fix this problem in my connection string ? LocalConnection = new SqlConnection("data source=localhost;database=Alarms;Integrated Security=True"); it will fixed when i substitute "localhost" with ".\\sqlexpress" i want to work with sqlServer 2005 not sqlexpress the error is: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      check this http://www.connectionstrings.com/[^]


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      1 Reply Last reply
      0
      • R reza assar

        hi how can i fix this problem in my connection string ? LocalConnection = new SqlConnection("data source=localhost;database=Alarms;Integrated Security=True"); it will fixed when i substitute "localhost" with ".\\sqlexpress" i want to work with sqlServer 2005 not sqlexpress the error is: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

        S Offline
        S Offline
        shecool
        wrote on last edited by
        #3

        Use \\ComputerName\SQL2005ServerName insteed of localhost

        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