---
title: "How to filter a dataview"  
description: "How to filter a dataview"  
author: "Takeshi Okada"  
published: 2013-09-04  
updated: 2013-09-04  
canonical: https://www.mindstick.com/forum/1455/how-to-filter-a-dataview  
category: "c#"  
tags: ["c#", "mindstick", "filter a dataview", "dataview", "c# control"]  
reading_time: 1 minute  

---

# How to filter a dataview

I have a [dataview](https://www.mindstick.com/blog/151/dataview-in-ado-dot-net) that contains a list of [tables](https://www.mindstick.com/articles/336597/introduction-of-html-tables-for-web-development). I am [reading](https://www.mindstick.com/articles/126273/books-commonly-found-on-college-reading-lists) in a list of [values](https://www.mindstick.com/forum/327/sum-textbox-values) that I then want to [apply](https://www.mindstick.com/articles/13148/discover-to-apply-make-up-like-a-professional-supermodel) as a [filter](https://www.mindstick.com/forum/1176/filter-in-a-xml-file-in-c-sharp) to this dataview. The list of values is actually in the [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) of "table1, table2, table3". So I thought I would be able to use this as a filter on my dataview.

SqlOp.CommandText = "[select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) from dbo.sysobjects where xtype='u'";

SqlOp.ExecuteDataReader();

DataView dv = SqlOp.GetDataAsDataView();

SqlOp.CloseConnection();

Returns a list of all the tables in a dataview. Any help on how to filter this dataview?

## Replies

### Reply by Sumit Kesarwani

Hi Takeshi,\

I figured out the .RowFilter issue:

dv.RowFilter = "name IN ('table1', 'table2', 'table3')


---

Original Source: https://www.mindstick.com/forum/1455/how-to-filter-a-dataview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
