473,320 Members | 2,161 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,320 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 1130

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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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: 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...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.