|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
newbie question.Hello,
I have backed up a table from a database in an DataTable (dt ) object. The table has been wiped up (in sql server) after the backup but i still have the copy in memory (in my DataTable object ). now i need to restore the table from memory. Is there a quick way of doing this apart from a row by row insert? I'm not using typed dataset. Many thanks in advance JB There are quite a few ways of handling this, depending on how you want to
tackle it. Row by row is an option. Another option is transforming the XML from the DataSet into a diffgram or updategram and sending to the database. You can also send the XML into a stored procedure (as a string) and use OPENXML. It is possible to set up a DataAdapter and send the info back via UPDATE. It will still loop through data, although you will simply call Update() on the dataAdapter. --- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA *************************** Think Outside the Box! *************************** Show quoteHide quote "Jensen Bredal" wrote: > > Hello, > I have backed up a table from a database in an DataTable (dt ) object. > > > The table has been wiped up (in sql server) after the backup but i still > have the copy in memory (in my DataTable object ). > now i need to restore the table from memory. > > Is there a quick way of doing this apart from a row by row insert? > > I'm not using typed dataset. > > Many thanks in advance > > JB > > > > > option. Another option is transforming the XML
> from the DataSet into a diffgram or updategram and sending to the Many thanks, could you provide some code for the any of the options.?database. > You can also send the XML into a stored procedure (as a string) and use I'm a few hours away from my deadline and i'm getting more and more stressed ;). I have written a stored procedure that does the insert job ..
Other interesting topics
Removing rows from a DataTable is VERY slow
Specifying format of DateTime columns read from CSV files DataSet Memory Usage SQLDataReader XML Dataset data adapter update using datatable that has MANY changes Aborting a thread corrupts my SqlConnection (?) how to find out my ADO.NET version how to move record forward or backward ExecuteScalar intermittently returns "0" |
|||||||||||||||||||||||