Question DataSet Variable Length Parameter List

VentureFree

Well-known member
Joined
Jan 9, 2008
Messages
54
Programming Experience
5-10
Is it possible to include a variable length parameter list in a DataSet?

For example, I know that I can have a query with a single parameter that takes an ID for an employee and gets the data based on that. But what if I want to get info on 10, or even 15 specific employees? Is it possible to build one query that will work for both of those cases, as well as for any other number of employees? Or will I have to just get data one employee at a time, or possibly get all of the employees in one query and use Select() afterward to narrow it down?
 
Yes, you would need to create a loop to make the parameter list from some collection, but it is definitely possible.

VB.NET:
SELECT * FROM Employees WHERE EmployeeID = @Emp1 OR EmployeeID = @Emp2 OR EmployeeID = @Emp3
 
Back
Top