判断session,该怎么解决

判断sessionif(HttpContext.Current.Session[ Type ].ToString()管理员 ){SqlDataSource1.SelectCom

判断session
if   (HttpContext.Current.Session[ "Type "].ToString()   ==   "管理员 ")
                {
                        SqlDataSource1.SelectCommand   =   "select   *   from   userinfo   where   UType= '会员 ' ";
                }
  if   (HttpContext.Current.Session[ "Type "].ToString()   ==   "系统管理员 ")
                {
                        SqlDataSource1.SelectCommand   =   "select   *   from   userinfo   where   UType= '会员 '   or   UType= '管理员 ' ";
                }
以上代码在判断的时候出现错误请指教!多谢!!

[解决办法]
if(HttpContext.Current.Session[ "Type "]!=null)
{
if (HttpContext.Current.Session[ "Type "].ToString() == "管理员 ")
{
SqlDataSource1.SelectCommand = "select * from userinfo where UType= '会员 ' ";
}
if (HttpContext.Current.Session[ "Type "].ToString() == "系统管理员 ")
{
SqlDataSource1.SelectCommand = "select * from userinfo where UType= '会员 ' or UType= '管理员 ' ";
}
}