Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




DataView RowFilter with multiple conditions

Download Attachment

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;

Share this article   |    Print    |    Article read by 15698 times
Author:
Rohit kakria
I am software developer, moderator of xpode.com
Related Articles: No related article
Related Interview Questions: No related interview question