可能由于DBX的数据是单向的,所以有些限制吧,帮助里是这么说的:
Reading RecordCount will generate an exception if the dataset can't determine the number of records. Do not read RecordCount if
??? The dataset represents stored procedure.(通过存储过程获得数据集时不能用)
??? The dataset represents a query that contains parameters.(query里带参数获得数据集时不能用)
??? The dataset represents a multi-table join.(多表关联查询时不能用)
我犯了第二种,直接使用sql字符串后问题解决;
另外,如果库里的表名是大写的,sql里也要大写,否则一样不能使用,字段名还没测试;
Reading RecordCount will generate an exception if the dataset can't determine the number of records. Do not read RecordCount if
??? The dataset represents stored procedure.(通过存储过程获得数据集时不能用)
??? The dataset represents a query that contains parameters.(query里带参数获得数据集时不能用)
??? The dataset represents a multi-table join.(多表关联查询时不能用)
我犯了第二种,直接使用sql字符串后问题解决;
另外,如果库里的表名是大写的,sql里也要大写,否则一样不能使用,字段名还没测试;