Open Sql Server Create 2 tables
Create a new asp.net project , add a new DBML file , named as "Linq.dbml"
open default.aspx.cs add this code
protected void Button1_Click(object sender, EventArgs e)
{
LinqDataContext context = new LinqDataContext();
State s=new State();
s.StateId = 1;
s.State1 = "California";
s.Countries.Add(new Country() {CountryId=1,Country1="United States" });
context.States.InsertOnSubmit(s);
context.SubmitChanges();
}
This wil insert One record into state table & Countries table .