Paladin Consultants, LLC

"Good Information is just good business"

JA slide show
Home Resources .NET Programming Guide
Print E-mail

DataRow Class Members

Properties

Visibility

Name

Value Type

Accessibility

 

 

 

 

public

HasErrors

Boolean

[ Get ]

 

 

 

 

public

Item ( Int32 columnIndex ) ( DataRowVersion version )

Object

[ Get ]

 

 

 

 

public

Item ( DataColumn column )

Object

[ Get , Set ]

 

 

 

 

public

Item ( DataColumn column ) ( DataRowVersion version )

Object

[ Get ]

 

 

 

 

public

Item ( String columnName ) ( DataRowVersion version )

Object

[ Get ]

 

 

 

 

public

Item ( Int32 columnIndex )

Object

[ Get , Set ]

 

 

 

 

public

Item ( String columnName )

Object

[ Get , Set ]

 

 

 

 

public

ItemArray

Object

[ Get , Set ]

 

 

 

 

public

RowError

String

[ Get , Set ]

 

 

 

 

public

RowState

DataRowState

[ Get ]

 

 

 

 

public

Table

DataTable

[ Get ]



Methods

February 11, 2008

Visibility

Name

Parameters

Return Type

 

 

 

 

public

AcceptChanges

( )

Void

 

 

 

 

public

BeginEdit

( )

Void

 

 

 

 

public

CancelEdit

( )

Void

 

 

 

 

public

ClearErrors

( )

Void

 

 

 

 

public

Delete

( )

Void

 

 

 

 

public

EndEdit

( )

Void

 

 

 

 

public

GetChildRows

( String relationName )

DataRow

 

 

 

 

public

GetChildRows

( String relationName , DataRowVersion version )

DataRow

 

 

 

 

public

GetChildRows

( DataRelation relation , DataRowVersion version )

DataRow

 

 

 

public

GetChildRows

( DataRelation relation )

DataRow

 

 

 

 

public

GetColumnError

( Int32 columnIndex )

String

 

 

 

 

public

GetColumnError

( String columnName )

String

 

 

 

 

public

GetColumnError

( DataColumn column )

String

 

 

 

 

public

GetColumnsInError

( )

DataColumn

 

 

 

 

public

GetParentRow

( String relationName , DataRowVersion version )

DataRow

 

 

 

 

public

GetParentRow

( String relationName )

DataRow

 

 

 

 

public

GetParentRow

( DataRelation relation , DataRowVersion version )

DataRow

 

 

 

 

public

GetParentRow

( DataRelation relation )

DataRow

 

 

 

 

public

GetParentRows

( DataRelation relation , DataRowVersion version )

DataRow

 

 

 

 

public

GetParentRows

( DataRelation relation )

DataRow

 

 

 

 

public

GetParentRows

( String relationName , DataRowVersion version )

DataRow

 

 

 

 

public

GetParentRows

( String relationName )

DataRow

 

 

 

 

public

HasVersion

( DataRowVersion version )

Boolean

 

 

 

 

public

IsNull

( String columnName )

Boolean

 

 

 

 

public

IsNull

( DataColumn column , DataRowVersion version )

Boolean

 

 

 

 

public

IsNull

( DataColumn column )

Boolean

 

 

 

 

public

IsNull

( Int32 columnIndex )

Boolean

 

 

 

 

public

RejectChanges

( )

Void

 

 

 

 

public

SetColumnError

( Int32 columnIndex , String error )

Void

 

 

 

 

public

SetColumnError

( DataColumn column , String error )

Void

 

 

 

 

public

SetColumnError

( String columnName , String error )

Void

 

 

 

 

public

SetParentRow

( DataRow parentRow , DataRelation relation )

Void

 

 

 

 

public

SetParentRow

( DataRow parentRow )

 

The DataSet is a much more powerful and complicated object than the DataReader. The DataReader is a read-only forward-only object wherein once a record is read it is gone, unless it is saved into an array. The DataSet and DataTable objects are virtualls datasets and tables which are used in client-side operations. Though there is no ‘current record’ concept, the user is able to navigate between the rows using loops, either using the Rows collection of the DataTable object, or the DataRow object.

 

For i=1 to 3

tblEmployee.Rows(i)(“FirstName”)=”Daffy”

or

dim dr as DataRow=tblEmployee.Rows(i)

dr(“LastName”)=”Duck”

Next

Don’t forget that the DataSet is disconnected from the original server-side source of the data. So any changes in the DataSet will not be reflected in the source unless and until the DataSet and the Source are reconciled. You can find the status of any record by querying the RowState property of the DataRow object. The result will be one of the following: Detached, Added, Modified, Deleted, or Unchanged. Though the RowState property is read only, the DataRow has two properties which can change it: the AcceptChanges, and RejectChanges Properties.

Of further note are the DataTable.ColumnChanging, the DataTable.ColumnChanged, the DataTable.RowChanging, and the DataTable.RowChanged events which allow you to trap and code for these events within your code.

The DataView Object

The function of the DataView object is to facilitate data binding of data to Windows forms and web pages. Additionally, it can be used along with the Select method od the DataTable Object to present subsets of records from tables. Use the RowFilter property to select which records are visible, and use the Sort property to order their presentation.

 


 
Bookmark and Share