Link to home
Start Free TrialLog in
Avatar of Nugs
Nugs

asked on

Using Visual Studio TableAdapter wizards to do insert inot multiple tables at once...

Afternoon guys and gals,

I wanted some information on inserting records into multiple tables at one time. Specifically doing this using the Visual Studio TableAdapter wizards.

Currently i am doing the inserts separately, which works fine, but if there is any failure between inserts one table will be missing a require row.

Any tutorials or help on how to do this using visual studio.

Thanks,
Nugs
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Nugs,
I not sure that I understand, so while I would suggest a try/catch block, I wouldn't know where and when to use it.

Bob
Avatar of Nugs
Nugs

ASKER

??

Ok let me try explain again, i think i have been very misunderstood :)

I'm using Visual Studios TableAdapter wizard, this wizard build SQL statement for use along with all the insert, update, etc... statements.

Here is the select statement it generates:
---------------------------------------------------------------------------------------------------------------------
SELECT     TBL_CUSTOMERDETAILS.*, TBL_CUSTOMERAUTH.*, TBL_CUSTOMERSETTINGS.*
FROM         TBL_CUSTOMERDETAILS INNER JOIN
                      TBL_CUSTOMERAUTH ON TBL_CUSTOMERDETAILS.FLD_CUSTOMERID = TBL_CUSTOMERAUTH.FLD_CUSTOMERID INNER JOIN
                      TBL_CUSTOMERSETTINGS ON TBL_CUSTOMERDETAILS.FLD_CUSTOMERID = TBL_CUSTOMERSETTINGS.FLD_CUSTOMERID
---------------------------------------------------------------------------------------------------------------------

So i guess to make my question a simple one... Can you do a insert on a joined tableadapter through visual studio?

Nugs
Avatar of Nugs

ASKER

Or do i have to do seperate INSERTS into each table?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nugs

ASKER

Thanks for the advice Bob... Much appreciated...

Nugs