我想知道列的详细信息。我是从微软的网站上学到的。但我仍然不知道如何获得专栏的描述。下面我从Microsoft支持站点获得了代码块。
OleDbConnection cn = new OleDbConnection();
OleDbCommand cmd = new OleDbCommand();
DataTable schemaTable;
OleDbDataReader myReader;
cn.ConnectionString = "Provider=SQLOLEDB;Data Source=server;User ID=login;
Password=password;Initial Catalog=Northwind";
cn.Open();
cmd.Connection = cn;
cmd.CommandText = "SELECT * FROM Employees";
myReader = cmd.ExecuteReader(CommandBehavior.KeyInfo);
schemaTable = myReader.GetSchemaTable();
foreach (DataRow myField in schemaTable.Rows){
foreach (DataColumn myProperty in schemaTable.Columns) {
Console.WriteLine(myProperty.ColumnName + " = " + myField[myProperty].ToString());
}
Console.WriteLine();
Console.ReadLine();
}
myReader.Close();
cn.Close();
请帮助我,在此代码块中,如何获取列的说明?