Inserting Virtual Records Using the Update Command of the Data Adapter...

0 views
Skip to first unread message

Hanover

unread,
Jul 28, 2005, 10:14:05 AM7/28/05
to DotNetDe...@googlegroups.com
I have a form that has a form/subform architecture. Each form
represents an estimate (textboxes/controls on the form) and each
estimate has many phases (datagrid) depending on the estimate type.

What Im doing is building a virtual record in the background when the
user adds a new estimate. This pre-populates the datagrid with the
appropriate phases and builds the two datatables that will hold both
the mainform/subform parts. Neither will have an ESTIMATE ID yet at
this point.

The strategy during the update is to save the main-form data first,
then get the new ESTIMATE ID that it created in the database and then
save the phases information last using the ESTIMATE_ID foreign key.

The reason being, we dont want people accidentally creating records if
they cancel out of doing an estimate.

I'm assuming since the data I'm creating in these datatables doesnt
actually exist in the database yet (just pulled from various look-up
tables), I would actually have to put an INSERT SQL STATEMENT in the
UPDATE COMMAND of the data adapter. Logic suggests I'm updating the
information in the datatables and not really inserting new DATATABLE
rows...

Is this logical? Or am I thinking incorrectly?

Reply all
Reply to author
Forward
0 new messages