It is possible to find the number of rows in a table:
select count(*) from tablename
Is it possible to find the number of columns in a tabl
A MySQL answer adapted slightly from the MSDN example for MySqlDataReader.GetValues:
//assumes you've already created a connection, opened it,
//and executed a query to a reader
while(reader.Read())
{
Object[] values = new Object[reader.FieldCount];
int fieldCount = reader.GetValues(values);
Console.WriteLine("\nreader.GetValues retrieved {0} columns.", fieldCount);
for (int i = 0; i < fieldCount; i++)
Console.WriteLine(values[i]);
}
Using MySqlDataReader.FieldCount
will allow you to retrieve the number of columns in the row you've queried.