Given an SQLConnection object how can you get a schema for a single table?
I was trying this the other day and I seemed to be able to get the schema from a DataSet w
I think accessing the schema from the query (via GetSchemaTable) is the only way to do it. You can run a query which returns no rows (select * from table where 1=2) if the schema is all you're interested in.
You should use the KeyInfo CommandBehaviour to execute the source query, as otherwise not all the information returned is guaranteed to be accurate
Command.ExecuteReader(CommandBehavior.KeyInfo)