timmyzx7r
asked on
Casting type of enumerators
Hello experts,
An easy question I should know. What or how does this need to be casted with Option Strict on?
Console.WriteLine(myEnum.C urrent.Row .Item("Bas icInfoID") )
I thought Enums where int16 varible types but I am having a hard time casting it.
Thanks,
-Tim
The commented lines ('***) are the solution I had to use because I can not cast.
Dim myEnum As IEnumerator = ds.Tables("utblBasicInfo") .DefaultVi ew.GetEnum erator()
'***Dim dv As DataRowView
'***Dim dr As DataRow
While myEnum.MoveNext
Console.WriteLine(myEnum.C urrent.Row .Item("Bas icInfoID") )
'Console.WriteLine(CType(m yEnum.Curr ent.Row.it em("BasicI nfoID"), Int16))
'***dr = CType(myEnum.Current, DataRowView).Row
'***dr.Item("Status") = "Expired"
'***Console.WriteLine(dr.I tem("Basic InfoID"))
'***Console.WriteLine(dr.I tem("Statu s"))
End While
An easy question I should know. What or how does this need to be casted with Option Strict on?
Console.WriteLine(myEnum.C
I thought Enums where int16 varible types but I am having a hard time casting it.
Thanks,
-Tim
The commented lines ('***) are the solution I had to use because I can not cast.
Dim myEnum As IEnumerator = ds.Tables("utblBasicInfo")
'***Dim dv As DataRowView
'***Dim dr As DataRow
While myEnum.MoveNext
Console.WriteLine(myEnum.C
'Console.WriteLine(CType(m
'***dr = CType(myEnum.Current, DataRowView).Row
'***dr.Item("Status") = "Expired"
'***Console.WriteLine(dr.I
'***Console.WriteLine(dr.I
End While
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Enumerators only allow reading the data in the collection. Enumerators cannot be used to modify the underlying collection