Returns a DataTable containing column metadata for the supplied SQL statement/table name
- Sql (String)
-
SQL statement or table name
A DataTable
DbNetData Data = new DbNetData( ConfigurationSettings.AppSettings[ "nwind" ] ); Data.Open(); DataTable SchemaInfo = Data.GetSchemaTable("customers"); foreach ( DataRow R in SchemaInfo.Rows ) if (R["ColumnName"].ToString() == "CustomID" ) if ( (bool)R["IsKey"] ) CustomerID.ReadOnly = true;