Advertise with us

How to filter a dataview

Posted by  Takeshi Okada
 1570  View(s)
Rate this:

I have a dataview that contains a list of tables. I am reading in a list of values that I then want to apply as a filter to this dataview. The list of values is actually in the form of "table1, table2, table3". So I thought I would be able to use this as a filter on my dataview.

SqlOp.CommandText = "select name from dbo.sysobjects where xtype='u'";


DataView dv = SqlOp.GetDataAsDataView();


Returns a list of all the tables in a dataview. Any help on how to filter this dataview?

  1. Re: How to filter a dataview

    Hi Takeshi,

    I figured out the .RowFilter issue:

    dv.RowFilter = "name IN ('table1', 'table2', 'table3')