这应该以最快的方式为您提供所需的字符串列表。
reader.GetString(0)表示您从索引为0的列(即第一个索引)中获取一个字符串值。
List<string> result = new List<string>();using (SqlConnection connection = new SqlConnection(databaseConnectionString)){ connection.Open(); using (SqlCommand command = new SqlCommand(query, connection)) { command.CommandType = CommandType.Text; using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { result.Add(reader.GetString(0)); } reader.Close(); } command.Cancel(); }}return result;


