473,327 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Detecting Changes to a dataform question

Hi, I have an asp.net 1.1 application that populates data from a
database. When the user changes data, they have to hit a button to
update the data. The data entry form (same form that is populated) is
from several different tables. To the user, of course, this is not
seen.

Scenario: After the page is populated, assume a change is made to the
form and the user hits update. The page then goes back, reads the
database for that record and then compares the results to what the user
typed in. If it is the same, it goes to the next set of controls to
check. If it is diffent, it does an update mytable set to the
database.

Example: An address:

The populate form has 123 Main St. MyTown, CA. 999999

The user changes this to 124 Main St. Dallas, Tx. 4444477

The user hits update. The database reads the database. It gathers
values. It compares the values to what the user submitted just now and
if there are changes, it updates that row. If not it leaves it.

My question is is this the wrong way to do it? It "feels" wrong.
Thanks.

Nov 19 '05 #1
5 1799

Hi,
Why all this, just update the all tables with the new data whether it's
the same or it's new. Is there any business need for what you are doing?

Best regards,
Mohamed Sharaf
MEA Developer Support Center
ITWorx on behalf Microsoft EMEA GTSC
--------------------
| From: ne***********@gmail.com
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Detecting Changes to a dataform question
| Date: 26 Sep 2005 07:55:47 -0700
| Organization: http://groups.google.com
| Lines: 26
| Message-ID: <11*********************@g49g2000cwa.googlegroups. com>
| NNTP-Posting-Host: 216.235.146.236
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1127746552 23076 127.0.0.1 (26 Sep 2005
14:55:52 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Mon, 26 Sep 2005 14:55:52 +0000 (UTC)
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: gr**********@google.com
| Injection-Info: g49g2000cwa.googlegroups.com;
posting-host=216.235.146.236;
| posting-account=4x5ohgsAAACg5EznArV1kEPHmTNHqHa7
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!nntp.giganews. com!postnews.google.com!g4
9g2000cwa.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:127056
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi, I have an asp.net 1.1 application that populates data from a
| database. When the user changes data, they have to hit a button to
| update the data. The data entry form (same form that is populated) is
| from several different tables. To the user, of course, this is not
| seen.
|
| Scenario: After the page is populated, assume a change is made to the
| form and the user hits update. The page then goes back, reads the
| database for that record and then compares the results to what the user
| typed in. If it is the same, it goes to the next set of controls to
| check. If it is diffent, it does an update mytable set to the
| database.
|
| Example: An address:
|
| The populate form has 123 Main St. MyTown, CA. 999999
|
| The user changes this to 124 Main St. Dallas, Tx. 4444477
|
| The user hits update. The database reads the database. It gathers
| values. It compares the values to what the user submitted just now and
| if there are changes, it updates that row. If not it leaves it.
|
| My question is is this the wrong way to do it? It "feels" wrong.
| Thanks.
|
|

Nov 19 '05 #2
normally you keep the old values, and check that they still match (someone
else hasn't changed the record). this means it better to detect user changes
independant of the database. datasets are common for this.

-- bruce (sqlwork.com)


<ne***********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Hi, I have an asp.net 1.1 application that populates data from a
database. When the user changes data, they have to hit a button to
update the data. The data entry form (same form that is populated) is
from several different tables. To the user, of course, this is not
seen.

Scenario: After the page is populated, assume a change is made to the
form and the user hits update. The page then goes back, reads the
database for that record and then compares the results to what the user
typed in. If it is the same, it goes to the next set of controls to
check. If it is diffent, it does an update mytable set to the
database.

Example: An address:

The populate form has 123 Main St. MyTown, CA. 999999

The user changes this to 124 Main St. Dallas, Tx. 4444477

The user hits update. The database reads the database. It gathers
values. It compares the values to what the user submitted just now and
if there are changes, it updates that row. If not it leaves it.

My question is is this the wrong way to do it? It "feels" wrong.
Thanks.

Nov 19 '05 #3
Yes, becaause I keep a history of the previous information.

So, say they update an address. If the user changes the address, I
keep a row of the old one and insert a new one. I made mistake above
when I said update set. That actually referred to my table that held
the most current id of the address, so I know the most recent.

This is why I have to know if it changes. If it does I insert a new
row, if it does not, then I leave it alone.

Nov 19 '05 #4
I'm sorry to be dense on this, but do you have an example link where I
would be able to see this in action? I'm still thinking classic asp I
think and need guidance. Thank you.

Nov 19 '05 #5

Hi,
I think the best solution for the performance is to change the update
Stored Procedure or TSQL text to do this task on the database side. No
matter you are using a data adapter or data reader, at the end of the day
you will call a stored procedure to update the data. In this stored do the
comparison and do whatever the backup you want.

HTH
Mohamed Sharaf
MEA Developer Support Center
ITWorx on behalf Microsoft EMEA GTSC
--------------------
| From: ne***********@gmail.com
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: Detecting Changes to a dataform question
| Date: 26 Sep 2005 15:01:31 -0700
| Organization: http://groups.google.com
| Lines: 4
| Message-ID: <11*********************@z14g2000cwz.googlegroups. com>
| References: <11*********************@g49g2000cwa.googlegroups. com>
| <uT**************@TK2MSFTNGP11.phx.gbl>
| NNTP-Posting-Host: 216.235.146.236
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1127772098 26392 127.0.0.1 (26 Sep 2005
22:01:38 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Mon, 26 Sep 2005 22:01:38 +0000 (UTC)
| In-Reply-To: <uT**************@TK2MSFTNGP11.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: gr**********@google.com
| Injection-Info: z14g2000cwz.googlegroups.com;
posting-host=216.235.146.236;
| posting-account=4x5ohgsAAACg5EznArV1kEPHmTNHqHa7
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!nntp.giganews. com!postnews.google.com!z1
4g2000cwz.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:127243
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm sorry to be dense on this, but do you have an example link where I
| would be able to see this in action? I'm still thinking classic asp I
| think and need guidance. Thank you.
|
|

Nov 19 '05 #6

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

Similar topics

4
by: HomeyDaClown | last post by:
I'm new to the VB.net world and have been reading alot of books and threw newsgroups Is it even posable to save user input from a form to a data grid. I could just edit the data gri but would...
2
by: Chris Dunaway | last post by:
I'm writing an app that processes orders for various customers. For most customers, the processing is the same. However, a few customers require custom processing in addition to the standard...
1
by: Peter | last post by:
Hello, Thanks for reviewing my question. I am getting the following error when trying to create a form using the DataForm Wizard: "The following error occurred: Value cannot be null. ...
2
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones...
1
by: msmcg | last post by:
I built a dataform using the VB.net wizard. I have two tables, with one relation, Parent to Child, linked on one common key. The dataform loads the data fine, and when I click on the Add button,...
4
by: Nitromuse | last post by:
After showing a DataForm how do you pause the code from continuing to run until the user clicks a button after all the data has been entered ? Thank you for your help!!
7
by: jab3 | last post by:
Hello. I'm wondering if someone can answer something I'm sure has been answered a thousand times before. I am apparently just too dumb to find the answer. :) I've found information about the...
4
by: Ralph | last post by:
I am trying out the dataform wizard in visual studio using a sql server 2003 database. It seems to want to create ole db adapters and connections and commands. How do I make it use sql commands...
0
by: Meenu4vs | last post by:
Hi i'm using Visual Studio 2005 professional edition. I'm currently doing a customer maintanence project in C#.I need to use DataForm Wizard.I cannot find any DataForm Wizard From the Template.Tried...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.