You can make use of ADO .NET in the following steps:
1. Form a connection string.
2. Form your query
3. Add parameters
4. Execute the query with the help of DataReader
These two articles will help you:
Using ADO.NET for beginners[
^]
The ADO.NET OleDbDataReader class[
^]
EDIT: You can get values like this:
SqlConnection connection = new SqlConnection("YOUR CONNECTION STRING");
ArrayList valuesList = new ArrayList();
connection.Open();
SqlCommand command = new SqlCommand("YOUR SQL QUERY HERE", connection);
SqlDataReader dataReader = command.ExecuteReader();
while (dataReader.Read())
{
valuesList.Add(Convert.ToInt32(dataReader[0].ToString()));
}
connection.Close();
Note that for the above code, replace the index of dataReader with the column. Like to get the values of the second column give it a 1. Use an arraylist to get everything into an array.