比如sql里面是这样获取select c.name as 字段名 from sysindexes i 
join sysindexkeys k on i.id = k.id and i.indid = k.indid 
join sysobjects o on i.id = o.id 
join syscolumns c on i.id=c.id and k.colid = c.colid 
join systypes t on c.xusertype=t.xusertype 
where o.xtype = 'U' and o.name='tablename'--表名 
and exists(select 1 from sysobjects where xtype = 'PK' and parent_obj=i.id and name = i.name) 
order by o.name,k.colid 
在C#中如何获取access数据库表的主键字段名