querystr=querystr+" where stuno="+'"'+tb1.Text+'"'; 
改成:
querystr=querystr+" where stuno="+ tb1.Text +""; 

解决方案 »

  1.   

    如果是查询的是名称:querystr=querystr+" where stuno="'+ tb1.Text +'""; 
    如果是ID:querystr=querystr+" where stuno="+ tb1.Text +""; 
      

  2.   

    上边写的有误不好意思:
    如果是查询的是名称:querystr=querystr+" where stuno='"+ tb1.Text +"'";
    如果是ID:querystr=querystr+" where stuno="+ tb1.Text +"";注意单引号
      

  3.   

    说实话你的这个查询要是有效果的话就奇怪了,你的那个querystr,当点击了button以后就是空的,没有查询语句,怎么查询。在Page_Load()中把你的那个querystr换成Label1.Text试试。