NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

RowsCollection.All

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[];

Property Value

A DataRow array.

Remarks

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.

Example [Visual Basic]

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

See Also

RowsCollection Class | RowsCollection Members | System.Data Namespace | Add | DataRow | DataTable | NewRow