Q: DataRow in a ArrayList

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
G

Geoff Jones

Hi

I have placed some DataRows in an ArrayList e.g.

Dim myArrayList As ArrayList

For Each row As DataRow In drMyData
myArrayList.Add(row)
Next

How do I retrieve a certain row item from the array list? That is, if one of
the DataRows has a field called "Name", how could I get, for example, the
name in the first data row?

I tried something like:

Dim theName As String = myArrayList(0).Item("Name")

but I got an error message saying:

Option Strict On disallows late binding

I take it I need some kind of cast?

Thanks in advance

Geoff
 
Hi Geoff,

Typed here quick and dirty
\\
Dim theName As String =
DirectCast(myArrayList(0),DataRow).Item("Name").ToString
///

I hope this helps?

Cor
 
Back
Top