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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top