![]() |
datatable
so I have created a datatable in C#...
and i have used dataview.findrows() method to find rows that have say column3 entry equal to "s"... now I have all the rows that fit that criteria... now among those rows, i want to compare column4, column5, column6, column8 of these rows with an array of 4 words to see if any of those columns equal any of those words in the array.... now how do I do it? I mean do I do it all manually? or are there any sophisticated ways to do it? |
Maybe it is because it is 3am when I'm reading this, but could you try to make your question a little clearer?
|
Quote:
lol but let me try again... I have a datatable in C#.... you know findrows method? it returned me multiple rows which fit a criteria (say the criteria was column3 = "sk") ... now I have all the rows from the datatable that have column3 = "sk". Now I dont have a problem doing this so far. The problem arrives at next step.... now i have 4 strings (maybe stored in an array)... now I want to see whether any of these 4 strings match any of the strings stored in column4, column5, column6, column7 of the rows found using findrows method does the question make more sense now? |
Could you recurse the rows you found looking in each row for the string(s)?
|
Quote:
|
Okay, all in theory (not bothered to check this exactly) but...
findrows() returns a DataRowView (from what I can tell) so from that you could use something like (grammer is almost certainly wrong, because I'm putting it in pseudo code, not real C# code) :
foreach Row in DataRowView |
| All times are GMT -5. The time now is 2:59 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC