title: Inserting data using Linq
body: <p>I have a linq query to insert data in table. but its not working. I saw some example on internet tried to do like that but doesn't seems to work.</p>
  
  <p>Tablename: login has 3 columns userid, username and password. I set userid as autoincrementing in database. So I have to insert only username and password everytime.Here's my code.</p>
  
  <pre><code>linq_testDataContext db = new linq_testDataContext();
  login insert = new login();
              insert.username = userNameString;
              insert.Password = pwdString;
              db.logins.Attach(insert);// tried to use Add but my intellisence is not showing me Add.I saw attach but dosent seems to work.
              db.SubmitChanges();
  </code></pre>