title: How to check overlapping numbers?
body: <p>I have a table called Table1 like below,</p>
  
  <pre><code>Table1
  ------
  
  Id         FromUnit           ToUnit
  --
  1,          1,                  10,
  
  2,          5,
  
  3,          11                  15
  </code></pre>
  
  <p>Here i need to check the overlapping number from the above table.</p>
  
  <p>1)When i am inserting the first record , i can allow that insert because we dont have any record as this is a first record.</p>
  
  <p>2)For the second insert 5 which is in between 1 and 10, so we should not allow that insert.</p>
  
  <p>3)Third record we can insert because we dont have any previous overlapping numbers for that.</p>
  
  <p>How we do this kind of check in c#? Can anybody please help me to do this ?</p>
  
  <p>Thanks</p>
  
  <p>Pradeep</p>