Monday, March 26, 2012

Passing Integer list to SQL using TableAdapter?

I want to select rows that have an integer value IN a parameter list value

I want to pass an integer list to my tableadapter's select

as in Select * from sometable

Where myIntValue IN (@.intParamList )

I cannot figure out how to get my list into @.intParamList

It works fine as a single value - eg 3, but how do I set it to 1,2,3 ?

Thanks

Bill

Hi,

I don't think you can't pass 1,2,3 as integer parameter according to my knowledge. Well you might have to change the parameter to varchar and it will work for you.

Thanks and best regards,

|||

Thanks I got it.

The answer is to use a varchar list AND a Numbers table which allows me to Select the values without using IN

Googling SQL Numbers table gives several examples

Bill

No comments:

Post a Comment