473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Storing string collection using Configuration Block

What is the easiest way to store a collection of strings using the MS
Configuration Block? I am using XML serializer. I tried having an ArrayList
as a property in the class I was serializing, but when it is read back it is
no longer an arraylist of string values. Any ideas?
Nov 16 '05 #1
2 4118
Each element of ArrayList is type of object. You can just do like...

foreach(string s in MyArrayList)
{
// do whatever you want here
}

Would that not work for you?

============================
Hayato Iriumi (hi*****@hotmail.com)
Blog: http://www.vbaspcoder.com

"gcrasher" <gc******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
What is the easiest way to store a collection of strings using the MS
Configuration Block? I am using XML serializer. I tried having an ArrayList as a property in the class I was serializing, but when it is read back it is no longer an arraylist of string values. Any ideas?

Nov 16 '05 #2
I am using Micosofts Configuration block, which serializes objects to xml and
reads them back. When I serialize something that contains an array list and
then read it back like:

MyClass = (MyClass)ConfigurationManager.Read("section");

then MyClass.ArrayList no longer contains the string objects.


"Hayato Iriumi" wrote:
Each element of ArrayList is type of object. You can just do like...

foreach(string s in MyArrayList)
{
// do whatever you want here
}

Would that not work for you?

============================
Hayato Iriumi (hi*****@hotmail.com)
Blog: http://www.vbaspcoder.com

"gcrasher" <gc******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
What is the easiest way to store a collection of strings using the MS
Configuration Block? I am using XML serializer. I tried having an

ArrayList
as a property in the class I was serializing, but when it is read back it

is
no longer an arraylist of string values. Any ideas?


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: cppdev | last post by:
Hi All! I want to clear the string contents from sensitive information such as passwords, and etc. It's always a case that password will appear as string at some point or another. And i feel...
10
by: Diego F. | last post by:
Hello. I need to store custom objects in a SQL Server 2000 table. Which is the easiest way to do it? Do I need to write methods to store each attribute separately from C# app to the table and the...
4
by: Claire | last post by:
Hi We're newish to visual studio .net. I wanted to store some user defined variables. Normally I'd have written these to the registry but my colleague informed me that Microsoft was trying to...
1
by: Philip Wagenaar | last post by:
Hi, I used the microsoft configuration block to store settings for applications in the past and this worked fine. But now I have the following situation and I do not know how to solve this: I...
8
by: rgparkins | last post by:
Hi I am creating a sign-up process on a web site much like that of a wizard form. I have browsed many sites to look for examples of how to store the entry data, so that the user can go back and...
9
by: bonk | last post by:
Does anyone have a simple example on how to prohibit that any thread other than the current thread modifies a certain object (a collection) while we are in a certain section of the code? In other...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
11
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have...
158
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.