Last post Apr 04, 2011 09:31 PM by mbanavige
Apr 04, 2011 06:31 PM|blackbr|LINK
I'm trying to plug in a list of values for a field (using thetableadapter query configuartion wizard) , but the following doesn't work...
where (OrgID in(@OrgList))
[OrgID is smallint, and @OrgList is string]
I want the ultimate select command to be
When I set the parameter to 1,2,3 the wizard/execute complains that @OrgList is not smallint???
If I change to cast(OrgID,vchar(10) in(@OrgList))
it compiles, but yields 0 records, unless I enter just one of the values (e.g.
1) as the parameter
so... is there any way to parameterize an in() statement like this using the the wizard?? or should I just build the where clause myself, and add it on to the select statement?
Thanks in advance...
Apr 04, 2011 09:31 PM|mbanavige|LINK
give this a read: http://www.mikesdotnetting.com/Article/116/Parameterized-IN-clauses-with-ADO.NET-and-LINQ