Home > Asp.net > Using Dataview RowFilter (Syntax) in Asp.net C#

Using Dataview RowFilter (Syntax) in Asp.net C#


Lets say we have a datatable, we want to select rows that meet certain criteria, then we can use Dataview.Rowfilter.

For example we have a datatable having empid column, we want the row whose empid is 8.

dataView.RowFilter = "empid = 8";

Other examples are
dataView.RowFilter = "EmpName = 'Pankaj'" ;
dataView.RowFilter = "Date = #12/08/2000#" ;

Comparision
dataView.RowFilter = "Date>=" + "#" + startdate + "#" +
"And Date <=" + "#" + enddate + "#";
You can find other examples at:
http://www.csharp-examples.net/dataview-rowfilter/
About these ads
  1. March 2, 2010 at 7:58 pm | #1

    After reading you site, Your site is very useful for me .I bookmarked your site!
    I am been engaged 10 years on the Free finance personal software If you have some questions, please get in touch with me.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: