title: How do I lock a table from write operations until my insert is complete with Linq-to-sql
body: <p>I am working on an auction system and one of the issues I am trying to make sure I don't get affected by is a situation where 2 people put in a bid at the exact same time for the same item.</p>
  
  <p>To do this I need to put a lock on the table, get the highest bid for the current item, make sure the entered bid is greater than that bid, add a new bid entry into the table, then unlock the table.  </p>
  
  <p>I need to lock this so a second webserver does not trigger a bid insert between when I check for the highest bid and when I insert my new bid into the table, as this would cause data issues.</p>
  
  <p>How do I accomplish this with Linq-to-sql?</p>
  
  <p>Note, I don't know if transactionscopes can do this but I can't use them, as they tend to trigger a distributed transaction due to our webfarm setup, and I can't use distributed transactions.</p>