Tuesday 20 June 2017

Filtering DataSet Based On Column Values In C#

Filtering DataSet Based On Column Values In C#

Description:

In this example we explain that how to Filtering Dataset based on Column Values in C#.or how to get filtered data from dataset and bind it to GridView in asp.net using C#.suppose you have list of the customers and you want to get only customers that have city equals to Ahmedabad and bind all this customers to the GridView then below is the code to get the filtered customers from the dataset.
Code:

ds.Tables[0].DefaultView.RowFilter = "City = Ahmedabad";  
       GridView1.DataSource = ds.Tables[0].DefaultView;  
      GridView1.DataBind();


0 comments:

Post a Comment