Is there a built-in way to get table schema in ADO.NET?

I want to get the table schema in order. This question and its answer is my question and what I want to do. However, he feels (to me) quite hacks, and, being two years old, I hoped that the answer was outdated. Is there really no way to get the table schema in its own order? (e.g. ADOX OpenSchema(adSchemaTables...) )?

Subjective question: is this not a huge gaping hole in ADO.NET at all ??

+2
source share
2 answers
 exec sp_help '<tablename>' 

or

 select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '<tablename>' order by ORDINAL_POSITION 
+2
source share

You can use GetSchema in the Connection object.

0
source share

All Articles