Part of the void code:

string sql = "SELECT SUM(monto) As TOTALM from meses where status='ACTIVO' and mesactual= '" + vMes.ToString() + "' and ano= '" + vAno.ToString() + "'";
      dtm = new OleDbDataAdapter("Select * from meses order by nombre", con);
      oCM = new OleDbCommandBuilder(dtm);
      OleDbCommand cmd = new OleDbCommand(sql, con);
      OleDbDataReader reader = cmd.ExecuteReader();
      dtm.Fill(tm);
      while (reader.Read())
      {
        if ([B]HOW I CAN KNOW IF THIS VALUE IS NULL????[/B])
        {
          txtPendiente.Text = "No hay registros disponibles";
          return;
        }
        else
        {
          string xTotal = reader["TOTALM"].ToString();
          int vTotal = int.Parse(xTotal);
          txtPendiente.Text = string.Format("{0:$0.00}", vTotal);
        }
        
      }
      reader.Close();
      cmd.Dispose();

thx for your help....

Use reader.IsDBNull(column_ordinal) method.

if(reader.Value(0) == DbNull.Value)
{
    //code!
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.