|
|
Choosing A Webhost: |
Re: ArrayList stored in DataSet? (What can & Cant be stored?): msg#00155windows.devel.dotnet.cx
If you're trying to persist objects to a file, then you could always try this, http://www.google.com/search?q=serialize+objects+to+file+c%23. --ola -----Original Message----- From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:DOTNET-CX@xxxxxxxxxxxxxxxxxxx] On Behalf Of Ola Tinoco-Ekdahl Sent: Tuesday, September 20, 2005 2:41 PM To: DOTNET-CX@xxxxxxxxxxxxxxxxxxx Subject: Re: [DOTNET-CX] ArrayList stored in DataSet? (What can & Cant be stored?) What's the error? Some type of casting mismatch? --ola -----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 2: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 DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.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> |
|---|---|---|
| Previous by Date: | Re: ArrayList stored in DataSet? (What can & Cant be stored?), Ola Tinoco-Ekdahl |
|---|---|
| Next by Date: | Re: ArrayList stored in DataSet? (What can & Cant be stored?), Steve Welborn |
| Previous by Thread: | Re: ArrayList stored in DataSet? (What can & Cant be stored?), Ola Tinoco-Ekdahl |
| Next by Thread: | Re: ArrayList stored in DataSet? (What can & Cant be stored?), Steve Welborn |
| 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 |