tags:

views:

147

answers:

3

How to store a complete dataset into database without having to do it table by table and row by row.

+1  A: 

Have a look at the SqlDataAdapter. It can do bulk inserts/updates/deletes using its .Update() method.

That of course only works if you're using SQL Server as your database - you didn't mention what database you're targeting in your question....

See some tutorials on how to use SqlDataAdapter:

Marc

marc_s
A: 

You could serialize the dataset to Xml and store it as a string

benPearce
Or, you could store XML as XML in SQL Server 2005 or above, with no serialization overhead.
John Saunders
Puzzien gave no indication of database technology
benPearce
A: 

Your question is a little ambiguous, so assuming you want to store multiple objects in a row i would recommend you investigate storing them as serialized json.

serialize the objects before you store them and un-serialize them when you need them again.

ADAM