title: How to check and replace null value in C#
body: <p>Anyone can guide me a way to check and replace null values in strList with String message "NO DATA" or allow them in dtList. 
  Because when I met a null value in this List,it show an error like "There is no row at position..."</p>
  
  <pre><code>private DataTable getSomething1(String text){
      DataTable dtb = new DataTable();
      ...
      ...
      return dtb;
  }
  
  ...
  
  protected void buttonCheck_Click(object sender, ImageClickEventArgs e){
      List&lt;DataTable&gt; strList = new List&lt;DataTable&gt;(){
          getSomething(txtInput.Text),
          getSomething2(txtInput.Text),
          getSomething3(txtInput.Text),
          ...                
      };
  }
  </code></pre>
  
  <p>I used C# in Webform.
  Plz, help me to fix this code or guide me a way to solve it. 
  Thanks in advance.</p>
  
  <p>@tech, @ riffnl: Finally I get all of your ideas and it really work now. Anw, thanks all pro here for advices. So, this is my solution ^^ </p>
  
  <pre><code>private String ConvertNullToEmptyString(DataTable element)
      {
          if (element.Rows.Count &gt; 0) //just add this condition here
          {
              if (!DBNull.Value.Equals(element.Rows[0]["FullName"]))
                  return (string)element.Rows[0]["FullName"] + " ";
              else
                  return String.Empty;
          }
          return "NO DATA";
      }
  
  protected void ....(){
       List&lt;DataTable&gt; strList = new List&lt;DataTable&gt;(){
         GetItem1(txtName.Text),   //private DataTable GetItem1(String t)
         GetItem2(txtName.Text),   //...           
       };
  
      txtGrD_D.Text = ConvertNullToEmptyString(strList[0]);
      txtGrM_D.Text = ConvertNullToEmptyString(strList[1]);
  }
  </code></pre>