I inherited some code and I need to change a line so that instead of testing to see if the value in a table column is not null, it also tests to see if the value is not empty.
The existing line is:
if (rdr["InnLinkURL"] != null)
"InnLinkURL" is the name of the column being tested.
I thought a solution could be something like:
if (String.IsNullOrEmpty(InnLinkURL) == true)
Not sure how to convert the object to a string, though.
public static string ToString(
If someone could show me the proper syntax I'd be grateful.
As an alternative, I tried this also but it doesn't seem to work (no errors, just doesn't return true)
if ((rdr["InnLinkURL"] != null) && (rdr["InnLinkURL"] != ""));
View Complete Post