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
 
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.
 
Back
Top