Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,006 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,349 people online right now. Registration is fast and FREE... Join Now!




storing data in ArrayList after loading from MS Access

 
Reply to this topicStart new topic

storing data in ArrayList after loading from MS Access

soma2008
25 Mar, 2008 - 08:44 AM
Post #1

New D.I.C Head
*

Joined: 25 Mar, 2008
Posts: 1

Attached File  code.txt ( 464bytes ) Number of downloads: 72
hi
i m new to C#. i ve to store data in arraylists after loading it from database.
looking for help. Anyone out there smile.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Storing Data In ArrayList After Loading From MS Access
25 Mar, 2008 - 08:54 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Can you post the code you're using, most people, including myself, will not download a random file from someone they dont know.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Storing Data In ArrayList After Loading From MS Access
25 Mar, 2008 - 09:07 AM
Post #3

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,917



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
An ArrayList has an Add method. So you simply add a new item to your ArrayList using this method.

Since you didn't post what your textfile looks like, then I made an assumption that you only had one piece of information per line read. You can use the GetString method by specifying a column number, in this case 0 (if you only have one column of information being returned).
CODE

while(rd.Read())
{
    items.Add(rd.GetString(0));
    j++;
}

User is online!Profile CardPM
+Quote Post

akss
RE: Storing Data In ArrayList After Loading From MS Access
5 Jun, 2008 - 06:50 AM
Post #4

New D.I.C Head
*

Joined: 5 Jun, 2008
Posts: 1

QUOTE(soma2008 @ 25 Mar, 2008 - 09:44 AM) *

Attached File  code.txt ( 464bytes ) Number of downloads: 72
hi
i m new to C#. i ve to store data in arraylists after loading it from database.
looking for help. Anyone out there smile.gif


i think so, u can try it

arraylist arr=new arraylist();

arr.add(rd["column-name"]);
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 12:49PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month