Datagrid batch update

A

Applevalley01

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.
 
F

Flare

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
 
A

Applevalley01

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 said:
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
 
R

Rahul A Mehta

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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top