jerrym
Posts: 52
|
| Posted: 01/23/2007, 4:24 PM |
|
is it possible via custom insert to insert data from 2 different forms on the same page to 2 different tables in the database from 1 submit button?
would anyone have a sample i can work with. many thanks.
|
 |
 |
Edd
Posts: 547
|
| Posted: 01/24/2007, 2:07 PM |
|
Jerry
Forms in ASP are submitted separately.
The alternatives can be done but it can be easy OR very messy. Both require a bit of coding.
Alternative 1: My preferred method, write a stored procedure to populate the form and a stored procedure to save the form.
Alternative 2, provided you only have one to one realtionship in the forms:
Add fields to the first form from the second as computed fields. Then poplate those fields in the beforeShowRow event.
To save you can either call a stored procedure (my preferred method) have an After Insert, After Update and After Delete events that read the data as you would from a normal ASP form to perform the updates.
You can't provide code as each example is different.
Cheers Ed
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
jerrym
Posts: 52
|
| Posted: 01/24/2007, 4:36 PM |
|
hi edd - hows it going?
many thanks for your pointers.
because i'm not comfortable with stored procedures i've decided to use alternative 2 but slightly different.
i still retained the 2 separate forms. the master has a custom update property with an insert into statement to transfer data to tableA. then i put an After update event on the master and wrote a custom code to populate tableB with data from the Details Editable grid, researched this to discover that an Insert into plus a Select statement will technically work. so far the response.write seems ok.
|
 |
 |
sasikala
|
| Posted: 02/05/2007, 9:58 PM |
|
How to insert the data to different tables in database by using single form
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 02/05/2007, 11:12 PM |
|
Please see examples in CCS Example Pack.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |