How to get value on the same row using vb2005
hi guys,
i have a table in access look like this
Student ID Name
1 John
2 Smith
now everytime a user put in the student id it would populate the Name
But i cannot get the name to display right. Everytime i enter 2 it will give me John instead of Smith.
Now i need to do this without using Index like:
somethingDataSet.Tables("Student").Row(0).Item ("Name")
or
somethingDataSet.Tables("Student").Row(Index).Item ("Name")
because then its inefficiency b/c u have to check error
I tried to put this:
somethingDataSet.Tables("Student").Row("StudentID" ).Item ("Name")
This gave me MissingPrimaryKeyException.
Now what should i do to fix this problem. Thank you in advanced
|