Using AutoIncrement/Identity in DataSet/Database

G

Guest

I'm trying to use the general architecture of Duwamish7... the Data layer
loads selected rows from several related DataBASE tables into one DataSET
object and then returns the DataSET to the business/user layers. The
business/user layer then modifies the DataSET and passes it back to the Data
layer, which then reconnects and sync's any changes with the DataBASE tables.

My question regards how to handle DataBASE (SQL2K) "Identity" columns in the
DataSET... Specifically, should those columns in the DataBASE which are
"Identity" columns be defined as AutoIncrement columns in the DataSET?

If the columns in the DataSET ARE defined as AutoIncrement, then it seems
there will be problems loading the existing values of these columns from the
DataBASE into the DataSET (ie, the DataSet will want to assign the values
itself, and not accept the values already assigned in the DataBASE).

On the other hand, if the columns in the DataSET are NOT defined as
AutoIncrement, this will create a problem when the business/user layer
inserts a row into the DataSET (the column value won't be automatically
assigned) .

Or is there maybe another scenario, like maybe not using the DataBASE's
values for the equivalent columns in the DataSET (and vice-versa). That is,
"isolating" the autoincremented columns between the DataBASE and DataSET, and
never transferring the auto-assigned values from one to another.

Or am I just generally on the wrong track....???

Thanks,

DT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top