INSERT new values into 3 related tables - within grid control

  • Thread starter Thread starter Marina
  • Start date Start date
M

Marina

How should my CommandText be written to insert new values into 3 related
tables:

TblProject:
ProjectID - autonumber
CompanyID - number (fk)
EngineerID - number (fk)

TblCompany:
CompanyID - autonumber
ProjectID - number (fk)

tblEmployees:
EngineerID - autonumber
ProjectID - number (fk)

I am having a grid control on my form (Infragistics grid, if this helps) and
I am trying to put the commandtext together and I am not sure I can do it
within one insert statement.

Any help will be appreciated.
Thank you.
 
Marina:

Pull the data over via three seperate dataadapters, add the datarelations
between, set up a simple bindingcontext and bind the grid. If you do this
all, you can simply call BindingContext.AddNew for new records, and you can
update/insert/delete etc by simply calling DataAdapter.Update for each table
in the DataSet.
 
Back
Top