Hello!
Is there any possibility to force MySQLDirect to fill in properties like DataTable.PrimaryKeys or DataColumn.AutoIncrement? I think this is more comfortable than using GetSchema.
// Edit: And when I have to use GetSchema: Does it work with all MySQL server systems ranging from 3.x to 5.x?
Kind Regards,
Florian Heinemann
DataTable.PrimaryKeys
You may use FillSchema method of MySqlDataAdapter. See the code snippet below:
or
Note that you'll have to configure mySqlDataAdapter1 before using it.
Code: Select all
DataTable myTable = new DataTable();
mySqlDataAdapter1.FillSchema(myTable, SchemaType.Source);
for (int i = 0; i < myTable.Columns.Count; i++)
MessageBox.Show(myTable.Columns[i].AutoIncrement.ToString());
Code: Select all
for (int i = 0; i < myTable.PrimaryKey.Length; i++)
MessageBox.Show(myTable.PrimaryKey[i].ToString());