DataView.AllowNew Propiedad
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece un valor que indica si las nuevas filas se pueden agregar con el método AddNew().
public:
property bool AllowNew { bool get(); void set(bool value); };
public bool AllowNew { get; set; }
[System.Data.DataSysDescription("DataViewAllowNewDescr")]
public bool AllowNew { get; set; }
member this.AllowNew : bool with get, set
[<System.Data.DataSysDescription("DataViewAllowNewDescr")>]
member this.AllowNew : bool with get, set
Public Property AllowNew As Boolean
true
si las nuevas filas se pueden agregar; si no, false
.
- Atributos
En el ejemplo siguiente se establece la AllowNew propiedad en true antes de agregar una nueva fila con el AddNew método .
private void AddNew()
{
DataTable table = new DataTable();
// Not shown: code to populate DataTable.
DataView view = new DataView(table);
view.AllowNew = true;
DataRowView rowView = view.AddNew();
rowView["ProductName"] = "New Product Name";
}
Private Sub AddNew()
Dim table As New DataTable()
' Not shown: code to populate DataTable.
Dim view As New DataView(table)
view.AllowNew = True
Dim rowView As DataRowView
rowView = view.AddNew
rowView("ProductName") = "New Product Name"
End Sub
Produto | Versións |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Comentarios de .NET
.NET é un proxecto de código aberto. Selecciona unha ligazón para ofrecer comentarios: