![]() |
Datagrid batch update
I have created an excel like grid where the grid defaults to edit mode when
it is renderered. But I would like a way to perform a batch update since I am dealing with 10000 rows in the grid. I do not want to make a roundtrip to the database for each row that was modified. I would appreciate it if someone can help me with that. |
Re: Datagrid batch update
>I have created an excel like grid where the grid defaults to edit mode when
> it is renderered. But I would like a way to perform a batch update since I > am > dealing with 10000 rows in the grid. I do not want to make a roundtrip to > the > database for each row that was modified. I would appreciate it if someone > can > help me with that. Save to datasource to eg the Session["MyTempDataSource"] = MyDataSource; And when you rebind your datagrid in OnUpdate you use the datasoource in session. Then you can (if you are using a DataSet) send the modified rows to the database layer. If using O/R mapper maybe check the IsDirty field. Anders, Denmark |
Re: Datagrid batch update
Could you please send me some sample code for the same, more specifically how
to send the modified rows to the database ? Thanks in advance "Flare" wrote: > >I have created an excel like grid where the grid defaults to edit mode when > > it is renderered. But I would like a way to perform a batch update since I > > am > > dealing with 10000 rows in the grid. I do not want to make a roundtrip to > > the > > database for each row that was modified. I would appreciate it if someone > > can > > help me with that. > > Save to datasource to eg the Session["MyTempDataSource"] = MyDataSource; > > And when you rebind your datagrid in OnUpdate you use the datasoource in > session. Then you can (if you are using a DataSet) send the modified rows to > the database layer. If using O/R mapper maybe check the IsDirty field. > > Anders, Denmark > > > > |
Re: Datagrid batch update
Hi ,
Inorder to save round trip to servers u must go for DataAdaptor.Update() The DataAdaptor provides this facilty inorder to avoid round trips to server the dataAdaptor.Update can be used with inserts,deletes and updates all which are performed on data set and make changes to database in1 short. da.Update(datasetname,"tablename") Happy Coding. Regards, Mehta Rahul "Flare" wrote: > >I have created an excel like grid where the grid defaults to edit mode when > > it is renderered. But I would like a way to perform a batch update since I > > am > > dealing with 10000 rows in the grid. I do not want to make a roundtrip to > > the > > database for each row that was modified. I would appreciate it if someone > > can > > help me with that. > > Save to datasource to eg the Session["MyTempDataSource"] = MyDataSource; > > And when you rebind your datagrid in OnUpdate you use the datasoource in > session. Then you can (if you are using a DataSet) send the modified rows to > the database layer. If using O/R mapper maybe check the IsDirty field. > > Anders, Denmark > > > > |
| All times are GMT. The time now is 02:33 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.