DevExpress 报表数据绑定报错 no suitable object was found in this project to be used as a data source. before running the wizard again,please make sure that the project contains an
1、数据绑定报错:
选择 DataSource ,添加数据源,选择Object类型
no suitable object was found in this project to be used as a data source. before running the wizard again,please make sure that the project contains an appropriate data source class,close the designer and rebuild the solution.
2、问题原因:Dev内部问题。
3、解决方案:
1)Dev 升级,更换版本。 从2.2.6升级到2.2.7
https://supportcenter.devexpress.com/ticket/details/t831046/objectdatasource-the-no-suitable-object-was-found-error-is-shown-when-editing-the-bound#hotfixes
(以后有问题,一定要去论坛,有很多经验教训,Dev官方人员也在论坛)
2)教训:
搞了1天:
* 添加 .vsrepx 类 无效;
*卸载Dev,重装,无效;
*重启电脑,无效;
*相同Dev版本的一个老项目中测试绑定数据,有效!
*新建dev项目,有效。引入3个自己的程序集(model、),报错!(一直以为是自己程序问题,浪费大量时间,没想到最后还是Dev内部问题!)
5、伴随错误:
*打开Visual Studio 2022时,设计页 ( .vsrepx) 如果是打开的,不显示,关闭后重新开启才能编辑。
*运行报错:
An object assigned to the DataSource property cannot be used as a report's datasource, because it does not implement any of supported interfaces.
For more information, refer to https://docs.devexpress.com/XtraReports/1179.
*Visual Studio 2022提示:
一次强制关机(没有提前关闭Visual Studio 2022),之后出现这个问题,以为与强制关机有关,但更换版本后测试强制关机,没有问题。