|
-
March 18th, 2008, 06:38 AM
#1
how to make connection of database in vb.net 2005?
hi all,
I am vb.net 2005 beginner. so please tell me how to do connection with vb.net 2005. Please tell me from startup.
Thanks
-
March 18th, 2008, 07:50 AM
#2
Re: how to make connection of database in vb.net 2005?
Hi buzzup
It all depends on what DB you plan to connect to ?? Is it MySQL ,MSSQL, SQLServer, Access ....
Tell us more of what your planning and then we can help you more..
Gremmy..
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
March 18th, 2008, 08:56 AM
#3
Re: how to make connection of database in vb.net 2005?
it will be a lot quicker for you if you just google vb.net and whatever type of DB you will be using. There are tons of tutorials out there for every type of DB.
-
March 29th, 2008, 04:09 PM
#4
Re: how to make connection of database in vb.net 2005?
Here is sample code: Caution - I code any variable starting with g is a global variable...
Imports System.Data
Imports System.Data.OleDb
Public Class frmCDLib
Private Sub frmCDLib_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
gstrDBPath = "C:\Databases\DigitalLibrarian.mdb"
gstrProvider = "PROVIDER=Microsoft.jet.OLEDB.4.0;Data Source = " & gstrDBPath
Dim ConnectionString As String = gstrProvider
Dim Connection As OleDbConnection = New OleDb.OleDbConnection(ConnectionString)
Connection.Open()
MsgBox("Database Opened Successfully")
' Go do your thing here------>
Connection.Close()
MsgBox("Database Successfully Closed")
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|