首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

sql 语句有关问题,感谢大家

2012-03-02 
sql 语句问题,感谢大家stringsqlselect*fromuserlistwhereusername+this.txtname.Text+andppassword

sql 语句问题,感谢大家
string   sql   =   "select   *   from   userlist   where   username   =   ' "   +   this.txtname.Text   +   " '   and   ppassword   =   ' "   +   this.txtpwd.Text   +   " '   and   usertype   =   ' "+this.ddlsubschoolname.Text+ " ' ";

string   sss   =   "     select   sum(cast(c.ischeck     as       tinyint))as   summ   ,count   (*)   as   countt         from   roleright   a   inner   join   RoleRight   b   ON   A.Funname   =   '工作安排 '   AND   b.FunListType   =   A.FunId     inner   join   usertypefun   c   on   c.funid   =   a.funid   and   c.usertype   =   ' "   +   Session[ "branch "].ToString()+ " ' ";

其中Session[ "branch "].ToString()是前一个查询语句中的usertype
怎么把这两条语句变为一条语句。




[解决办法]
string sss = " select sum(cast(c.ischeck as tinyint))as summ ,count (*) as countt from roleright a inner join RoleRight b ON A.Funname = '工作安排 ' AND b.FunListType = A.FunId inner join usertypefun c on c.funid = a.funid and c.usertype = ' "+this.ddlsubschoolname.Text+ " ' ";

热点排行