So far, I've been doing something like this just before reading the table:
Code: Select all
using (MySqlCommand cmd = new MySqlCommand(sqltext, connection) { FetchAll = false })
{
using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
{
for (int i = 0; i < reader.FieldCount; i++)
{
String fld = reader.GetDataTypeName(i);
.....
}
reader.Close();
}
}
Code: Select all
MySqlDataTable Result = new MySqlDataTable();
Result.Connection = connection;
Result.FetchAll = true;
Result.SelectCommand = new MySqlCommand(sqltext);
Result.StartRecord = 0;
Result.MaxRecords = 20;
Result.Open();
- is there any way to get the datatypename informations directly from the MySqlDataTable instead than having to run the code above also ?
Thanks in advance