|
-
May 29th, 2007, 05:37 AM
#1
database?
Hi,
I have VB.net 2003 standard and have no DB hookup like in vb.nt professional I believe. I want to connect to a database.
is it still possible to connect to a mysql DB or old access DB with code in the standard version of VB?
-
May 29th, 2007, 05:42 AM
#2
Re: database?
Yes it is possible. Just use the System.Data namespace.
-
July 10th, 2007, 07:14 PM
#3
Re: database?
Hi,
Could I have an example of what you code to connect to a access database with using vb.net 2003 standard (no DB controls)?
-
July 11th, 2007, 02:16 AM
#4
Re: database?
 Originally Posted by jagguy
Hi,
Could I have an example of what you code to connect to a access database with using vb.net 2003 standard (no DB controls)?
Take a look at this
http://visualbasic.about.com/od/lear.../aa050303a.htm
-
July 11th, 2007, 02:25 AM
#5
Re: database?
Connectin to Access Database and fetching data to dataGridView.
Code:
Dim conn As OleDb.OleDbConnection
Dim adapter As OleDb.OleDbDataAdapter
Dim dt As DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\attendence.mdb;Persist Security Info=False")
adapter = New OleDb.OleDbDataAdapter("SELECT rno,name FROM student", conn)
dt = New DataTable("Student")
adapter.Fill(dt)
DataGridView1.DataSource = dt
End Sub
Link
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
|