if ( textbox.Text =="" ) { // then assign ur variable null } else { // do your coding } it helps pls select as answer
try { int TheInt = int.Parse( textbox.Text ); // If it continues format was OK } catch { // If exception thrown, format was not Ok, }
int TheInt; if (int.TryParse( textbox.Text, out TheInt )) { // Format was OK } else { // Format was not Ok, }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)