G
Guest
Hi there,
Before Generics I could iterate a DataView in this way:
using System.Collections;
private IEnumerator mIterator;
mIterator = mDataview.GetEnumerator();
mIterator.MoveNext();
DataRow mDatarow = ((DataRowView)mIterator.Current).Row;
Now with Generics I'm trying this:
using System.Collections.Generic;
private IEnumerator<DataRowView> mIterator;
But, in this line:
mIterator = mDataview.GetEnumerator();
I get this error:
Cannot implicitly convert type 'System.Collections.IEnumerator' to
'System.Collections.Generic.IEnumerator<System.Data.DataRowView>'. An
explicit conversion exists (are you missing a cast?)
What am I doing wrong? Is it the GetEnumerator() method that is not fully
compatible with the new Generics IEnumerator?
Thanks in advance,
-Benton
Before Generics I could iterate a DataView in this way:
using System.Collections;
private IEnumerator mIterator;
mIterator = mDataview.GetEnumerator();
mIterator.MoveNext();
DataRow mDatarow = ((DataRowView)mIterator.Current).Row;
Now with Generics I'm trying this:
using System.Collections.Generic;
private IEnumerator<DataRowView> mIterator;
But, in this line:
mIterator = mDataview.GetEnumerator();
I get this error:
Cannot implicitly convert type 'System.Collections.IEnumerator' to
'System.Collections.Generic.IEnumerator<System.Data.DataRowView>'. An
explicit conversion exists (are you missing a cast?)
What am I doing wrong? Is it the GetEnumerator() method that is not fully
compatible with the new Generics IEnumerator?
Thanks in advance,
-Benton