usually this will happen because of "empty string converstion to int".
eg: Convert.ToInt32(TextBox.Text)); //here 'TextBox.Text' is empty.
Please make sure that all the
"TextBox.Text" value is
"not empty" before the Int32 conversion or use "int.TryParse".
Sample:
int test1223 = -1;
TextBox1.Text="2";
int.TryParse(TextBox1.Text, out test1223);
TextBox1.Text="";
int.TryParse(TextBox1.Text, out test1223);
Please refer the following link for more details about "int.TryParse" method.
http://msdn.microsoft.com/en-us/library/f02979c7.aspx[
^]