hi @ meiyi,
First of all you need to unbox session item.
as i did below.
string name = Session["Name"] != null ? Session["Name"] as string : string.Empty;
Then now go to insert these value in your database using query.
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString);
SqlCommand cmd = new SqlCommand("INSERT INTO User(Name,City) VALUES(@UserName,@City)", con);
cmd.Parameters.AddWithValue("@UserName", name);
cmd.Parameters.AddWithValue("@City", "Mumbai");
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Any confusion revert on the same.
Warm regards:-