If you do not have a DBML setting, add it to your project.
To add DBML to your project from Solution Explorer:
Right click on your project -> go to Add new Item -> select LINQ to SQL Classes
To populate DBML with your tables, follow the link:
View -> Server Explorer
Expand your database and drag your tables into the dbml viewer
Then, if your table is a caleld Widget:
DataClasses1DataContext db = new DataClasses1DataContext(myConnection);
db.Widgets.InsertOnSubmit(myWidget);
db.SubmitChanges();
source
share