asp.net.ph

DataRowView.Item Property

System.Data Namespace   DataRowView Class


Sets or retrieves a value of a specified column.

Overload List

1. Sets or retrieves a value of a specified column given the column name.

2. Sets or retrieves a value of a specified column given the column index.


Example

The following example displays the value in each item of each DataRowView in a DataView.

NOTE: This example uses one of the overloaded versions of the DataRowView.Item ( indexer ) property. For other examples that may be available, see the individual overload topics.

private static void WriteViewRows ( DataView dv ) {
   int colCount = dv.Table.Columns.Count;
   // iterate through the rows of the DataView.

   foreach ( DataRowView drv in dv ) {
      // display the value in each item of the DataRowView

     for ( int i = 0; i < colCount; i++ ) {
         Response.Write ( drv [ ] + "<br>" );
      }
      Response.Write ( );
   }
}
  C# VB

See Also

DataRowView Members 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