Re: TableAdapter specifing 'IN' in the where clause for list of id
- From: twahl <twahl@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Sep 2006 08:39:01 -0700
Thanks for the input. Just to clarify when you say ad-hoc query is this in
reference to the TableAdapter class or the command object or some other
class? Is there a way to specify an ad-hoc query using the TableAdapter?
Thanks,
Terry
"Muhammad Mosa" wrote:
I think in all cases you'll use AD-HOC query..
becasue parameter cannot hold multi values. Also the @Ids should contain
value like this (1,2,3,4,5,6) and this is not an integer it is comma
separated string.
and the only type that can hold this value is string types.
So as conclusion, you'll stuck with ad-hoc query.
I'm also looking forward to see someother solution that is more straigh
forward. so if you find it please post it.
Regards,
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"twahl" wrote:
Hi,
Muhammad replied that I could use a stored procedure to accomplish this task
(Thanks Muhammad). But I'm struggling to find the answer of if I can specify
an 'IN' without using a stored procedure. Can you be more specific as to
where I can find the answer (archive title, blog title).
Thanks again for your help!
Terry
"William (Bill) Vaughn" wrote:
See the archives (and my blog) for (several) answers to this common
question.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"twahl" <twahl@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B11DCF18-38AF-4806-9013-D3F95C6B4AFC@xxxxxxxxxxxxxxxx
Hi, I have a table that contains an interger primary key. I want to query
the table for rows that have values equal to a list of ID's that I
specify.
The sql that I would use would be something like the following:
SELECT FunctionalGroupId, ReportId
FROM FunctionalGroupReportXRef
WHERE (FunctionalGroupId IN (@Ids))
When I specify this query in the TableAdapter wizard the wizard typecasts
@id to an interger. Thus I can only specify one id in my query rather
then a
list of values. I would have expected @Ids to be a string thus allowing
me
to specify a list of id's. How can I get around this issue?
Any help would be appreciated.
Thanks!!!
- References:
- Re: TableAdapter specifing 'IN' in the where clause for list of id's
- From: William \(Bill\) Vaughn
- Re: TableAdapter specifing 'IN' in the where clause for list of id
- From: Muhammad Mosa
- Re: TableAdapter specifing 'IN' in the where clause for list of id's
- Prev by Date: Re: how useful DbCommon namespace?
- Next by Date: MS ACCESS and ADO.NET 2.0
- Previous by thread: Re: TableAdapter specifing 'IN' in the where clause for list of id
- Next by thread: Re: TableAdapter specifing 'IN' in the where clause for list of id
- Index(es):