Pages

Saturday 4 June 2011

How to work with DataView class?

0 comments
 
Hi friends,in this post i would like to explain about DataView class.

* DataView is a part of DataSet.
* Select statements can't be issued on dataset,to get the required data.
* DataView class will be used to filter the data from dataset based on a condition.
* DataView has a property RowFilter,which is used to filter the data.

Syntax to create DataView:

DataView dtv=dts.Tables["employee"].Defaultview;

Note:

Where dts=dataset.

Syntax for RowFilter:

dtv.RowFilter="Columnname=value";

For Example:

dtv.RowFilter="employeeNo=101";


Thank you.
Shout it

Leave a Reply