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 GuptaPosted Jan 5, 2017, 3:23 PM
IsraelPosted Jan 13, 2017, 11:31 AM
IsraelPosted Jan 5, 2017, 2:27 PM
Bikesh SrivastavaPosted Jan 5, 2017, 12:14 PM
Rajeev PunhaniPosted Jan 5, 2017, 9:05 AM
If the above solution is helpful then,accept the answer.
Chetan RanpariyaPosted Jan 5, 2017, 8:51 AM