473,407 Members | 2,359 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,407 software developers and data experts.

Which should be the Best Way to Update Records

hi,

I have a following situations, in which I want to know about how ADO.NET
is supporting.
SITUATION 1
-----------
I m saving a customer record on click of Save button.

to save the customer record :

a) I save data in multiple tables.
Save Table1 and get the Primary key ID
b) Save the Table2 and insert the PrimaryKeyID as Foreign key into
Table2.
and get the Table2 Primary Key ID.
c) Save the Table3 and insert the PrimaryKeyID as Foreign key into
Table2.
and get the Table3 Primary Key ID.
d) Save data to the final Table and Put the Table2ID, Table3ID into it.

previously in visual basic 6 i used to do it with Begin/Commit trans of
connection.

Here the scenario is different, I need to call all four function of
Webservice from the Client Side.

I need some idea about how can i control the situation.

because the drawbacks of the way i m doing it are:

If the first and second functions run well and returns the RecordID (PK)
, but the third function
fails, then in that case (I could do rollbacktrans), what should i do.

SITUATION 2
-----------

the second thing is in all four functions i m not using stored
procedures, because they are
difficult to maintain, as there are lots of fields in the tables.

I m using a function
getMaxID(strTableName as string, strFldName as string, strCriteria as
string) as integer
to retreive the MaxID
and inserting it as Record ID (primary key) in the tables and returning
the same RecordID as
the corresponding function return value.

can anybody suggest me that what should be the best way for it.

I was thinking in sense taht if two users click on the save button on
the same time then
the getMaxID() function may return "2" to first user , and "3" to the
second user.

is that gonna create any problems in the applciation when a number of
cuncurrent users
are saving/updating records at same time.

Regards
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
0 1132

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

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
5
by: yvan | last post by:
Approximately once a month, a client of ours sends us a bunch of comma-delimited text files which I have to clean up and then import into their MS SQL database. All last week, I was using a Cold...
10
by: DaveDiego | last post by:
I've had a user delete one of the client records, I do have a version of the DB with all records intact before the deletion occured. Whats the best approach to getting all the related records in...
12
by: Aaron Smith | last post by:
What is the best way to handle data in a multiple user environment? We have forms that will allow users to add edit and delete data from a table on SQL server. The data could be edited on multiple...
0
by: Raheel Hussain | last post by:
hi, I have a following situations, in which I want to know about how ADO.NET is supporting. SITUATION 1 ----------- I m saving a customer record on click of Save button.
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
2
by: Bob | last post by:
I got three related datagrid views one parent and two children of the same. The two child tables contain many thousands of records and some of the contents are bitmap files in a sql server...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
1
by: =?Utf-8?B?QW1lbGlh?= | last post by:
Hello, Apologies for the easy coding questions but I have something I need to code in .Net and am fairly new to coding and don't want to produce bad code so after some advice from the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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,...
0
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...
0
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...

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.