How to access database from another machine?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bougie
    New Member
    • Aug 2010
    • 11

    #1

    How to access database from another machine?

    I have installed an application on machine X, this application is a C# application and stores the data on sql server 2008 and it is working perfectly on Machine X.
    Now my problem is I trying to acces this application from machine Y and I could not access it and this error I got when I tried access this application:

    System.Data.Sql Client.SqlExcep tion: A network-related or instance-specific error occurred while establishing a on to SQL Server.The server was not found or was not accessible.Veri fy that the instance name is correct and that SQL Server is configured to allow remote connections.(pr ovider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    so please can any one help on this error

    Thanks,
    Bougie
  • Bryan Cheung
    New Member
    • Nov 2010
    • 55

    #2
    Goto: "Start > All programs > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager"

    Open SQL Server Network Configuration and choose your protocol, mine is MSSQLSERVER then enable Named Pipes, I recommand enabling TCP/IP also if its disabled.

    -B

    Comment

    • bougie
      New Member
      • Aug 2010
      • 11

      #3
      I didn't find any protocols in Sql Server Network Configuration.. . By the way I have the Sql Server 2008 Express Edition is it related to this problem...
      Thanks,
      Bougie

      Comment

      • Bryan Cheung
        New Member
        • Nov 2010
        • 55

        #4
        What did you find?

        I have listed:
        -Protocols for MSSQLSERVER
        -Protocols for SQLEXPRESS

        B.

        Comment

        • bougie
          New Member
          • Aug 2010
          • 11

          #5
          I opened the Sql Server Network Configuration and I didnt find any thing in it..!!
          thanks
          bougie

          Comment

          • Bryan Cheung
            New Member
            • Nov 2010
            • 55

            #6
            Strange, this is on Machine X right?

            B.

            Comment

            • bougie
              New Member
              • Aug 2010
              • 11

              #7
              yes this is on mashine x..

              thanks, any way
              bougie

              Comment

              • Bryan Cheung
                New Member
                • Nov 2010
                • 55

                #8
                Is the user you use allowed to open a connection to the DB? and does your DB allow connections from outside?

                B.

                Comment

                • bougie
                  New Member
                  • Aug 2010
                  • 11

                  #9
                  Actually I dont know, do you have any way that I can check these things ?
                  thanks,
                  Bougie

                  Comment

                  • Bryan Cheung
                    New Member
                    • Nov 2010
                    • 55

                    #10
                    First for the user:
                    In SQL Server Management Studio go to Security > Logins and right-click on your user.

                    On the left, select the page: Status
                    You see the permission there, the setting should be Grant and Login Enabled. (Radiobuttons)

                    For the Database:
                    Right-click on your database and click on Properties. Choose the Permissions page.

                    Now you should see the user you connect with in the list underneath "Users or roles:"

                    Click once on your user and check the permissions:
                    "Connect" should be "Grant"-ed and I would also check if "View definition" is granted.

                    B.

                    Comment

                    Working...