User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 397,851 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,324 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 5035 | Replies: 4
Reply
Join Date: Jul 2007
Posts: 1
Reputation: edcaryl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
edcaryl edcaryl is offline Offline
Newbie Poster

Sql server connection using code in VB.NET

  #1  
Jul 23rd, 2007
Hi,

Does anyone have some good examples of ADO.NET code that demonstrates a coded connection to SQL Server such that bound controls bind to retrieve and update data.

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 2,639
Reputation: Ezzaral is a glorious beacon of light Ezzaral is a glorious beacon of light Ezzaral is a glorious beacon of light Ezzaral is a glorious beacon of light Ezzaral is a glorious beacon of light 
Rep Power: 11
Solved Threads: 261
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Maven
Join Date: Aug 2006
Location: India
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Rep Power: 4
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: Sql server connection using code in VB.NET

  #3  
Jul 24th, 2007
Try this

"Mod Alert" - Move the thread to VB.NET Forum.
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote  
Join Date: Jul 2007
Posts: 1
Reputation: MarianaM is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
MarianaM MarianaM is offline Offline
Newbie Poster

Re: Sql server connection using code in VB.NET

  #4  
Jul 31st, 2007
Originally Posted by edcaryl View Post
Hi,

Does anyone have some good examples of ADO.NET code that demonstrates a coded connection to SQL Server such that bound controls bind to retrieve and update data.

Thanks


try this:
Dim SQLConn As SqlConnection = New SqlConnection
SQLConn.ConnectionString = "Data Source=servername;" & _
"Initial Catalog=databasename;" & _
"User ID=username;" & _
"Password=userpassword;"
Reply With Quote  
Join Date: Aug 2007
Posts: 2
Reputation: kap_sharma is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kap_sharma kap_sharma is offline Offline
Newbie Poster

Re: Sql server connection using code in VB.NET

  #5  
Aug 2nd, 2007
the easy and best way to get connected with sql server is given below:-

"declare this in the code window on a form. this should be first line in the the code window, import the library class."

import system.data.sqlclient

"then declare these publically"

dim con as sqlconnection
dim cmd as sqlcommand
dim rs as recordset
dim da as sqldataadaptor

"on form load make the connection:"

con= new sqlconnection("connection string")
con.open
msgbox"ok"

"you are connected with sql server"

still you have any query pls mention.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 8:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC