N
NordeDakota
Scenario: using .NET DataTable and reading an existing record from MS
SQL Database using Ado.Net, and having .Net and SQL define the primary
key using FillSchema.
When I alter or change the values and I update or AcceptChanges my
record is modified as expected in the database. What I'm wondering and
I have not tested, yet, if I load an existing record from the data
source into a DataTable and the PrimaryKey is defaulted... should .Net
stop me or throw an exception if I try to alter a primary key value?
If I load a customer record into my DataTable with CustomerID as the
PrimaryKey and from the load this value is 1234; I think that the
DataTable should throw an exception if I attempt to change 1234 to
9987 or something else. However, I suspsect that .Net will allow me to
change a primary key value.
SQL Database using Ado.Net, and having .Net and SQL define the primary
key using FillSchema.
When I alter or change the values and I update or AcceptChanges my
record is modified as expected in the database. What I'm wondering and
I have not tested, yet, if I load an existing record from the data
source into a DataTable and the PrimaryKey is defaulted... should .Net
stop me or throw an exception if I try to alter a primary key value?
If I load a customer record into my DataTable with CustomerID as the
PrimaryKey and from the load this value is 1234; I think that the
DataTable should throw an exception if I attempt to change 1234 to
9987 or something else. However, I suspsect that .Net will allow me to
change a primary key value.