title: Increment number by 1 insert into database using Linq
body: <p>If possible I would like to increment a number on the application side and save to the database using c# and Linq.</p>
  
  <p>So for example I have a table like so:</p>
  
  <pre><code>|id|text|version|
  -----------------
   1  hello   1
   2  hello   1
  </code></pre>
  
  <p>When inserting a new record into this table I want to get the current version number and increment by 1 then insert a new row</p>
  
  <pre><code>|id|text|version|
  -----------------
   1  hello   1
   2  hello   1
   1  hello   2
  </code></pre>
  
  <p>I can do a standard insert using linq but obviously stuck with what to do with the version</p>
  
  <pre><code>DataContext db = new DataContext
  
  using (db)
  {
      table t = new table
        {
           text = TextBox1.Text
           version = ??
        };
  
  db.table.InsertOnSubmit(t);
  db.SubmitChanges();
  }
  </code></pre>
  
  <p>Can I somehow select the row and get the current version number and then just increment by 1? Or should I just re-think my approach?</p>
  
  <p>Thanks</p>