改成这样访问:DBAccess dba = new test.db.DBAccess();
ds = dba.Query("select ProductID,ProductName from Products");
int aa = ds.Tables[0].Rows.Count;
TextBox1.Text = ds.Tables[0].Rows[0][0].ToString();
不然你的test.db.DBAccess组件这样改:
public DataSet Query(string sqlstr,string TableName)
{
  ...
  SqlDataAdapter.Fill(DataSetName,DataTableName);
  return DataSetName;
}
然后才调用 
ds = dba.Query("select ProductID,ProductName from Products","Products");
int aa = ds.Tables["Products"].Rows.Count;
TextBox1.Text = ds.Tables["Products"].Rows[0][0].ToString();