Count values in an MSAccess table

0

I am creating my first application and would like to know how to count values from a table in MSAccess with the following conditions:

  • "requestor" and "Status" should contain specific values;
  • If you contain data solicitante = solicitante1 and status = aberto , count all values that satisfy this condition.

I tried something like this but I can not return values. I tried to use COUNT too.

If someone can give me a light on how to do the condition test and store the values in a variable. Thank you in advance.

string query7 =  " SELECT (Status_Solicitante)  from Cartoes where Status_Solicitante='"+"Aberto" + Solic+"'";
command7.CommandText = query7;
OleDbDataReader reader7 = command7.ExecuteReader();
while (reader7 .Read())
{
    label11.Text =  reader7.ToString();
}
    
asked by anonymous 15.07.2015 / 01:50

0 answers