Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Dim dtUsers As New System.Data.DataTable
                   Dim dsUserID As New System.Data.DataSet
                   Dim cbPRRep As New comobox()
                   For Each druser As DataRow In dtUsers.Rows
                       dsUserID = Security.GetUserDataById(druser("UserID"))
                       For Each rw As DataRow In dsUserID.Tables(0).Rows
                           Me.cbPRRep.AddEmptyItem(rw("UserId"))
                           Exit For
                       Next
                   Next
                   Me.cbPRRep.SelectedIndex = -1

how to remove the foreach loops using the linq query
Posted
Comments
Maciej Los 28-Dec-13 7:09am    
Please, be more specific and shortly describe your issue. What are you trying to achieve?

1 solution

You did not specify enough information, so we can't help you in details.

General advice is to read below listed articles:
Queries in LINQ to DataSet[^]
Creating a DataTable From a Query (LINQ to DataSet)[^]
LINQ to DataSet Examples[^]
LINQ to SQL Samples[^]
101 Visual Basic LINQ Samples[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900