Create one store procedure as follows...
CREATE procedure proc_RegisterUser
@firstName varchar(50),
@lastName varchar(50),
@DOB datetime,
@country int,
@state int,
@email_id varchar(80),
@mobile_no varchar(10),
@password varchar(30),
@userType varchar()
as
Begin Transaction
insert into registration_mst(firstName, lastName, DOB, country, state, mobile_no)
values(@firstName, @lastName, @DOB, @country, @state, @mobile_no)
insert into login_mst(email_id, password, userType)values(@email_id, @password, @userType)
Commit Transaction
Then in code behind call this procedure and pass the parameters as follows....
SqlConnection con = new SqlConnection(conStr);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear();
cmd.CommandText = "proc_RegisterUser";
cmd.Parameters.Add(new SqlParameter("@firstName", txtFirstName.Text));
cmd.Parameters.Add(new SqlParameter("@lastName", txtLastName.Text));
cmd.Parameters.Add(new SqlParameter("@DOB", txtDOB.Text));
cmd.Parameters.Add(new SqlParameter("@country", ddlCountry.SelectedValue));
cmd.Parameters.Add(new SqlParameter("@state", ddlState.SelectedValue));
cmd.Parameters.Add(new SqlParameter("@email_id", txtEmail.Text));
cmd.Parameters.Add(new SqlParameter("@MobileNo", txtMobile.Text));
cmd.Parameters.Add(new SqlParameter("@password", txtPassword.Text));
cmd.Parameters.Add(new SqlParameter("@userType",ddlUserType.SelectedValue));
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Just follow the code and make necessary changes for table names, column names etc...