title: Handling TableAdapter Null Values
body: <p>I have a query in a TableAdapter that wrapped this SQL (Oracle SQL, uses ':' instead of '@' for parameterized variable), which I called <code>GetModel()</code></p>
  
  <pre><code>SELECT MFG_PRODUCT FROM FRAME_NO
  WHERE FRM_NO = :FRM_NO
  </code></pre>
  
  <p>I expected the query might return null values, so I set the column <code>MFG_PRODUCT</code> null value to be <code>Null</code> as pointed by this guideline from Microsoft
  <a href="http://msdn.microsoft.com/en-us/library/ya91ataz(v=vs.100).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ya91ataz(v=vs.100).aspx</a></p>
  
  <p>However, my application still throw exception when the query returned no rows. What should I do?</p>
  
  <p>I have rebuild the whole solution just in case that the code still referencing the old compiled dataset, but still, no luck.</p>
  
  <p>Edited: Here is the code. The exception is thrown when the returned value is null</p>
  
  <pre><code>try
  {
      String modelCode = frameAdapter.GetModelCode(txtStdFrameId.Text.Trim()).ToString();
      if(String.IsNullOrEmpty(modelCode)) //Go directly to exception when data is null here
      {
         //Process the data 
      }
  }
  catch(Exception ex)
  {
       //Log error to a text file
  }
  </code></pre>