Connect to SQL Server 2008 through TCP / IP Using VB.NET 2008 Project

Hi this is Vb.net connect sql server using TCP/IP before run this program you need to install a vb.net 2008 and sql server 2008 here in example code: Hi you need to do this click all program/ ms sql server 2008 / configuration tool then click SQL server configuration manager select you server name then rigth click properties you need to enable a TCP and IP add then Restart "you need to do this VB.net is computer 1 and sql server is computer 2 same both installation of sql server" Imports System.Data.SqlClient Imports System.Data Module Module1 Public Con As SqlConnection Public constr As String Public usertype As String Public Sub main() constr = "Data Source="IP add of computer" ,"TCP Port";Network Library=DBMSSOCN;Initial Catalog="databaseName; Trusted_connection=True" Con = New SqlConnection(constr) Try Con.Open() MsgBox("Server Connection is Open ! ") Con.Close() Catch ex As Exception MsgBox("Sorry Can not open connection ! ") End Try End Sub End Module

Comments

Thank you i have imformation how to connect vb.net to sql server of another computer

hello how do i connect the client to server in vb 2008....we propose a computerized voting system and we use vb 2008...pls help.

Hi you want to have a 1 server and more client... you want to do this!! Server(Sql server 2008 or Sql server 2012) client (Vb 2008 or vb 2010) learn about local coonection to server connect the vb as client sample Pc1 as server PC2 as client if you want to connect the server as a global network you need to host the database anywhere you can connect the server!! give your email and i send you the example that!! :)

Your idea is what i need for my system i tried to improved here in ofc. Now i just ask you if you could help me for this, i have a server 2003 here and ms sql 2005. And i use Visual Basic 6.0 as my program application. I connect already the sql server for only local area but i also wanted to connect anywhere i want using TCP/IP. Kindly PM me. Thanks.. You can email me [email protected]

In reply to by Anonymous (not verified)

You need to host your database to internet for become a Global Network and you can connect anywhere!!!

mr. Price, thank you for your code, however im still having trouble. my connection string is ; Data Source= 58.167.**.**.,1433\.\SQLEXPRESS;Network Library=DBMSSOCN;Initial Catalog=northwind; integrated security=True PLEASE HELP!, william

hi princenathan, ask some help i need to connect may system to the network using tcp/ip. On your sample tcp/ip connect. i just want to clarify; on computer 1, I need to install vb.net and computer 2, which the ms sql server to be intalled, or both computer 1&2? please help thank you., if you have a video of this tutorial please send my email: [email protected]

Add new comment