473,791 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid updation

AA
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_EditC ommand

Code is:

DataGrid1.editi temindex=e.item .itemindex

DataGrid1.DataB ind()

Event is :

DataGrid1_Updat eCommand

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 SqlCommandBuild er(SqlDataAdapt er1)

SqlDataAdapter1 .update(DataSet 1.Tables(0))

DataGrid1.EditI temIndex=-1

DataGrid1.DataB ind()

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
Nov 18 '05 #1
1 1412
Hi

It looks like that you bind the grid before updating
Do you do a databind in page_load event

Bin Song, MC

----- AA wrote: ----

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

writing the following code for EditCommand and UpdateComman

Event is

DataGrid1_EditC omman

Code is

DataGrid1.editi temindex=e.item .iteminde

DataGrid1.DataB ind(

Event is

DataGrid1_Updat eComman

Code is

Dim s as strin

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

Response.Write( s

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

Dim cmp as new SqlCommandBuild er(SqlDataAdapt er1

SqlDataAdapter1 .update(DataSet 1.Tables(0)

DataGrid1.EditI temIndex=-

DataGrid1.DataB ind(

This code does not show any error

But there is problem

when we modify any value of a record the

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 update

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

data in databas

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

updation command. How to access modified value of DataGri

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1108
by: vijaya | last post by:
How can I update multiple columns of my datagrid at a time in my application?
1
1190
by: AA | last post by:
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
0
1078
by: Lakshmi Narayanan.R | last post by:
Hi Experts I am new to .NET. I need great explanation for "the updation in the disconnected data". How it is handled. That is, if mutiple user is interacting with the data, one will delete another will insert or update. So after the modifications how the correct updation is made in the database table. What the hidden mechanism is there. The updation logic is confusing Pls help me, if any articles available let me know them Thanks in...
1
2028
by: ashfaq Gul via DotNetMonster.com | last post by:
Please help me.... i want to update record in datagrid without postback ....and the main thing that the confirmation of record updation should be from server not client ...because overwritting problem may occur if more than one user are updating the same record.... Please help.. -- Message posted via http://www.dotnetmonster.com
0
934
by: Hardik Shah | last post by:
Hi, I have a datagrid with few fields, some of them are to be updated automatically, i.e. Sould be replaced time of the entry in entry_time field and Name of the user in usr_name field. When my user enter data for perticular row, these fields also automatically updated each time. What should I do for it .. Any hints please.
0
1297
by: prashant | last post by:
Hi, I am trying to set up Transactional replication with immediate updation. The configuration is as follows: 1. Publisher is SQL server 2000 Enterprise Edition, and Distributor is on the same server. 2. Publisher SQL server is installed on Windows 2003.
0
810
by: dwadish | last post by:
guys i am new to asp.net 2003 with vb. so i have a problem with updation and deletion of records from datagrid. but i can do the edit function from here. i well tried for getting it. provide a code or a solution 4 it. how i can do the delete and update. Thanx in Advance
0
790
by: prathimaCHOWDARY | last post by:
can any one tell me to write the script for updation in datagrid ie iwant instant updation i.e at runtime
1
1685
by: siri11 | last post by:
Hi everyone!!!!!!!!! If i update a record in a table in sqlserver from front end (c#.net),using a stored procedure for updating then after updation if i open the table then it is showing the same record 2 times i.e before updation record and after updation record..Plzzzzzzzz help me how to solve this problem....its very urgent...Plzzzzzzzzzz Thanks in advance siri
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.