Hello Friends,
I've a GridView in which i'm inserting lots of records it may be 100 or 500. And holding those values in a DataTable and there is a Save button after clicking on that button those records of DataTable being saved in Sql Server 2005. Currently i'm taking that DataTable values in a variable and serperating them with Comma(,). And at sql side i'm serperating them with comma and saving the records in Table in Sql Server. And that's working fine. But is it any other way to save or send the whole datatable in a single turn not concating in a string variable and save them at sql server.
Loading
Amit ChoudharyPosted Feb 25, 2010, 4:13 AM
you can replace the command object that i have created in code by changing the command type property to stored procedure pass the paremeters if required and you are done.
Manoj BishtPosted Feb 23, 2010, 3:30 AM
First of all thanks to reply. But where is the stored proc which which'll receive datatable from asp.net and update the table in sql server.
Amit ChoudharyPosted Feb 22, 2010, 8:09 AM
Following code will show you how to save complete table in database in one statement:
Don't forget to mark the answer.