Skip to content

Instantly share code, notes, and snippets.

@biomood
Created June 22, 2011 11:05
Show Gist options
  • Save biomood/1039882 to your computer and use it in GitHub Desktop.
Save biomood/1039882 to your computer and use it in GitHub Desktop.
Add a record to a DB using Linq to SQL
DataContext db = new DataContext();
try {
db.table.InsertOnSubmit(obj);
db.SubmitChanges();
}
catch(Exception) {
return false;
}
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment