All depends what object you are using to retrieve your information from the database.
Are you using a DataReader? If so, something like
using (IDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
int myValue = reader.GetInt32(0);
if (myValue == someTest)
{
}
}
}
Or from a Dataset...?
DataSet ds = adapter.Fill(myDataSet);
System.Data.DataTable dt = ds.Tables[0];
foreach(DataRow dr in dt.Rows)
{
int myValue = Convert.ToInt32(dr[0]);
if (myValue == someTest)
{
}
}