您要做的第一件事是确保没有数据被返回:
SELECt TOP 0 [vwGetData].* FROM [vwGetData] WHERe 1 = 2;
现在假设您知道如何设置一个DataReader,您将执行以下 *** 作:
using(var reader = command.ExecuteReader()){ // This will return false - we don't care, we just want to make sure the schema table is there. reader.Read(); var tableSchema = reader.GetSchemaTable(); // Each row in the table schema describes a column foreach (DataRow row in tableSchema.Rows) { Console.WriteLine(row["ColumnName"]); }}
You can also could also look into the SQL Catalog SYS
Views.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)