System.Data Namespace DataRowView Class
Sets or retrieves a value in a specified column given the column index.
Object variable = DataRowView.Item [ index ];
... or ...
Object variable = DataRowView [ index ];
dim variable as Object = DataRowView.Item ( index )
... or ...
dim variable as Object = DataRowView ( index )
variable : Object = DataRowView.Item ( index );
... or ...
variable : Object = DataRowView ( index ); |
|
C# |
VB |
JScript |
- index
- The index number of a DataColumn to set or get a value.
The value of the column.
The following example displays the value in each item of each DataRowView in a DataView.
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>" );
}
}
}
Private Shared Sub WriteViewRows ( dv As DataView )
Dim colCount As Integer = dv.Table.Columns.Count
' iterate through the rows of the DataView.
Dim drv As DataRowView
For Each drv In dv
' display the value in each item of the DataRowView
Dim i As Integer
For i = 0 To colCount
Response.Write ( drv ( i ) & "<br>" )
Next
Next
End Sub |
|
C# |
VB |
DataRowView Members DataRowView.Item Overload List