logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: ArrayList stored in DataSet? (What can & Cant be stored?): msg#00156

windows.devel.dotnet.cx

Subject: Re: ArrayList stored in DataSet? (What can & Cant be stored?)

Hey no worries, you don't know if you don't ask. The
art of Trial and Error
is alive and active, we all do it.

The reason, my opinion, that its erroring out when you
try to write to xml
is because when a DataSet does this its reading the
DataSet's information
and getting column names and data and such. When all
it finds is an
ArrayList, which doesn't contain any of this, it
breaks.

You can put a DataSet inside an Arraylist, but not the
other way around and
have it work right.

At least from my experience.


Good luck.

Steve


-----Original Message-----
From: Discussion relating to the specifics of the C#
and Managed C++
languages [mailto:DOTNET-CX@xxxxxxxxxxxxxxxxxxx] On
Behalf Of Zeusbwr
Sent: Tuesday, September 20, 2005 1:32 PM
To: DOTNET-CX@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-CX] ArrayList stored in DataSet?
(What can & Cant be
stored?)

I'm just trying to save some time so i don't have to
convert it to a

set of columns that each hold a value and essentially
an object of the

array list.



I haven't toyed with hash tables in C# so i wouldn't
know.





As far as the purist face. I wasn't saying THIS STUPID
POS DOESN'T

WORK LIKE ITS DESIGNED TO, i was asking if it was
designed to be used

that way or not, if it was then apparently i was doing
something

wrong. Then again, i shouldn't be dumb enough to ask a
silly "does

this do that" question.



So Thanks.. i think.





Short answer, nope, i gatta split my ArrayList/Array
up before storing it.



Thanks!



On 9/20/05, Steve Welborn <swelborn2001@xxxxxxxxx>
wrote:

> What is your goal here?

>

> From looking at your info so far it would seem to be

> easier to use a

> HashTable and put the arraylist inside of it.

> Depending on what your trying

> to do of course.

>

> Steve

>

> -----Original Message-----

> From: Discussion relating to the specifics of the C#

> and Managed C++

> languages [mailto:DOTNET-CX@xxxxxxxxxxxxxxxxxxx] On

> Behalf Of Zeusbwr

> Sent: Tuesday, September 20, 2005 12:05 PM

> To: DOTNET-CX@xxxxxxxxxxxxxxxxxxx

> Subject: [DOTNET-CX] ArrayList stored in DataSet?

> (What can & Cant be

> stored?)

>

> Well i have a DataSet that holds user information.
One

> of this set of

>

> info being (well many hopefully) a form of Array.

>

>

>

> Now Array list start off fine, but when i actually

> assign and save

>

> data to text, it is deleted it seems.. so either i
am

> doing it wrong

>

> or its not possible to save an ArrayList on a
DataSet.

>

>

>

> Is this the proper method to assign a data set? Then

> call it? And if

>

> so, is there a special save flag or something?
because

> as said, mine

>

> isn't working..

>

>

>

> // Retrieve the Array

>

> System.Collections.ArrayList alInv =

>

> (System.Collections.ArrayList)drUser[0]["SomeData"];

>

> // Add to the Array

>

> alData.Add( "blah" );

>

> alData.Add( "blah2" );

>

> // Put the Array back in the DataSet

>

> drUser[0]["SomeData"] = alData;

>

> // Pull it back out again (to act as if alData didnt

> exist)

>

> System.Collections.ArrayList alData2 =

>

> (System.Collections.ArrayList)drUser[0]["SomeData"];

>

> // Check the elements, there should be 2. It works
for

> me.

>

> MessageBox.Show( "This works, here is the
number of

> elements: "+

>

> alData2.Count );

>

> // Here is where it goes wrong

>

> this.dsUsers.WriteXml( "filename.db",

> System.Data.XmlWriteMode.WriteSchema

>

>

>

> Now if you were to reload the dataset and try all
that

> again, noting

>

> that the first thing you do is try and pull the

> ArrayList from the

>

> DataSet to use it, you would get an error (least i

> do).

>

>

>

> And upon examining the actual XML File that holds
the

> DataSet, you get

>

> this for the ArrayList Row's Column (or w/e).

>

>

>

> <SomeData>System.Collections.ArrayList</SomeData>

>

>

>

>

>

> So yea.. I'm doing something wrong i hope. The
ability

> to physically

>

> save objects, and arrays of objects would vastly
help

> me. Please give

>

> me some idea of what I'm doing wrong.. if its even

> possible... :/

>

>

>

>

>

> --

>

> Zeusbwr[at]gmail.com,

>

> http://www.google.com/talk/

>

>

>

> ===================================

>

> This list is hosted by DevelopMentorR

> http://www.develop.com

>

>

>

> View archives and manage your subscription(s) at

> http://discuss.develop.com

>

>

>

>

>

>

>

> __________________________________

> Yahoo! Mail - PC Magazine Editors' Choice 2005

> http://mail.yahoo.com

>

> ===================================

> This list is hosted by DevelopMentor(r)
http://www.develop.com

>

> View archives and manage your subscription(s) at
http://discuss.develop.com

>





--

Zeusbwr[at]gmail.com,

http://www.google.com/talk/



Project Blog: http://zeusbwr.blogspot.com/



===================================

This list is hosted by DevelopMentorR
http://www.develop.com



View archives and manage your subscription(s) at
http://discuss.develop.com







__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation