Datagrid batch update

Discussion in 'ASP .Net Datagrid Control' started by Applevalley01, Sep 26, 2004.

  1. 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.
    Applevalley01, Sep 26, 2004
    #1
    1. Advertising

  2. Applevalley01

    Flare Guest

    >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
    Flare, Sep 26, 2004
    #2
    1. Advertising

  3. 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
    >
    >
    >
    >
    Applevalley01, Sep 27, 2004
    #3
  4. 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
    >
    >
    >
    >
    Rahul A Mehta, Dec 28, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward
    Replies:
    1
    Views:
    314
    =?Utf-8?B?UmF2aW5kcmE=?=
    Jun 10, 2004
  2. ML
    Replies:
    1
    Views:
    845
  3. andy6
    Replies:
    2
    Views:
    541
    andy6 via DotNetMonster.com
    Jun 15, 2006
  4. Replies:
    2
    Views:
    3,814
    Jared
    Jun 23, 2006
  5. rockdale

    Batch update in gridview?

    rockdale, Sep 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,959
    rockdale
    Sep 12, 2006
Loading...

Share This Page