DataView.AddNew Méthode


Ajoute une nouvelle ligne au DataView.Adds a new row to the DataView.

 virtual System::Data::DataRowView ^ AddNew();
public virtual System.Data.DataRowView AddNew ();
abstract member AddNew : unit -> System.Data.DataRowView
override this.AddNew : unit -> System.Data.DataRowView
Public Overridable Function AddNew () As DataRowView


Nouvel objet DataRowView.A new DataRowView object.


L’exemple suivant utilise la méthode AddNew pour retourner un nouvel DataRowView qui a été ajouté au DataTable.The following example uses the AddNew method to return a new DataRowView that has been added to the DataTable.

private void AddNewDataRowView(DataView view)
    DataRowView rowView = view.AddNew();

    // Change values in the DataRow.
    rowView["ColumnName"] = "New value";
Private Sub AddNewDataRowView(view As DataView)
    Dim rowView As DataRowView = view.AddNew

    ' Change values in the DataRow.
    rowView("ColumnName") = "New value"
End Sub

S’applique à

Voir aussi