Hi!
When I make a filter its stuggs or block. Doesnt do the filter. I realize that the my Totals's column have some blank rows. Then how can I do to considerate all blank rows as null or "0".
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from cadastramento where year= ?";
var param1 = new OleDbParameter("@year", OleDbType.VarChar); // use actual type of 'name' here
param1.Value = cbxYear.Text; // or whatever
cmd.Parameters.Add(param1);
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(dt);
conn.Close();
dGVCons.DataSource = dt;
this.dGVCons.RowsDefaultCellStyle.BackColor = Color.AliceBlue;
this.dGVCons.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
int sum = 0;
for (int i = 0; i < dGVCons.Rows.Count; ++i)
{
sum += Convert.ToInt32(dGVCons.Rows[i].Cells["total_Clothes"].Value);
lblTotalClothes.Text = " " + sum.ToString();
int sum1 = 0;
for (int i1 = 0; i1 < dGVCons.Rows.Count; ++i1)
{
sum1 += Convert.ToInt32(dGVCons.Rows[i1].Cells["total_Shoes"].Value);
lblTotalShoes.Text = " " + sum1.ToString();

Amit GuptaRank #190 · 12.8K reputationPosted Jan 5, 2017, 10:23 AM EST
Chetan RanpariyaRank #1,852 · 801 reputationPosted Jan 5, 2017, 3:51 AM EST
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Jan 5, 2017, 7:14 AM EST
IsraelRank #1,223 · 1.5K reputationPosted Jan 5, 2017, 9:27 AM EST
IsraelRank #1,223 · 1.5K reputationPosted Jan 13, 2017, 6:31 AM EST
Rajeev PunhaniRank #551 · 4.4K reputationPosted Jan 5, 2017, 4:05 AM EST
If the above solution is helpful then,accept the answer.