|
-
Dec 22nd, 2006, 04:47 PM
#1
Thread Starter
Junior Member
[2005] Retrieving info from DataSet
I'm a real newbie to 2005. I just completed my into to vb.net. I have a problem compairing a txtBox to a field in a MS Access table.
I have used the wizzard to connect to a SemProj.mdb and to the table tblInstructor. tblInstructor has three Columns. ID, InstrName, UserID.
I have created cboUsrName and combined ID with InstrName, but returns only the ID in txtUserIDtoCheck
Created a txtBox, txtUsrIDtoCheck
I created txtUsrID & txtUsrPswd.
Now I want to compair the info given by the user is txtUserID & txtPswd against the data in my Access table.
I know how to use the tableadapter to fill the database and how to use a datagridview on a form.
How do you get the info back from the dataset??
-
Dec 22nd, 2006, 09:06 PM
#2
Re: [2005] Retrieving info from DataSet
Your DataSet has a property for each DataTable it contains. You use a TableAdapter to populate the corresponding DataTable. That DataTable now contains DataRows, which you can access by index. Those DataRows have a property for each column in the table. So, let's say that you want to get the value of the InstrName field from the second row of the tblInstructor table:
VB Code:
Dim instrName As String = myDataSet.tblInstructor(1).InstrName
Note that all arrays and collections are zero-based, so index 1 is the second item.
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
|