Getting column names of a table in C# using OleDbConnection

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hi All,

I am new to using the Access DB and I need some help if someone
is able to give it to me. What I want to do is get the names of
the columns of certain tables. Not the data in the table but the
table column names. I was able to get the names of the tables in
a database using the GetOleDbSchemaTable method but I can't seem
to find the column names or find out how to get them.

I've seen other posts that suggest using the SQL command DESCRIBE
but I can't get it to work for some reason. Other posts have code
samples but they're written in VB which I am not familiar with. I
am looking for a piece of sample code written in C# using the
OleDbConnection classes, if that is possible. An SQL command would
be great but from what I've read there is no DESCRIBE command or
an equivalent. Can someone help me out?

Thanks in advance for any help or direction!

Sincerely,
Joe
 
The thingie you're looking for is field.name

For C# code I'd post in a C# ng.

HTH
 
Back
Top