473,486 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting Original Values For Update

Hi --

I am using webmatrix so whatever I try and do is determined by what I can do
by hand. That said, I am trying to figure out how to get the original values
for a field that is being edited.

What I have is a table that had 2 fields in it. Let's say Field1 and Field2.
The key to the table is Field1, Field2 so the ddl would look like this:

create table MyTable (
Field1 varchar(10) not null
,Field2 varchar(10) not null
)

I have created a datagrid to edit it however, if someone changes either
value the update statement needs to know what both the original values were.
I have considered making my select statement get both fields twice and
setting the columns for the second set in the datagrid to not visible, but
then I can't seem to figure out how to get the hidden values when someone
presses the Update.

All in all I jus figured that it was getting too involved to be doing it
correctly, so I thought I'd just ask...

-- Bradley
Nov 17 '05 #1
2 1992
Bradley,

Check out the .HasVersion property of DataRow class
You can retreive Original, Current and Proposed values of the DataRowVersion

Stephen

"Bradley M. Small" <BS****@XNOSPAMXmjsi.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...
Hi --

I am using webmatrix so whatever I try and do is determined by what I can do by hand. That said, I am trying to figure out how to get the original values for a field that is being edited.

What I have is a table that had 2 fields in it. Let's say Field1 and Field2. The key to the table is Field1, Field2 so the ddl would look like this:

create table MyTable (
Field1 varchar(10) not null
,Field2 varchar(10) not null
)

I have created a datagrid to edit it however, if someone changes either
value the update statement needs to know what both the original values were. I have considered making my select statement get both fields twice and
setting the columns for the second set in the datagrid to not visible, but
then I can't seem to figure out how to get the hidden values when someone
presses the Update.

All in all I jus figured that it was getting too involved to be doing it
correctly, so I thought I'd just ask...

-- Bradley

Nov 17 '05 #2
Then I guess the question is how do I use and access a DataTable instead of
a DataSet in my DataGrid?

Am I even thinking along the correct lines?

-- B

"Stephen Muecke" <st*****@senet.com.au> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Bradley,

Check out the .HasVersion property of DataRow class
You can retreive Original, Current and Proposed values of the DataRowVersion
Stephen

"Bradley M. Small" <BS****@XNOSPAMXmjsi.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...
Hi --

I am using webmatrix so whatever I try and do is determined by what I can
do
by hand. That said, I am trying to figure out how to get the original

values
for a field that is being edited.

What I have is a table that had 2 fields in it. Let's say Field1 and

Field2.
The key to the table is Field1, Field2 so the ddl would look like this:

create table MyTable (
Field1 varchar(10) not null
,Field2 varchar(10) not null
)

I have created a datagrid to edit it however, if someone changes either
value the update statement needs to know what both the original values

were.
I have considered making my select statement get both fields twice and
setting the columns for the second set in the datagrid to not visible,

but then I can't seem to figure out how to get the hidden values when someone presses the Update.

All in all I jus figured that it was getting too involved to be doing it
correctly, so I thought I'd just ask...

-- Bradley


Nov 17 '05 #3

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

Similar topics

7
3656
by: Brad Quinn | last post by:
Is there a way to get the values of the paramaters to a method programatically? I know that I can use reflection to find out the parameter names and types, etc., but I want to know the values...
1
1532
by: moonriver | last post by:
It seems that a C# program can not update the original database by mapping all the changes to the dataset, but have to explicitly assign the InsertCommand or UpdateCommand properties of a...
3
1637
by: ALPO | last post by:
We have a datagrid built using template columns. Many are text boxes. These text boxes are bound to a datasource as follows: <ItemTemplate> <asp:TextBox id="txtPeriod1" runat="server"...
0
978
by: Denver Developer | last post by:
I have a cookie that is set by a previous ASP page that I wish to update with the following logic. MyCookieColl = Request.Cookies; for (loop1 = 0; loop1 < MyCookieColl.Count ; loop1++) {...
7
5463
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
3
3855
by: Michael Glass | last post by:
I'm working on an ASP.Net web app using VS2005 and the .Net 2.0 framework, and I have a serious problem with the page I'm currently working on. The page has, among other things, two FormViews and a...
6
1702
by: Brett | last post by:
Not sure what the problem is here... Trying to update from a datagrid to an access database using vb.net... Its not updating the database but Im not getting any errors... Here is my code... ...
1
1855
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
1
4892
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
7105
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,...
0
7180
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...
1
6846
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...
0
7341
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...
0
5439
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,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1381
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 ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
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...

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.