Results 1 to 9 of 9

Thread: Connect to SQL Server from win form over LAN

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Connect to SQL Server from win form over LAN

    how my connection string should be if i want to access remote(within out local network) sql sever from a win form?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connect to SQL Server from win form over LAN

    Hey,

    Have a look at the connectionstrings link in my signature, you should be able to find the answer there.

    Hope that helps!!

    Gary

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Re: Connect to SQL Server from win form over LAN

    i am able to connect this database from aspx web page.

    i have connection string saved in the web config file.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connect to SQL Server from win form over LAN

    Hey,

    Were you asking a question there?

    Gary

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Re: Connect to SQL Server from win form over LAN

    sorry, i like to know is this ok,

    strConnection = ("Driver={SQL Server};Server=xxx.xxx.x.xx;"
    "Trusted_Connection=no;"
    "Database=MyDatabaseName;Uid=MyUserName;Pwd=MyPassword;");

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connect to SQL Server from win form over LAN

    Hey,

    So which part of that is not discussed here:

    http://www.connectionstrings.com/sql-server-2005#1

    Gary

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Re: Connect to SQL Server from win form over LAN

    i used this one:

    Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

    but still i am getting remote connection not allowed error.

    from surface area configuration i have enabled remote connection(TCP/IP and named pipes)

    added sqlserver.exe to windows firewall.

    why am i still unable to connect to db?

  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connect to SQL Server from win form over LAN

    Hey,

    Have you also checked this section of the connectionstrings website?

    http://www.connectionstrings.com/Art...twork-protocol

    Also, are you getting an error returned? If so, what is it?

    Gary

  9. #9

    Thread Starter
    New Member
    Join Date
    Mar 2009
    Posts
    5

    Re: Connect to SQL Server from win form over LAN

    thanks you so much for replying, i ma going to try it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width