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!