Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Datagrid updation

Reply
Thread Tools

Datagrid updation

 
 
AA
Guest
Posts: n/a
 
      04-19-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
updation of mcse2000 to 2003 lavish MCSE 9 10-29-2004 05:17 PM
Hidden mechanism in "Disconnected Data Updation" =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?= ASP .Net 0 04-29-2004 09:51 AM
Datagrid updation AA ASP .Net 1 04-19-2004 01:26 PM
Dataset Updation Vinod I ASP .Net 2 12-29-2003 07:14 AM
registration details updation Srinivasa Reddy K Ganji ASP .Net 1 07-25-2003 10:49 AM



Advertisments