R
RMittelman
Guest
So I have an Access table which contains an AutoNumber column as primary key. Here is a snippit of the table in design mode:
NAID AutoNumber
NAFirstName Short Text
NALastName Short Text
I can successfully connect to the database and select records into a DataTable from my c# project using OleDb. But the DataColumn for the Access AutoNumber column shows AutoIncrement as false. Here is snippet from Immediate window:
dt.Columns[0]
{NAID}
AllowDBNull: false
AutoIncrement: false
AutoIncrementSeed: 0
AutoIncrementStep: 1
Caption: "NAID"
...
I'm trying to create a data access layer, and this is a show stopper for inserting new records I think. When building the SQL statement for the insert, how will I know to skip the primary key column if I can't tell that it's AutoIncrement (AutoNumber in Access)?
Any ideas how to verify the column is actually AutoNumber, and why the Microsoft OleDb driver doesn't bring that property over?
Thanks...
Ron Mittelman
Continue reading...
NAID AutoNumber
NAFirstName Short Text
NALastName Short Text
I can successfully connect to the database and select records into a DataTable from my c# project using OleDb. But the DataColumn for the Access AutoNumber column shows AutoIncrement as false. Here is snippet from Immediate window:
dt.Columns[0]
{NAID}
AllowDBNull: false
AutoIncrement: false
AutoIncrementSeed: 0
AutoIncrementStep: 1
Caption: "NAID"
...
I'm trying to create a data access layer, and this is a show stopper for inserting new records I think. When building the SQL statement for the insert, how will I know to skip the primary key column if I can't tell that it's AutoIncrement (AutoNumber in Access)?
Any ideas how to verify the column is actually AutoNumber, and why the Microsoft OleDb driver doesn't bring that property over?
Thanks...
Ron Mittelman
Continue reading...