Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic dataset question

Status
Not open for further replies.

stucker79

Technical User
Dec 7, 2004
25
US
I feel crazy asking this, but I'm not exactly clear on how to run a "query" against a dataset. In other words, I have loaded a whole group table into a dataset and need to query for a specific groupid. I have queried the active directory for a list of groups that a specific user is in. I need to check for certain group memberships and then if it exists, i need to insert a row with studentid and groupid into a StudentGroup table. The first part is like this:

Dim Groups() As String = Session("strGroups").ToString.Split("|")
Dim i As Integer
Dim intGrpResult As Integer

For i = 0 To UBound(Groups)
If Groups(i) = "Attorneys" Or "International Paralegals" Or "Litigation Paralegals" Or "Litigation Secretaries" Or "Prosecution Paralegals" Or "Prosecution Secretaries" Then


So in otherwords if groups(i) = "Attorneys" then I need to query my dataset's groups datatable for the id field for Attorneys.
 
sure this is possible

Dim tbl as DataTable = myDataset.Tables("tablename")

or

Dim tbl as DataTable = myDataset.Tables(tableindex)

Dim selectedrows as DataRow()
dim groupid

groupid = ' code to get id to request

tbl.Select( "groupid like %groupid%" )


You can also include code in the select statement to order or group found items

This returns an array of data rows.

Debugging is the process of removing bugs. Programming is the process of putting them in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top