473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Q: DataRow in a ArrayList

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
2 4101
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: sdettmers | last post by:
Hi, Database: SQL Server Session: SQL Server Language: C# Application: ASP.Net I have created a login page which attempts to retrieve the users record from the database and I...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
6
by: JIM.H. | last post by:
Hello I have; DataRow dr= dataSet11.myTable.NewRow(); And I am filling the fields of this datarow. Now I need to create a copy of this row as drCopy and change a few fields and add both to...
3
by: DBC User | last post by:
I would like to delete a row from a dataset based on a condition. Here is what I am doing foreach(row in table1) { string key = row; foreach(row1 in table2) { if...
8
by: Niron kag | last post by:
Hi, I have a loop an in the loop I populate an array of dataRow. My problem is the array keeps its values from previous loop, and its Length gets bigger every loop. My code is: DataRow...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
1
by: Eugene Anthony | last post by:
BlogListing.aspx ---------------- <table width="786"> <asp:Repeater ID="rptComments" runat="server"> <ItemTemplate> <tr> <td bgcolor="#eaeaea"><%# Eval("SenderID") %></td> </tr> <tr>
2
by: Mr. Arnold | last post by:
I am working a C# project that uses what's in the subject. I kind of have the basics down on reading the table data. I don't use the above methods of data access or persistence, but I am stuck...
9
by: myotheraccount | last post by:
Hello, Is there a way to convert a DataRow to a StringArray, without looping through all of the items of the DataRow? Basically, I'm trying to get the results of a query and put them into a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.