Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

How to use the 'IN' command in a TableAdapter query

$
0
0

Hello,

I am developing using Visual Basic 2008 and SQL Server 2008 R2.  I am trying to write a TableAdapter query that uses an 'IN' command in the Where filter:

SELECT FIRSTNAME,LASTNAME,ADDRESS FROM ADDRESS_TABLE WHERE (LASTNAME IN (@MyMULTIPLELASTNAMES))

If I pass in 1 LASTNAME the TableAdapter query works fine.  If I pass in more than 1 LASTNAME the query doesn't return any values.  

This is very odd behavior, the query works fine in when I run it in SQL Server.  Is there some syntax that I am missing or is the IN command unusable?


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>