请问,StorageDataSet的masterlink属性怎么使用?我每次用都会抛一个异常:com.borland.dx.dataset.DataSetException: null DataSet is a detail that uses delayed detail fetching.  Query property must have a parametized where clause.
com.borland.dx.dataset.DataSetException: FetchAsNeeded cannot be set on MasterLinkDescriptor on a DataSetView.
为什么?

解决方案 »

  1.   

    Query property must have a parametized where clause好像是要求在 sql 语句的 where 部门加上参数
      

  2.   

    谢谢哟!我还没找到FetchAsNeeded属性,所以还没做成功,呵呵……
    再问你个问题啊,怎么设置可以是JdbComboBox可编辑。谢谢!
      

  3.   

    Load.AS_NEEDED改成Load.ALL,比如:queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1,
        sqlRes.getString("employee"), null, true, Load.ALL));已回复你dbcombobox的帖子
      

  4.   

    我的Query语句就是queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1,
        sqlRes.getString("employee"), null, true, Load.ALL));
    我没有用Load.AS_NEEDED。
    我看你跟我说的后,也试图把Load.ALL改为Load.AS_NEEDED用,可还是不行。
      

  5.   

    还是报的com.borland.dx.dataset.DataSetException: gg_Employ DataSet is a detail that uses delayed detail fetching.  Query property must have a parametized where clause.异常。
    用Load.UNCACHED也是抛同一个异常。
      

  6.   

    Load.ASYNCHRONOUS时,也抛同一个异常。
    是不是我的别的代码影响了它?别的我就是设置了,queryDataSet1的该列的pickList属性,具体为:
     column13.setPickList(new com.borland.dx.dataset.PickListDescriptor(
            dataSetEmploy, new String[] {"EMPOLYNAME"}, new String[] {"EMPOLYNAME"},
            new String[] {"EMPOLYNAME"}, null, false));
        column13.setRowId(true);
    queryDataSet1的setMetaDataUpdate(all)这个属性我没设置,直接是默认的,如果将.setMetaDataUpdate()设置为
    setMetaDataUpdate(MetaDataUpdate.TABLENAME +
                      MetaDataUpdate.PRECISION +
                      MetaDataUpdate.SCALE +
                      MetaDataUpdate.SEARCHABLE);也不行。为什么呢?
      

  7.   

    还是觉得sql 语句有错把主要的源码贴出来吧
      

  8.   


        queryDataSetCheckWork.setQuery(new QueryDescriptor(dataModule.getDatabase1(), "SELECT (SELECT EmpolyName FROM gg_Employ WHERE EmployID = gz_CheckWork.EmpolyID) " +
            "as EmpolyID,\n\tCheckWorkDate,\n\t(SELECT CheckTypeName FROM gz_CheckType " +
            "WHERE CheckTypeID = gz_CheckWork.CheckTypeID) as CheckTypeID,\n\tCheckPay,Res " +
            "FROM gz_CheckWork ", null, true, Load.ALL));
        column1.setPickList(new com.borland.dx.dataset.PickListDescriptor(
            dataSetEmploy, new String[] {"EMPLOYID"}, new String[] {"EMPLOYID",
            "EMPOLYNAME"}, new String[] {"EMPOLYID"}, null, false));    column3.setPickList(new com.borland.dx.dataset.PickListDescriptor(
            dataSetCheckType, new String[] {"CHECKTYPEID"},
            new String[] {"CHECKTYPEID", "CHECKTYPENAME"},
            new String[] {"CHECKTYPEID"}, null, false));
      

  9.   

    SELECT (SELECT EmpolyName FROM gg_Employ WHERE EmployID = gz_CheckWork.EmpolyID) as EmpolyID,\n\tCheckWorkDate,\n\t(SELECT CheckTypeName FROM gz_CheckType WHERE CheckTypeID = gz_CheckWork.CheckTypeID) as CheckTypeID,\n\tCheckPay,Res FROM gz_CheckWork
    这条sql肯定运行不了……