473,770 Members | 6,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating data on the same web form via 2 pc's

if 2 people are working on the same web site is it possible to be able
to work on it Simultaneously so that if i for example was to change
something it would change on the other persons screen after a refresh

Jan 16 '07 #1
7 1182
<cm******@hotma il.comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
if 2 people are working on the same web site is it possible to be able
to work on it Simultaneously so that if i for example was to change
something it would change on the other persons screen after a refresh
Absolutely, assuming both users are working with the same data, and the data
is not user-specific...
Jan 16 '07 #2
for example, if you have a gridview on the page, and both users have the
gridview on screen with the same 20 records. they each edit a different row
and hit update or whatever. when the page reloads, they will see the
changes made by the other person. if they changed the same row, it will be
a case of "last one wins" unless you do some conflict checking in your
database code / layer.

tim

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
<cm******@hotma il.comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
>if 2 people are working on the same web site is it possible to be able
to work on it Simultaneously so that if i for example was to change
something it would change on the other persons screen after a refresh

Absolutely, assuming both users are working with the same data, and the
data is not user-specific...
Jan 16 '07 #3
"Tim Mackey" <ti********@com munity.nospamwr ote in message
news:FE******** *************** ***********@mic rosoft.com...
for example, if you have a gridview on the page, and both users have the
gridview on screen with the same 20 records. they each edit a different
row and hit update or whatever. when the page reloads, they will see the
changes made by the other person. if they changed the same row, it will
be a case of "last one wins"
Yes indeed.
unless you do some conflict checking in your database code / layer.
Doesn't everyone...?
Jan 16 '07 #4
>unless you do some conflict checking in your database code / layer.
>
Doesn't everyone...?
i guess not, me at least! i never saw the point of the following delete
query (generated by VS / ado.net with optimistic concurrency)

delete from table where PK = 5 and
CompareEveryOth erColumnValueTo SeeIfItChanged
i much prefer: delete from table where PK = 5

if a user wants to delete a record, it doesn't matter (to me at least)
whether the data changed or not, it is still destined for the trash, as
decided by the user. there is obviously very good reason for conflict
checking with update statements, but even then, one assumes that the user
would not want to proceed with the udpate if they knew that other values in
the record had changed. this wouldn't always be true. the user might prefer
that their statement get executed, rather than be told that someone else
beat them to it and have their statement rejected. in most of the apps i
develop, it doesn't matter if an edit is done and then silently overwritten
by a subsequent edit of the same record, typically because the data would be
overwritten anyway (with or without a conflict), in any case, there is no
effective loss of data. certainly there are situations where this is bad,
but i don't encounter them very often.

tim

Jan 16 '07 #5
"Tim Mackey" <ti********@com munity.nospamwr ote in message
news:0A******** *************** ***********@mic rosoft.com...
decided by the user. there is obviously very good reason for conflict
checking with update statements, but even then, one assumes that the user
would not want to proceed with the udpate if they knew that other values
in the record had changed.
Ah yes, but what if they *didn't* know...?

Scenario:

User A opens Record 1

User B opens Record 1, having no clue that User A also has Record 1 open

User A changes 99 of the 100 fields in Record 1 and clicks the Save button

User A logs out

User B changes the other field in Record 1 and clicks the Save button,
thereby overwriting all of User A's changes

User B logs out

Neither User A nor User B has the slightest notion of what has just
happened, until / unless User A opens Record 1 again and wonders where all
the changes went...
Jan 17 '07 #6

If you're using SqlServer, you can use a DATATYPE called "timestamp" .

A timestamp is a value that increments each time a record is updated. You
don't have to manually do this, it just happens.
Create Table dbo.Employee (EmpID int , RowVers timestamp , LastName
varchar(24 ) )

INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 101, 'Jones' )
INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 102, 'Smith' )
INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 103, 'Gates' )

Select * from dbo.Employee

Select EmpID , convert ( int , RowVers ) as RowVersAsInt , LastName from
dbo.Employee

Converting to an int the easiest way to deal with this.

When you load an Employee (for possible edit) ...... you also persist (on
the webpage , or as custom business entity), the RowVersInt value.

Then when you update the Employee, you check to see if the RowVersInt has
changed.
@EmpID int
@LastName varchar(24)
@RowVersInt int

if exists (Select * from dbo.Employee e where e.EmpID = @EmpID and
convert(int , e.RowVers) <@RowVersInt )
begin
err.raise 'Ahhhhhhhh, somebody already updated this employee',
............... ..........
end
something like that.

