执行此代码时:
string query = @"SELECT * FROM {0};";
query = string.Format(query, TEMP_TABLE_NAME);
var command = new SqlCommand(query, this.connection);
command.CommandTimeout = 0;
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows) {
while (reader.Read()) {
// Some stuff
}
}
读者为空,reader.HasRows
为真,但在第一个reader.Read()
上,它已结束......
当我在SQL Server Management Studio中执行此请求时,没关系,我会记录所有列及其值。
你有想法吗?