Home All Groups Group Topic Archive Search About

DataSet as argument for Sql server stored procedure

Author
19 Feb 2006 4:08 PM
henk gijsbert
Can I use a dataset as an argument for a SQL server stored procedure
that I want to call from ADO.NET?

Author
19 Feb 2006 8:34 PM
Sahil Malik [MVP C#]
Only if it is a SQLCLR procedure and you binary serialize the dataset.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________


Show quote
"henk gijsbert" <h**@paralax.nl> wrote in message
news:1140365306.233866.264370@g47g2000cwa.googlegroups.com...
> Can I use a dataset as an argument for a SQL server stored procedure
> that I want to call from ADO.NET?
>
Author
19 Feb 2006 8:39 PM
David Browne
Also you can XML-Serialize it and pass it to a non-CLR stored procedure,
where it can be shreaded and merged with TSQL.

David

Show quote
"Sahil Malik [MVP C#]" <contactmethrumyblog@nospam.com> wrote in message
news:Okx8aPZNGHA.1124@TK2MSFTNGP10.phx.gbl...
> Only if it is a SQLCLR procedure and you binary serialize the dataset.
>
> - Sahil Malik [MVP]
> ADO.NET 2.0 book -
> http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
> __________________________________________________________
>
>
> "henk gijsbert" <h**@paralax.nl> wrote in message
> news:1140365306.233866.264370@g47g2000cwa.googlegroups.com...
>> Can I use a dataset as an argument for a SQL server stored procedure
>> that I want to call from ADO.NET?
>>
>
>
Author
20 Feb 2006 2:49 AM
Sahil Malik [MVP C#]
Yes - using OPENXML

That will work though with SQLCLR around, that should be choice #2 IMO for 3
reasons
a) Performance
b) The fact that you must clean up after sp_xml_preparedocument <-- (or
something like that).
c) You have to be careful in XML serializing the dataset, with the changes
inclusive.

Anyway, yes that will also work, so thanks for adding to the list.

BTW, if you're on .NET 1.1/SQL2k, then OPENXML is about your only choice.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________


Show quote
"David Browne" <davidbaxterbrowne no potted m***@hotmail.com> wrote in
message news:u99TdSZNGHA.2696@TK2MSFTNGP14.phx.gbl...
> Also you can XML-Serialize it and pass it to a non-CLR stored procedure,
> where it can be shreaded and merged with TSQL.
>
> David
>
> "Sahil Malik [MVP C#]" <contactmethrumyblog@nospam.com> wrote in message
> news:Okx8aPZNGHA.1124@TK2MSFTNGP10.phx.gbl...
>> Only if it is a SQLCLR procedure and you binary serialize the dataset.
>>
>> - Sahil Malik [MVP]
>> ADO.NET 2.0 book -
>> http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
>> __________________________________________________________
>>
>>
>> "henk gijsbert" <h**@paralax.nl> wrote in message
>> news:1140365306.233866.264370@g47g2000cwa.googlegroups.com...
>>> Can I use a dataset as an argument for a SQL server stored procedure
>>> that I want to call from ADO.NET?
>>>
>>
>>
>
>

AddThis Social Bookmark Button