public void SignUp(string fName, string mName, string lName, string uName, string pass, string aPass, string email, string gender, string address, string dOB, SignUp a) { MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\USER\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True"); Person p = new Person(); People po = new People(); cntx.Persons.InsertOnSubmit(p); cntx.Peoples.InsertOnSubmit(po); p.FirstName = fName; p.MiddleName = mName; p.LastName = lName; p.UserName = uName; p.Password = pass; p.Email = email; p.Gender = gender; p.Address = address; p.BirthDate = dOB; po.UserName = uName; po.password = pass; po.UserType = "Customer"; cntx.SubmitChanges(); // cntx.SubmitChanges(); cntx.Dispose(); new SignUp().ErrorMassage("successfully signed up"); }