Proposed how to share my database on lan?

  • Friday, August 31, 2012 12:42 PM
     
     

    Hello,

    I installed SQL server 2008 R2 and I don't know how to share my database on LAN .

    I can Connect to SQL server ON Local PC but when I setup my app to other PC and Try to connect to sql server on LAN Say this Problem,

    I created my app with vb 2010 this are my Code, PLEASE guide me.
    thanks

All Replies

  • Friday, August 31, 2012 12:50 PM
     
      Has Code

    Hi,

    What edition of sql server did you install.  Whilst on the machine locally, run:

    select SERVERPROPERTY('edition')

    Have you enabled remote connections?

    Are there any firewalls between your client and server?  If so, are the SQL Server ports excluded?

    If it's a named instance, is the SQL Server Browser service running?

    Can you telnet to the port sql server's listening on?



    Thanks, Andrew

  • Friday, August 31, 2012 4:37 PM
     
     

    Hi,

    My Remote Connection is enable.

    first of all I add port sql to my Firewall , but I turn off the firewall.

    my SQL server browser service is running.

    yes i can Telnet to my port       " Telnet    192.168.1.2     1433"

    I think my SQL server is not on Network please Guide me 

    Thanks.

  • Saturday, September 01, 2012 8:39 AM
     
     Proposed

    If your computer is on network than you SQL Server is also on network. I suggest you to ping your computer from different computer. Also ensure TCP\IP is enabled for you SQL Server instance. Also check the following:

    7 things to check to resolve  “A network-related or instance-specific error occurred while establishing a connection to SQL Server…”  
    by Donabel Santos

    If you get the following SQL Server 2005 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ”

    Things to check:

    1. Make sure your database engine is configured to accept remote connections

    • Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
    • Click on Surface Area Configuration for Services and Connections
    • Select the instance that is having a problem > Database Engine > Remote Connections
    • Enable local and remote connections
    • Restart instance

    2. Check the SQL Server service account

    • If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding

    3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application

    • Usually the format needed to specify the database server is machinename\instancename
    • Check your connection string as well

    <connectionStrings>

    <add name="SampleConnectionString" connectionString="Data Source=machinename\instancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30″ providerName="System.Data.SqlClient"/>

    </connectionStrings>

    4. You may need to create an exception on the firewall for the SQL Server instance and port you are using

    • Start > Run > Firewall.cpl
    • Click on exceptions tab
    • Add the sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Binn, check your installs for the actual folder path), and port (default is 1433)
    • Check your connection string as well

    5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings

    6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.

    7. Check that you have connectivity to the SQL Server. 

    Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
    • Start > Run > cmd
    •netstat -ano| findstr 1433
    •telnet myserver 1433
    •ping -a myserver

    Check what ports are IP addresses are being returned.

    If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password combo in your web application.


    Regards,

    Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)

    http://basitaalishan.com

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Proposed As Answer by Basit Farooq Saturday, September 01, 2012 8:40 AM
    •  
  • Tuesday, September 04, 2012 7:46 PM
    Moderator
     
     

    Hello,

    Please, could you have a look at this link ?

    http://msdn.microsoft.com/en-us/library/bb326379.aspx

    usually , it is because the name of the SQL Server instance ( found in Data Source ) is incorrect

    you have Data Source = omid-pc

    Please, could you explain what is the value omid-pc ? The name of the computer on which the SQL Server instance is installed ? If yes, it means that you have done a default install for SQL Server ( that's to say a no-named instance with the short name of the instance is empty )

    Please, could you tell us whether you are trying to the default instance on your remote computer named omid-pc ?

    Please, could you check whether the default instance on the omid-pc computer can accept remote connections ? ( for Express edition , the remote connections are disallowed as default , but , in this case , a default instance would use SQLEXPRESS except if you empty the name of the instance as i have done already )

    Please, could you confirm that TCP/IP protocol (dbmssocn for the Network Library property ) is enabled for remote connections ?

    If the audit of the successful/unsuccesful connections has been enabled , you should find the same ( and sometimes more complete ) informations  in the error log files of the SQ Server instance and these log files can be displayed in the SQL Server Management Studio ( right-click on the name of the instance, select Management and afterwards Errors log files and you have to choose the correct log file )

    Please, could you provide the version ( year + last installed service pack ) and edition ( Express,Express with Advanced Services, Web, Standard, Entreprise,...) ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.