当启用删除,插入或更新操作时,LinqDataSource不支持Select属性 [英] LinqDataSource does not support the Select property when the Delete, Insert or Update operations are enabled
问题描述
在单击 GridView
控件中的删除按钮/链接时出现此错误。
I am getting this error when clicking the Delete button / link in a GridView
control.
当
启用删除,插入或更新操作时,LinqDataSource [DataSource]不支持Select属性
LinqDataSource [DataSource] does not support the Select property when the Delete, Insert or Update operations are enabled
<我真的不明白为什么我得到这个错误,因为我已经在我的网站的不同网页上做了同样的事情,但是在那种情况下从中读取数据的表没有任何外键,这个呢。这是为什么我得到错误?
I don't really understand why I'm getting this error because I have already done the same thing on a different webpage in my site, however the table that the data is read from in that case does not have any foreign keys, this one does. Is that why I am getting the error?
如果它很重要, AutoGenerateDeleteButton
属性设置为 True
,我使用 linqdatasource
从数据库中检索数据。
If it matters, the AutoGenerateDeleteButton
property is set to True
and I am using a linqdatasource
to retrieve the data from the database.
推荐答案
最后我不得不选择所有的数据(使用*选项在DataSource向导中),然后删除我不想在GridView中显示的列。这可能有点低效,但它工作。
In the end I had to select all of the data (using the * option in the DataSource wizard), then remove the columns that I didn't want to display in the GridView. This might be a little inefficient, but it worked.
这篇关于当启用删除,插入或更新操作时,LinqDataSource不支持Select属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!