My Code is below
private void label94_Click(object sender, EventArgs e)
{
float total = 0;
int counter;
for (counter = 0; counter < (dataGridView2.Rows.Count); counter++)
{
if (dataGridView2.Rows[counter].Cells["Price"].Value != null)
{
if (dataGridView2.Rows[counter].Cells["Price"].Value.ToString().Length != null) {
total += float.Parse(dataGridView2.Rows[counter].Cells["Price"].Value.ToString());
}
}
}
textBox1.Text = total.ToString();
}
this code is running properly but showing an error by holding on the cursor on bold text code.
Error Message :- The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'.
I don't know why this message is showing. Please someone help.