本帖最后由 fandong854 于 2010-01-28 09:49:15 编辑

解决方案 »

  1.   

    在数据库里面执行 的查询语句:
    select * from goods where goodsname='Speaker.Text的值'   
    看看这个SQL语句能否查询出数据来 。如果数据库直接查询都没有数据,那就是没有数据了。此外,为保证你程序的正常你可以先判断处理一下:
    比如: DataTable dt = new DataTable(); 
                ada.Fill(dt); 
                if(dt.Row.Count>0)
                 textBox32.Text = dt.Rows[0]["goodsamout"]==null?string.Empty:dt.Rows[0]["goodsamout"].ToString(); 
     con.Close();
      

  2.   

     if(dt.Row.Count>0) ==> if(dt.Rows.Count>0)