Share via


EntityDataSource.EnableInsert 属性

定义

获取或设置一个值,该值指示是否可以通过 EntityDataSource 控件添加对象。

public:
 property bool EnableInsert { bool get(); void set(bool value); };
public bool EnableInsert { get; set; }
member this.EnableInsert : bool with get, set
Public Property EnableInsert As Boolean

属性值

如果启用了自动插入操作,则为 true;否则为 false。 默认值是 false

实现

注解

Select 如果 EnableInsert 属性设置为 ,则无法设置 true

false分配给 EnableInsert 上的 EntityDataSource 属性的值强制CanInsert相关EntityDataSourceView对象的 属性返回 false。 当 属性EnableInsert设置为 false时,NotSupportedException如果数据绑定控件调用 上的 方法,ExecuteInsertEntityDataSourceView则会引发 。

如果不满足任何可更新性条件,并且 属性 EnableInsert 设置为 true,则会 EntityDataSource 引发异常。

适用于