Click here to Skip to main content
15,843,623 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
I have a big datatable which I make an operation on it to filter it.
After the filteration process, I need the row which accept my condition to be inserted in to a new datatable to be used next.

And now I have a problem with the syntax to do that.

So, any help please?

Thanks
Posted
Updated 22-Aug-11 23:30pm
v2
Comments
version_2.0 23-Aug-11 4:42am    
write the code..

1 solution

If you are filtering your table with DataTable.Select, it will return the DataRow[]
Later you can use DataTable.ImportRow[^]
C#
foreach (DataRow row in rowArray) {
   myDataTable.ImportRow(row);
}
 
Share this answer
 
Comments
version_2.0 23-Aug-11 4:50am    
my 5..
moon2011 23-Aug-11 5:25am    
thanks alot for your help. But can i make the in the select statment dynamic variable????
Prerak Patel 23-Aug-11 5:43am    
Sorry, not clear to me.
moon2011 23-Aug-11 6:03am    
DataRow[] result = ItemProperties.Select("Country = 'London' AND PropertyType = 'test' ");

this the code, right?
i want to pass variables instead of the static values that i made.
So, Can you help me????
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900