•
•
•
•
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
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
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;"
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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.
"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.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
.net access activation adsl adsl1 adsl2 adsl2+ asp backup blogger blogs cable code combo connection custom dani daniweb database development dreamweaver dropdownlist google html internet key linux microsoft module news per product programming rss second security serial server skin software source sql tags theme vista windows wysiwyg xml 240000
- Connecting to SQL server DB from VB.NET app (VB.NET)
- VB.Net and sql server connection (VB.NET)
- SQL SERVER 2000 Login failure in ASP.NET (ASP.NET)
- SQL Server 2000 and VB 6 (Visual Basic 4 / 5 / 6)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- SQL server error: 18452 - connection to SQL error (Windows NT / 2000 / XP / 2003)
Other Threads in the VB.NET Forum
- Previous Thread: Draw a Line or other Shape (Design Time)
- Next Thread: Access to control panel



Linear Mode