473,503 Members | 9,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET 2.0 & Application Settings..

Everyone,

I have a question on how to use persistant application settings with
2.0. I understand I can use defined types like ints, strings, and so
on, but how about my own custom class? The problem is I can fill in
the 'type' of the setting as my custom class, but if I try to save the
settings - calling the My.Settings.Save() - then reload the settings at
a later time with the My.Settings.Reload() - the data in my custom
class is not there. Infact I checked the XML and it only has the
setting's name.

In short:
1. Can I use my own class as a setting variable?
1.b. If so, how?
2. Do I need to use the Type converter?

http://msdn2.microsoft.com/en-us/library/a65txexh.aspx
"Application settings can be stored as any data type that is XML
serializable or has a TypeConverter that implements
ToString/FromString. The most common types are String, Integer, and
Boolean, but you can also store values as Color, Object, or as a
connection string."

3. Is there a size restriction on the value of an application setting?
I wonder if my class exceeds this.

Thank you in advance,

Modi

Jun 30 '06 #1
1 2954
<mo*****@gmail.com> schrieb:
I have a question on how to use persistant application settings with
2.0. I understand I can use defined types like ints, strings, and so
on, but how about my own custom class? The problem is I can fill in
the 'type' of the setting as my custom class, but if I try to save the
settings - calling the My.Settings.Save() - then reload the settings at
a later time with the My.Settings.Reload() - the data in my custom
class is not there. Infact I checked the XML and it only has the
setting's name.


Are you sure the settings are under the user scope and not the application
scope? Note that settings with application scope are not saved by calling
the 'Save' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 30 '06 #2

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

Similar topics

12
8450
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
1
7924
by: M DL via .NET 247 | last post by:
Hi all, i have one problem with a method of an xml web service that use a datetime data type input variable, and may be all is caused by international settings. The XML web service (localized...
4
2307
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application that has been running just fine for several months without any cascading style sheets. Suddenly several users have had problems with the layout of the...
7
22471
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
17
3221
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
7
1784
by: Kirt | last post by:
i have walked a directory and have written the foll xml document. one of the folder had "&" character so i replaced it by "&amp;" #------------------test1.xml <Directory> <dirname>C:\Documents and...
12
10061
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
0
1413
by: John | last post by:
Hi, I was wondering if it is possible to get the enterprise library (EL) 3.x to read/write the settings.settings section of the .config file? Because when you use the settings.settings in an...
6
4895
by: avcitamer | last post by:
We upgraded our system and problem below occured, pleas help me... Windows 2003 server SP1 When I set a decimal DB field value to "123,32" (using ADODB.recordset ) updated value was ok (123.32)...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
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
7361
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...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.