In-Memory Dataset
- From: "Michelle Brennan" <mibi222@xxxxxxxxxxx>
- Date: 25 Oct 2005 20:05:49 -0700
I think I figured out a way to do BatchOptimistic Master-Detail
Inserts with sequential non-skipping ID numbers (for Order /
Invoice application). It's a work-around but I think it will
work.
I can use a temporary table with the exact same structure as the
detail table. On Order inserts, the detail databound controls'
datasource property will be set from datasetDetail to
datasetTemporary. datasetTemporary will not be linked to master
dataset, so master-foreign key values don't matter here.
When the user clicks the SAVE button:
- I will get the next key (from keytable or IDENTITY or etc..)
- Post datasetMaster
- Manually insert all data in datasetTemporary to datasetDetail
and include the newly generated key into foreign key field
- Post datasetDetail
- Re-bind all data controls back to datasetDetail
- BatchUpdate master and detail
But now I have another problem:
How can I copy the datasetDetail's structure (fields definition
*without* the data) into an in-memory ADO dataset? I tried
copy & pasting datasetDetail and named it datasetTemporary. But
here's the problem:
What do I put for CommandText and Connection??? It's not
supposed to get any data from database. This is just supposed
to be a dummy table for holding temporary data. I don't want to
have anything to do with database access here.
I could create dummy tables in SQL Server, but I need MANY
different tables for MANY master-detail forms. Creating every
single dummy table in database is completely not viable.
Once again, I'd greatly appreciate your help!!!
.
- Follow-Ups:
- Re: In-Memory Dataset
- From: Kevin Frevert
- Re: In-Memory Dataset
- From: Vitali Kalinin
- Re: In-Memory Dataset
- Prev by Date: Re: connection to Postgres
- Next by Date: Re: Non-skipping IDs with Master-Detail
- Previous by thread: connection to Postgres
- Next by thread: Re: In-Memory Dataset
- Index(es):