G
Guest
Hi, I'd like to use a typed row to iterate through a DatarowView array. I've
used a view for its FindRows method.
How (or where) can I cast this so that the rows & rowViews will work
together. I've tried converting them in various places without success:
Thanks for any ideas. I can use an untyped in the loop but I'm sure this
must be able to be done.
Ant
// Tried converting here with no success
DataView dv = new DataView(dsMaster.Customers);
dv.Sort = "City";
DataRowView[] dr = dv.FindRows("London");
// Doesn't like this. Tried converting here as well
foreach (dsMaster.CustomersRow cr in dr)
{
MessageBox.Show(cr.City.ToString());
}
used a view for its FindRows method.
How (or where) can I cast this so that the rows & rowViews will work
together. I've tried converting them in various places without success:
Thanks for any ideas. I can use an untyped in the loop but I'm sure this
must be able to be done.
Ant
// Tried converting here with no success
DataView dv = new DataView(dsMaster.Customers);
dv.Sort = "City";
DataRowView[] dr = dv.FindRows("London");
// Doesn't like this. Tried converting here as well
foreach (dsMaster.CustomersRow cr in dr)
{
MessageBox.Show(cr.City.ToString());
}