Datagrid updation

Discussion in 'ASP .Net Web Controls' started by AA, Apr 19, 2004.

  1. AA

    AA Guest

    We want to edit, update data of DataGrid in Asp.Net with VB.Net.and are

    writing the following code for EditCommand and UpdateCommand



    Event is :

    DataGrid1_EditCommand

    Code is:

    DataGrid1.edititemindex=e.item.itemindex

    DataGrid1.DataBind()

    Event is :

    DataGrid1_UpdateCommand

    Code is:

    Dim s as string

    s=ctype(e.item.cells[2].Controls[0],textbox).text

    Response.Write(s)

    DataSet1.Tables(0).Rows(e.item.itemindex)(1)=s

    Dim cmp as new SqlCommandBuilder(SqlDataAdapter1)

    SqlDataAdapter1.update(DataSet1.Tables(0))

    DataGrid1.EditItemIndex=-1

    DataGrid1.DataBind()



    This code does not show any error.

    But there is problem,

    when we modify any value of a record then

    command [ s=ctype(e.item.cells[2].Controls[0],textbox).text ]

    returns previous value.

    If we write a fixed value in code to change it in datagrid then it updates

    DataSet1.Tables(0).Rows(e.item.itemindex)(1)=HdDH This command updates

    data in database

    Therefore, problem is in retrieving current value from datagrid not in

    updation command. How to access modified value of DataGrid
    AA, Apr 19, 2004
    #1
    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. Srinivasa Reddy K Ganji

    registration details updation

    Srinivasa Reddy K Ganji, Jul 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    409
    Ravikanth[MVP]
    Jul 25, 2003
  2. Vinod I

    Dataset Updation

    Vinod I, Dec 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,545
    Vinod I
    Dec 29, 2003
  3. AA

    Datagrid updation

    AA, Apr 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,274
    =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    Apr 19, 2004
  4. =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=

    Hidden mechanism in "Disconnected Data Updation"

    =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=, Apr 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    297
    =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=
    Apr 29, 2004
  5. =?Utf-8?B?UmFqa3VtYXI=?=

    updation lower version application to 1.1

    =?Utf-8?B?UmFqa3VtYXI=?=, Aug 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    296
    Cowboy \(Gregory A. Beamer\) [MVP]
    Aug 24, 2004
Loading...

Share This Page