本帖最后由 wangtao9826 于 2010-05-20 15:29:40 编辑

解决方案 »

  1.   

    con = sqlcon.con();
    里面连接的文字设置了没?  
      

  2.   

    SqlConnection con =sqlcon.con();
      

  3.   

    设置过了sqlCon.con()里的连接字符串都设置过了保证是没错的.
      

  4.   

    ds.Tables["list1"].Rows.Clear();   ds 是不是null?
      

  5.   

    是的,我找到错误了确实是ds.Tables["list1"].Rows.Clear();  ds是空值,谢谢了小高
      

  6.   


    if(ds!=null && ds.Tables.Count>0)
    {
       ds.Tables["list1"].Rows.Clear(); 
    }
      

  7.   

    调试一下,看看那个对象是null
      

  8.   

    请问怎样设置txtbox的enabled=false后的颜色,在什么地方设置?
      

  9.   

    textBox eanbled=false后,就改变不了颜色了,
    你用ReadOnly=true代替eanbled=false吧,这样用户既不能输入内容,你还可以改变textBox的颜色