mycommand=new oledbDataAdapter("select * from project where id="+session("id"),conn)

解决方案 »

  1.   

    判断session("id")值是否存在。如果不存在,会出错。
      

  2.   

    mycommand=new oledbDataAdapter("select * from project where id="&cstr(cint(session("id"))),conn)
      

  3.   

    mycommand=new oledbDataAdapter("select * from project where id=" & trim(cstr(session("id"))),conn)
      

  4.   

    session一建立不是到用户离开一直都存在的吗?
    那应该怎么解决啊?!!
      

  5.   

    session("id")可能已经丢失,或者超时被清除了!
      

  6.   

    每次加载页面,都要重新获取id,放入session,当没id传过来时,session("id")
    可能是空,特别是第一次加载时,你可能没有设置默认 id,肯定出错,解决办法,先默认一个id.
      

  7.   

    可能是session("id")为null所致。
      

  8.   

    把mycommand=new oledbDataAdapter("select * from project where id="&session("id"),conn)变成mycommand=new oledbDataAdapter("select * from project where id='"&session("id")&"'",conn)试试看。