By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Q: DataRow in a ArrayList

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Geoff,

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

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
You're a genius! Thanks Cor

Geoff

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Geoff,

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

I hope this helps?

Cor

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.