|
|
Choosing A Webhost: |
ArrayList stored in DataSet? (What can & Cant be stored?): msg#00148windows.devel.dotnet.cx
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> |
|---|---|---|
| Previous by Date: | Re: Need fast Bitmap Compare Method, Steve Welborn |
|---|---|
| Next by Date: | Re: Best way to convert "cAsE" to "Case"?, Kenneth Lee |
| Previous by Thread: | Best way to convert "cAsE" to "Case"?, Zeusbwr |
| Next by Thread: | Re: ArrayList stored in DataSet? (What can & Cant be stored?), Kenneth Lee |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |