|
-
Jul 13th, 2009, 09:02 PM
#1
Thread Starter
Frenzied Member
Database Coding
I did the following code:
Imports System.Data
Imports System.data.OleDb
Public Class Form1
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Gautam\Documents\Visual Studio 2005\Projects\WindowsApplication7\WindowsApplication7\db2.mdb;")
con.Open()
cmd = New OleDbCommand("Select * from Table2", con)
dr = cmd.ExecuteReader
While dr.Read()
TextBox1.Text = dr(0)
TextBox2.Text = dr(1)
TextBox3.Text = dr(2)
End While
Catch ex As Exception
End Try
dr.Close()
con.Close()
End Sub
End Class
By this i can fetch only one row(the last row) of the access....
how to modify the above code to fetch all the rows starting from the begining from the database..........
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
|