No,
A string, wich is declared as an string.Empty or "" aren't the same as a string with " ".
Whitespace is a character and with it inside of a string, it isn't null or empty anymore.
You can check it:
this one tells if its Null or Empty ("")
string a;
string b = string.Empty;
string c = "";
string d = " ";
if(string.IsNullOrEmpty(HERE))
{
// a b and c will be true, d will be false
}
if(string.IsNullOrWhiteSpace(HERE))
{
// a b c and d will be true.
}
So to answer your questions:
1) you never can because it isn't the same thing.
You can trim temporarely the whitespace to make it empty.
Like:
var temp = StringWithWhiteSpace.Replace(" ", string.Empty);
and then check if it is Null or Empty and work with the temp string.
if(string.IsNullOrEmpty(temp))
{
}
or check directly for string.IsNullOrWhiteSpace()
2) it means that in your database there are spaces and it is not an empty cell.
You can delete all whitespace Cells in your database if you use
UPDATE tableName SET columnName='' WHERE columnName=' ';
if every "empty" cell has the same numbers of whitespaces.
if not you can look here:
SQL query - filter out field containing only spaces