views:

80

answers:

2

Hi , I have a dataset with some 30 records in it. I want to update it to the database tables. which is the best method to update the table. I am unable to use dataadapter.update() since i am using a procedure to populate the dataset. is there any efficient way to update other than iterating through EACH record and updating it

Please help.

Thanks.

+1  A: 

Did you think of calling a stored-procedure...and passing your records as XML type input parameter?

Shankar Ramachandran
yes i thought to do that but is there any other way to do ? If there is no other option i would do that only.Can you please give me some sample to do that .
Jebli
+1  A: 

Check this article for how to work with xml datatype introduced in SQL Server 2005. Within an SP you can use UPDATE FROM statement. The source for the update will be a select from xml-parameter you pass into the SP. You can do the same in SQL Server 2000 but that requires a few more lines of code.

UserControl