Murray Brown
asked on
VB.net Access check if column type is AutoNumber
Hi
I used the following code to bind data about the VB.net Access tables in my database.
I noticed that the DATA_TYPE column shows 3 for integer values. I am trying to find which columns are Autoumber. How do I do this?
Dim connection As New OleDbConnection(Globals.Th isAddIn.oR IGHT.lblCo nnectionSt ring.Text)
connection.Open()
Dim mySchema As DataTable = TryCast(connection, OleDbConnection).GetOleDbS chemaTable (OleDbSche maGuid.Col umns, New [Object]() {Nothing, Nothing, "Transactions"})
Me.DataGridView3.DataSourc e = mySchema
I used the following code to bind data about the VB.net Access tables in my database.
I noticed that the DATA_TYPE column shows 3 for integer values. I am trying to find which columns are Autoumber. How do I do this?
Dim connection As New OleDbConnection(Globals.Th
connection.Open()
Dim mySchema As DataTable = TryCast(connection, OleDbConnection).GetOleDbS
Me.DataGridView3.DataSourc
If you bind this datatable to a grid, do you see any column that may indicate autonumber?
ASKER
Hi
I already did that and I can't seem to find anything useful.
The DATA_TYPE column has 3 for Integers and AutoNumbers,
but that doesn't help.
ORDINAL_POSITION as you know doesn't cover all bases.
IS_NULLABLE also doesn't distinguish an integer from an AutoNumber.
So I am at a loss...
I already did that and I can't seem to find anything useful.
The DATA_TYPE column has 3 for Integers and AutoNumbers,
but that doesn't help.
ORDINAL_POSITION as you know doesn't cover all bases.
IS_NULLABLE also doesn't distinguish an integer from an AutoNumber.
So I am at a loss...
ASKER
In a previous question relating to this I was given the following link
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.autoincrement.aspx
but am not sure how to apply this
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.autoincrement.aspx
but am not sure how to apply this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much