How can I save the results of an SQL query into an array?
I want to use the values (located in col1 and col2) in an IF statement, leading to my thinking of saving them in an array.
var con = new SqlConnection("Data Source=local;Initial Catalog=Test;Integrated Security=True");
using (con)
using (var command = new SqlCommand("SELECT col1,col2 FROM some table", con))
{
con.Open();
command.ExecuteNonQuery();
}