Below is the code snippet to insert record using LINQ to SQL into the database.
Assuming
dContext is your data context,
MyTable is the database table mapped in the context.
using (dContext db = new dContext())
{
MyTable w = new MyTable ()
{
MyName = txtName.Text,
MyAddress = txtAddress.Text
};
db.MyTable.InsertOnSubmit(w);
db.SubmitChanges();
}
Thanks