Alright now the question may come to you vague so I will try to explain as much as possible.
For example I have 10 columns and 5000 rows in a data table called tblNpc.
So I will make a lot of filtering on this table during the work. I am using this approach here, but is that the best way of handling it?
Here a small example
string srQuery = "select * from tblNpc";
DataSet dsNPC = DbConnection.db_Select_Query(srQuery);
DataView dvNPC = new DataView(dsNPC.Tables[0]);
dvNPC.RowFilter = "npcId=32";
string srExampleData = dvNPC[0]["npcName"].ToString();
C# 4.0, SQL Server 2008 R2
Important: I will use entire table and will do filtering equal to entire table row count
As per
@Andormar'scomments, it would be quicker if youhand over the filtering job to the SQL Server, which is designed to do the job, in the first place andbring over only what you needed.If you need to work with the DataTable in the code behind, then
LINQ would be quicker I think. On top of that you could do complex queries with your DataTable with LINQ rather than RowFilter.For example your query can be done as