if ((file.Exists) ?
lblresults.Text = "the file is there" :
lblresults.Text = "the file is not there");
I keep getting the error stating cannot implicitly convert string to bool
any help would be great, thanks.
if ((file.Exists) ?
lblresults.Text = "the file is there" :
lblresults.Text = "the file is not there");
I keep getting the error stating cannot implicitly convert string to bool
any help would be great, thanks.
try this:
lblResults.Text = file.Exists ? "the file is there" : "the file is not there";
Basically you don't need the if.
It expects a bool back. Try this:
lblResult.Text = ((file.Exists) ? "the file is there" : "the file is not there");