MSFanboy
asked on
How can I find out the the rows filtered by the dataview.Rowfitler ?
Hello,
when I set a dataview with a Rowfilter, can I find out somehow what is the filtered data?
my table:
id.Name
1 mary
2 michael
3 hans
4 georg
my filter:
dataview.Rowfilter = " Name = ' michael ' ";
How can I retrieve the other 3 names without using the Rowfilter again like this:
dataview.Rowfilter = " Name <> 'michael';
HOpe the question is clear :)
when I set a dataview with a Rowfilter, can I find out somehow what is the filtered data?
my table:
id.Name
1 mary
2 michael
3 hans
4 georg
my filter:
dataview.Rowfilter = " Name = ' michael ' ";
How can I retrieve the other 3 names without using the Rowfilter again like this:
dataview.Rowfilter = " Name <> 'michael';
HOpe the question is clear :)
ASKER
ah bad I told you crap...
requirements have changed actually again:
I want to enumerate through the dataview to get the each value in every row in the filtered dataview.
foreach (DataRowView row in dataview)
{
row.value doesnt work
row.Row[3]. doesnt work // I want to get the value in the 4th column of the actual row of my dataview
}
How can I enumerate through all Rows of the dataview and get a value of each row in a certain column?
I have to compare the one value in a dataview`s [row,column] with the value of a datareader...
requirements have changed actually again:
I want to enumerate through the dataview to get the each value in every row in the filtered dataview.
foreach (DataRowView row in dataview)
{
row.value doesnt work
row.Row[3]. doesnt work // I want to get the value in the 4th column of the actual row of my dataview
}
How can I enumerate through all Rows of the dataview and get a value of each row in a certain column?
I have to compare the one value in a dataview`s [row,column] with the value of a datareader...
ASKER
I also tried this:
foreach (DataRowCollection row in dataview.Table.Rows)
{
row. // no value or cell I get :/
}
foreach (DataRowCollection row in dataview.Table.Rows)
{
row. // no value or cell I get :/
}
ASKER
for (int j = 0; i < dataview.Count; i++)
{
var articlenumber = dataview[j].Row[3].ToStrin g();
}
found a sample in vb and changed it to c#, pretty stupid that there is no Row.Value or Cell.Value as someone could expect it.
{
var articlenumber = dataview[j].Row[3].ToStrin
}
found a sample in vb and changed it to c#, pretty stupid that there is no Row.Value or Cell.Value as someone could expect it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ah damn above I have a for loop with i or j, thx that you saw the error and for the snippet
or
Create a second dataview and create the opposite filter on that instead.