To Make Select Query to retrive your MemberId,
Example:
SqlConnection con=new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=shoping;Integrated Security=True");
con.Open();
SqlCommand cmd=new SqlCommand("Select memberid from Members Where membername='"+TextBox1.Text+"'",con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
string id=dr.GetValue[0].ToString();
Session["_memberid"]=id;
}