dim strsql as string
strsql="select count(*) from team_member where userid= '" & Session("CurUser").ToString() & "' and team_code in(select team_code from sales_team where proj_code='" & request.cookies("Projects").Value &"')"orstrsql= String.Format("select count(*) from team_member where userid= '{0}' and team_code in (select team_code from sales_team where proj_code='{1}')", Session("CurUser").ToString().Replace("'","''"),request.cookies("Projects").Value.Replace("'","''"))
 

解决方案 »

  1.   

    运算符“&”只能用于string 的操作.
    除非你重载这个运算符.
    所以你知道了,操作数要调整
      

  2.   

    谢谢大家的帮忙!上面的问题已经解决了!我还有一个非常迷惑得问题:就是我想把一些经常用到的函数或过程,写到一个文件中,请问调用的语句怎么写?能不能像asp一样可以用include指令吗(最常用的就是数据库的连接语句,是不是也像ASP中<!-- #Include file="include/conn.asp" -->的用法)
      

  3.   

    写一个class,函数写在class中,相当于方法