session 用户名

string strID = Session["userid"].ToString();
string username ="select username from users where id='"+strID+"'";
SqlConnection con1=new SqlConnection(ConfigurationManager.AppSettings["SqlCon"]);
con1.Open();
SqlCommand com1=new SqlCommand(username,con1);
string strusername = com1.ExecuteScalar();
con1.Close();
posted @ 2010-08-09 11:31  midisong  阅读(124)  评论(0编辑  收藏  举报