在插入、更新或删除操作期间未在实体上找到属性?
我有一个绑定到 EntityDataSource 的 GridView。大多数列都是普通绑定列,但有两列是项目模板。当我尝试删除其中一行时,我收到以下消息:
“在插入、更新或删除操作期间,在实体上找不到名为“Building1.building_name”的属性。请检查以确保指定为绑定表达式的属性可用于数据源。”
我不确定这怎么可能不可用,因为当我刚刚查看时它显示的元素很好 - 当我尝试删除一行时它只会抛出错误?
I have a GridView that is tied to an EntityDataSource. Most columns are normal bound columns, but two are itemtemplates. When I attempt a delete on one of the rows I receive the following message:
"A property named 'Building1.building_name' was not found on the entity during an insert, update, or delete operation. Check to ensure that properties specified as binding expressions are available to the data source."
I'm not sure how it is possible that this isn't available, since it displays the element just fine when I'm just viewing - it just throws the error when I attempt deleting a row?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实体模型上的绑定表达式似乎区分大小写。因此,根据我的经验,
Bind("field")
与Bind("Field")
不同。换句话说,在手动输入这些表达式时,请检查您的模型是否存在正确的情况。
希望这对其他访问相同问题的人有所帮助。
Binding expressions on the entity model seem to be case sensitive. So, from my experience
Bind("field")
is not the same asBind("Field")
.In other words, check your model for the right case when manually typing out these expressions.
Hope this is helpful for others visiting regarding the same problem.