DATAVIEW

F

Francois

Hi folks,

I have a DataTable from which i want to filter out some records. For that I
create a view and I apply a first set of filter condition.
Later in my processing, I would like to use that view again to apply a
second set of filter condition. But i don't see any constructor for the
DataView object that takes a DataView in parameter instead of a DataTable.

Then my question is how can I apply a second set of condition on a DataView
to get an other DataView?
Or do I need to create a filter including both criterias and apply it on the
original DataTable?

Also an other question. Can I have filter critaria including date as well as
date manipulation like I would do in a WHERE clause of an SQL statement on
SQLServer 2000. I am thinking of using DATEADD ( datepart , number, date ).
Is that possible? Or the only possible filter is just string filtering?


Thanks a lot,

Francois
 
M

Miha Markic [MVP C#]

HI Francois,

Francois said:
Hi folks,

I have a DataTable from which i want to filter out some records. For that
I
create a view and I apply a first set of filter condition.
Later in my processing, I would like to use that view again to apply a
second set of filter condition. But i don't see any constructor for the
DataView object that takes a DataView in parameter instead of a DataTable.

Then my question is how can I apply a second set of condition on a
DataView
to get an other DataView?
Or do I need to create a filter including both criterias and apply it on
the
original DataTable?

Yes, this is the way.
Also an other question. Can I have filter critaria including date as well
as
date manipulation like I would do in a WHERE clause of an SQL statement on
SQLServer 2000. I am thinking of using DATEADD ( datepart , number,
date ).
Is that possible? Or the only possible filter is just string filtering?

See DataColumn.Expression help topic to find out how can you filter data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top