Gets all of the rows in the table, in order of addition.
[Visual Basic] Public ReadOnly Property All As DataRow () [C#] public DataRow[] All {get;} [C++] public: __property DataRow* get_All(); [JScript] public function get All() : DataRow[];
A DataRow array.
If you are using the All method to set the rows for a DataTable, be sure to use the DataTable object's NewRow method to create each DataRow. See the example below.
The following example gets and sets the All property.
[Visual Basic]
Private Sub SetRows() Dim arrRows() As DataRow Dim t As DataTable ' Get the DataTable of a DataGrid control. Set t = DataGrid1.DataGridTable.DataTable ' Create 10 new DataRow objects Dim i As Integer For i = 0 To 9 Set arrRows(i) = t.NewRow ' Code to set values not show. Next i Dim rows As New RowsCollection Set rows.All = arrRows End Sub Private Sub GetRows() Dim arrRows() As DataRow ' Get the DataTable of a DataGrid control. Dim t As DataTable Set t = DataGrid1.DataGridTable.DataTable Set arrRows = t.Rows.All ' Iterate though the array to get values. Dim i As Integer For i = 0 to Ubound(arrRows) Console.WriteLine(arrRows(i)(0)) Next i End Sub
RowsCollection Class | RowsCollection Members | System.Data Namespace | Add | DataRow | DataTable | NewRow