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.ThisAddIn.oRIGHT.lblConnectionString.Text)
        connection.Open()

        Dim mySchema As DataTable = TryCast(connection, OleDbConnection).GetOleDbSchemaTable(OleDbSchemaGuid.Columns, New [Object]() {Nothing, Nothing, "Transactions"})

        Me.DataGridView3.DataSource = mySchema
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
That may work if you do a select on the table itself (not getschematable) and then check the AutoIncrement property of the column in datatable.
0
 
CodeCruiserCommented:
If you bind this datatable to a grid, do you see any column that may indicate autonumber?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
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...
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
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
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.