How does update work

Discussion in 'ASP .Net Datagrid Control' started by PhilM, Aug 15, 2005.

  1. PhilM

    PhilM Guest

    I bind a Datagrid to a recordset obtained from a stored proc in SQL server.
    DataGrid displays the recordset.
    User updates some data on the grip, pushes update button.
    Event code calls Datagrid1.Update ... but what should that do? I suppose it
    executes the code stored in the Update command of the Dataset it is bound
    to, but should I write a stored proc to update the database, and if I do how
    does the data get to the stored proc?
     
    PhilM, Aug 15, 2005
    #1
    1. Advertising

  2. PhilM

    Brock Allen Guest

    You need to fetch the row in the datagrid, find every cell, dig into the
    cell, find the server control and fetch the value. Once you have all of the
    values for all if your columns, then you use that data to do your update
    in the DB. It's a PITA. As an aside, 2.0 makes thie much easier with 2-way
    databinding.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I bind a Datagrid to a recordset obtained from a stored proc in SQL
    > server.
    > DataGrid displays the recordset.
    > User updates some data on the grip, pushes update button.
    > Event code calls Datagrid1.Update ... but what should that do? I
    > suppose it
    > executes the code stored in the Update command of the Dataset it is
    > bound
    > to, but should I write a stored proc to update the database, and if I
    > do how
    > does the data get to the stored proc?
     
    Brock Allen, Aug 16, 2005
    #2
    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. TB
    Replies:
    2
    Views:
    3,763
  2. David C
    Replies:
    0
    Views:
    646
    David C
    Oct 27, 2007
  3. Rain
    Replies:
    2
    Views:
    759
  4. Joe

    Gridview update does not work

    Joe, Nov 3, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    730
  5. Gridview update does not work

    , Nov 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    151
Loading...

Share This Page