asp.net.ph

DataTable.Select Method ( )

System.Data Namespace   DataTable Class


Returns an array of all DataRow objects.

[ VB ]
Overloads Public Function Select ( ) As DataRow ( )

[ C# ]
public DataRow [ ] Select ( );

[ C++ ]
public: DataRow* Select ( ) [ ];

[ JScript ]
public function Select ( ) : DataRow [ ];

Return Value

An array of DataRow objects.

Remarks

The method returns the current rows in order of primary key ( or lacking one, order of addition. )

Example

The following example returns an array of DataRow objects through the Select method.

private void GetRows ( ) {
   // get the DataTable of a DataSet.
   DataTable myTable = myDataSet.Tables [ "Suppliers" ];
   DataRow [ ] foundRows = myTable.Select ( );

   // print the value of one column of each DataRow.
   for ( i = 0; i < foundRows.Length; i++ ) {
      Response.Write ( foundRows [ ] [ "CompanyName" ] )
   }
}
  C# VB

See Also

DataTable Members   DataTable.Select Overload List   CaseSensitive   DataRow Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph