Home All Groups Group Topic Archive Search About

Saving a whole datatable to SQL server 2000

Author
6 Nov 2007 7:18 PM
Pipo
Hi,

I am looking for some sample (code) on how to save a complete datatable into
SQl server 2000.
I want to save the datatable (filled with datarows and values) and later on
I need to load it back again.

Does anyone know if this is possible and how?

tia,

Pipo

Author
7 Nov 2007 10:14 AM
Mansi Shah
Hi,

For this you have to create 1 table in database through coding, can be
your datasets name. If you have table then you have to map the fields to
that table. Then you can retrive it from datatbase.

Regards,
Mansi Shah.

*** Sent via Developersdex http://www.developersdex.com ***
Author
7 Nov 2007 3:00 PM
pipo
Hi Mansi,

Thank you for your reply.

I want to save the whole datatable to 1 record in de database.
The datatables I want to save and retrieve are different and not always the
same.
That is why I cant create tables for it in the database.

tia,
Pipo


Show quote
"Mansi Shah" <ma***@devdex.com> schreef in bericht
news:%23vplMcSIIHA.6068@TK2MSFTNGP05.phx.gbl...
>
> Hi,
>
> For this you have to create 1 table in database through coding, can be
> your datasets name. If you have table then you have to map the fields to
> that table. Then you can retrive it from datatbase.
>
> Regards,
> Mansi Shah.
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
7 Nov 2007 4:17 PM
Jim Rand
Serialize the datatable to xml and save the resulting string in a varchar
field. If it's more than 8K characters, you will either have to compress it
and base64encode it (86% compression) or save it as a blob.

Show quote
"pipo" <nom***@me.com> wrote in message
news:%23hbLm5UIIHA.4228@TK2MSFTNGP02.phx.gbl...
> Hi Mansi,
>
> Thank you for your reply.
>
> I want to save the whole datatable to 1 record in de database.
> The datatables I want to save and retrieve are different and not always
> the same.
> That is why I cant create tables for it in the database.
>
> tia,
> Pipo
>
>
> "Mansi Shah" <ma***@devdex.com> schreef in bericht
> news:%23vplMcSIIHA.6068@TK2MSFTNGP05.phx.gbl...
>>
>> Hi,
>>
>> For this you have to create 1 table in database through coding, can be
>> your datasets name. If you have table then you have to map the fields to
>> that table. Then you can retrive it from datatbase.
>>
>> Regards,
>> Mansi Shah.
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>
>
Author
8 Nov 2007 5:53 AM
Cor Ligthert[MVP]
Jim,

That is the same as I thought, with the difference, that I would zip the XML
string and then add it to an bytearray (image/blob) field

Cor
Author
8 Nov 2007 6:35 PM
William Vaughn
SSIS can do this. SqlBulkCopy can do this. BCP, DTS can also do this.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Show quote
"Pipo" <nom***@me.pl> wrote in message
news:36206555-EC85-4AFE-A5B2-653EBDE527FB@microsoft.com...
> Hi,
>
> I am looking for some sample (code) on how to save a complete datatable
> into SQl server 2000.
> I want to save the datatable (filled with datarows and values) and later
> on I need to load it back again.
>
> Does anyone know if this is possible and how?
>
> tia,
>
> Pipo

AddThis Social Bookmark Button