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...

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

windows.devel.dotnet.cx

Subject: 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 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