Xpode.com        Click here to Print this article.

DataView RowFilter with multiple conditions

In Some conditions we need to apply some condition on dataset in code behind. To apply condition on dataset we need to convert dataaset in Dataview.

Steps:
Create a object of dataview
Put dataset to data view
Apply rowfilter

We will take an example of Apply multiple conditions on dataview

Suppose we want to show only those rows which have status=Active or Inactive. We will apply below code

ds - is dataset having rows
dlTour is data list

				
DataView dv = new DataView();
dv = ds.Tables[0].DefaultView;
dv.RowFilter = " Status='Active' or Status='InActive'";
dlTour.DataSource = dv;



http://
http://

Contributed by:
Rohit kakria
I am software developer, moderator of xpode.com

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=311

Click here to go on website