Trouble loading SQL Data Reader data into DataTable
问题 string query = "select * from cfo_daily_trans_hist"; try { using (SqlConnection connection = new SqlConnection( cnnString)) { SqlCommand command = new SqlCommand(query); command.Connection = connection; connection.Open(); var result = command.ExecuteReader(); DataTable datatable = new DataTable(); datatable.Load(result); connection.Close(); } } So the var result is created through the ExecuteReader(); and HasRows is true , and it shows the correct amount of fields. However, the DataTable that