protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("connection string");
con.Open();
SqlCommand cmd = new SqlCommand("select * from Users where UserID='"+Session["userid"].ToString()+"'",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
SqlCommand cmd2 = new SqlCommand("insert into AppliedUsers values('" + dt.Rows[0][0].ToString() + "','" + dt.Rows[0][1].ToString() + "',......) ", con);
cmd2.ExecuteNonQuery();
}
con.Close();
}