<cm******@hotma il.comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
if 2 people are working on the same web site is it possible to be able
to work on it Simultaneously so that if i for example was to change
something it would change on the other persons screen after a refresh

Jan 17 '07 #7
very nice. i like that approach.
thanks for posting

"sloan" <sl***@ipass.ne twrote in message
news:eg******** ******@TK2MSFTN GP03.phx.gbl...
>
If you're using SqlServer, you can use a DATATYPE called "timestamp" .

A timestamp is a value that increments each time a record is updated. You
don't have to manually do this, it just happens.
Create Table dbo.Employee (EmpID int , RowVers timestamp , LastName
varchar(24 ) )

INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 101, 'Jones' )
INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 102, 'Smith' )
INSERT INTO dbo.Employee ( EmpID , LastName ) values ( 103, 'Gates' )

Select * from dbo.Employee

Select EmpID , convert ( int , RowVers ) as RowVersAsInt , LastName from
dbo.Employee

Converting to an int the easiest way to deal with this.

When you load an Employee (for possible edit) ...... you also persist (on
the webpage , or as custom business entity), the RowVersInt value.

Then when you update the Employee, you check to see if the RowVersInt has
changed.
@EmpID int
@LastName varchar(24)
@RowVersInt int

if exists (Select * from dbo.Employee e where e.EmpID = @EmpID and
convert(int , e.RowVers) <@RowVersInt )
begin
err.raise 'Ahhhhhhhh, somebody already updated this employee',
............... .........
end
something like that.

<cm******@hotma il.comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
>if 2 people are working on the same web site is it possible to be able
to work on it Simultaneously so that if i for example was to change
something it would change on the other persons screen after a refresh

Jan 18 '07 #8

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

Similar topics

11
16226
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
1
1419
by: James | last post by:
Hi, I am currently creating a database which will be stored on a network. Somebody will take this database out on a laptop will they will input new data via a form. Somehow this new version will have to be transferred back to the old one. I'm not sure if it would be necessary to take the whole database out on the laptop as I've heard there could be problems synchronising the updated verion with the existing one.
2
1845
by: RC | last post by:
I am updating/improving a working database for a non-profit organization. I am thinking of making a copy of the database at the office, bringing the copy to my house, making the changes and then copying the new/improved database back to the hard drive of the PC at the office. While I am working on the copy of the database at home, the database has data being entered into it at the office. My question is: how can I copy the new database...
1
3206
by: Richard Coutts | last post by:
I have a Continuous Form where each record has a button that activates another form that simplifies entering values into the record. The activated form has the equivalent of a "Done" button. I'd like to write an OnClick event that populates the contents of the current record of the parent form with the values entered in the popup form. So, the activated form needs to set the values of the current record of the parent form. How do you...
2
1622
by: phil03 | last post by:
Hi, I'm looking for some thoughts/guidance about the following scenario. A bit background first.... I have an Access database (BE) which has numerous linked tables connected to our company Oracle database. Each morning a scheduled task opens the database, and the FormOpen event of a startup form imports the data from the Oracle linked tables
2
1099
by: sara | last post by:
I am not very experienced myself with Access (using A2K) and find myself writing applications for users who have never used a PC. All the samples I've seen use the built-in features of Access - subforms where you add a record via the navigation buttons on the form, etc. I am worried about my users (don't have a PC at home, don't have email, don't know anything about windows or computers) being able to manage their business without...
4
2024
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a datagrid isn't going to work). On this page, people can update a variet of records. On submit, I want to then go in and update all of the records. Normally, I'd make each form element include a runat: server and then declare it in my codebhind so I...
10
5682
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1) DsStudentCourse1.AcceptChanges() i'm also wondering because w/ out AcceptChanges the data is still save into the database and it is now faster.
5
1365
by: fong.yang | last post by:
I have a database that is being shared on the network. The database it split up into front end and back end. The back end is residing on the shared network drive while the front end is on each local pc and just linked to the back end. All that's contained in the front end are forms with combo boxes and text boxes that is used for data entry. Is there a way to code or create a macro to update all the front ends on each local computer when...
4
1992
by: rdemyan via AccessMonster.com | last post by:
My application is calculation intensive and the servers are agonizingly slow. Administrators of my application only update the backends once a month (twice a month max). So, my launching program allows the back-end file to be downloaded to the user's PC. This will provide maximum speed for these calculations/manipulations of data. Without this, just logging into the main app connected to the server back-end file can take five minutes...
0
9592
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
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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
8887
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...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
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();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3972
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
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.