You must Sign In to post a response.
  • Category: SQL Server

    Ms SQL database sharing for LAN connection terminals

    I developed one application in VB.NET and there is one need that, Application must be on LAN connection terminals.
    I used Ms SQL 2005 as back end, the issue is by using connection string |datadirectory|\database.mdf, I was getting an error in other computers.
    Then I have again changed the whole method and trying to execute in ODBC, but still I cannot able to connect the Ms SQL database in other computers.

    What can be the connection string if I am using any of them?
  • #767585
    are you able to connect to you sql server with same credential from SQL Server management Studio. locally and Remotely.
    If you are able to connect only locally but not from another machine.
    then follow the below steps

    make a connection with you sql server from mangement studio from local machine.
    and fire below given code
    EXEC sys.sp_configure N'remote access', N'1'

    it will allow your sql server for remote connections

    Many Thanks
    Tejinder Singh Barnala
    /*I have the simplest tastes. I am always satisfied with the best*/

  • #767591
    if you have sql server installed on LAN then you can simply build your connection string like below format

    Provider=SQLOLEDB;DATA SOURCE=IPAddress of Server where SQL is installed;UID=sa;PWD=PWD of sql user;DATABASE=databasename
    it should help, if you have SQL Express edition then you nee to use below connection string
    Provider=SQLOLEDB;DATA SOURCE=IPAddress of Server where SQL is installed\SQLEXPRESS;UID=sa;PWD=PWD of sql user;DATABASE=databasename
    revert if you have face any error

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • Sign In to post your comments