title: Checking for absence of nulls and spaces in gridview column
body: <p>I have developed a web application in ASP.NET C# which has a gridview. I am checking whether the value of a certain gridview column is null or a blank space. I have an if-else statement which depends on this column value. If the column in not a null or a blank space i'm entering the if part of the flow. Otherwise, I'm entering the else part of the flow.</p>
  
  <pre><code>       if (!String.IsNullOrWhiteSpace(SelectedRow.Cells[6].Text))
          {
              Label1.Text = "[" + SelectedRow.Cells[6].Text + "]";
  
          }
  
          else
          {
              SqlUpdate.Parameters.Add(new OracleParameter("@ForestgrpNew", null));
          }
  </code></pre>
  
  <p>In cases where the gridview column has a null value, the flow is expected to move to the else part. But the flow still passes on to the if part. Is there anything wrong with (!String.IsNullOrWhiteSpace(SelectedRow.Cells[6].Text)) in checking whether the cell is neither a null nor a space?</p>
  
  <p>Any help would be much appreciated.   </p>