convert string to bool error
In my program i write 1 if else condition. In if (txt1.Text=" ") the value of txt1 is integer. So it genrate error Can not convert string to bool. So how to convert string to bool in program
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jan 17, 2012, 9:02 AM
Jignesh TrivediPosted Jan 17, 2012, 8:11 AM
try following code
if (!string.IsNullOrWhiteSpace(txt1.text))
{
}
hope this help
Mukesh KumarPosted Jan 17, 2012, 7:19 AM
Try this
if (txt1.Text==" ")