Home All Groups Group Topic Archive Search About

How to use String Array as SqlParameter in VS 2005

Author
20 Oct 2006 2:53 PM
Marcus Kraus
Hi there,

I can't figure it out.
I have following SQL Statement:

Select xx from yy where yy in ( 'value1', 'value2')

That one is running fine.

Now I want to use that SQL Statement in VStudio 2005 DataDesigner...
so I would have a string array or else ( maybe Object ) for the values.

Is that possible ?

Thanx in advance
and
please excuse my bad english :-)

Author
21 Oct 2006 12:20 AM
Robbe Morris [C# MVP]
SQL Server doesn't have the concept of an Array oriented datatype
that you could pass as a single entity to sql or to a stored procedure.


--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer.  Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp





Show quote
"Marcus Kraus" <marcus.kr***@powerpeople.de> wrote in message
news:12oa5k9m2ivuf$.q9hvveaixh0h$.dlg@40tude.net...
> Hi there,
>
> I can't figure it out.
> I have following SQL Statement:
>
> Select xx from yy where yy in ( 'value1', 'value2')
>
> That one is running fine.
>
> Now I want to use that SQL Statement in VStudio 2005 DataDesigner...
> so I would have a string array or else ( maybe Object ) for the values.
>
> Is that possible ?
>
> Thanx in advance
> and
> please excuse my bad english :-)
>
>
>
Author
21 Oct 2006 3:08 PM
Marcus Kraus
Am Fri, 20 Oct 2006 20:20:21 -0400 schrieb Robbe Morris [C# MVP]:

> SQL Server doesn't have the concept of an Array oriented datatype
> that you could pass as a single entity to sql or to a stored procedure.

Hi Rob,

thank you very much for the quick helpful answer...

Marcus
Author
21 Oct 2006 3:38 PM
Mark Rae
"Marcus Kraus" <marcus.kr***@powerpeople.de> wrote in message
news:12oa5k9m2ivuf$.q9hvveaixh0h$.dlg@40tude.net...

> Is that possible ?

Google is your friend...
http://www.google.co.uk/search?sourceid=navclient&aq=t&ie=UTF-8&rls=GGLG,GGLG:2006-28,GGLG:en&q=sqlparameter+array

AddThis Social Bookmark Button