I don't think there is a direct SQL method for querying the column count of a table.
However, you could write a simple select statement like "SELECT * FROM mytable WHERE 1=0" that would return you no data, but the structure of the table. Then you could check the count of the columns collection of whatever ever object (like a DataReader) that you executed the query to).
|