Quantcast
Channel: conn.GetSchema find primary key of table - MsAccess - Stack Overflow
Viewing all articles
Browse latest Browse all 3

conn.GetSchema find primary key of table - MsAccess

$
0
0

I have a MsAccess database (.mdb) located in D drive as (D:\project.mdb).Database have more than 120 Tables. There is a table Records which have primary key and multiple fields. I want to get the Columns,ColumnType and PrimaryKey.

I am getting fields and its type using :

Dim TableNm_ As String = "Records"Dim restrictions2() As String = {Nothing, Nothing, TableNm_, Nothing} Dim DataTable2 As System.Data.DataTable = conn.GetSchema("Columns", restrictions2)

But it did not have PrimayKey Column.

I have gone through several SO posts and others like GetSchema and PrimaryKey column. But i do not want to create a command and Reader to read the key.

Is there any way to get PrimayKey Column of table Records only, using conn.GetSchema ?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images