Searching a Database

a02227

Member
Joined
Nov 30, 2004
Messages
15
Location
Ireland
Programming Experience
Beginner
could anyone tell me how i would go about search this database. Also move to the next record in it would be very helpful also. I have got it filling the textboxes but it only fills the first record in the database. this is what i have so far: -

DataSet11.Clear()
OleDbDataAdapter1.Fill(DataSet11, "Members")
txtMemNo.Text = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Membership No")
txtSurname.Text = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Surname")
txtFirst.Text = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].First Name")
txtDOB.Text = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Date of Birth")
txtDate.Text = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Date of Last Test")
MemImage.ImageUrl = DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Photograph")
If (DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Test Result") = "0") Then
rdbPos.Checked = True

ElseIf (DataBinder.Eval(DataSet11, "Tables[Members].DefaultView.[0].Test Result") = "1") Then
rdbNeg.Checked = True
End If
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,345
Location
Sydney, Australia
Programming Experience
10+
Your code is using row index 0. To access other rows simply change the index. To access all rows, use a loop that increments the index from 0 to DataSet11.Tables("Members").Rows.Count - 1.
 
Top Bottom