Hi friends)
I have such error in my code-
Object reference not set to an instance of an object
code -
int n1, n2;
if (dataGridView1[2, 0].Value != "")
[B]if (int.TryParse(dataGridView1[2, 0].Value.ToString(), out n1) == false)[/B]{}
If I do not specify the value of the cell - this code will not work ..... I do not understand, why? (if to specify - it will work)
why it's so?
And I don't understand - why the code continues to run after the test -
if (dataGridView1[2, 0].Value != "")
Big thanks in advance)))