473,729 Members | 2,353 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.Sav e() - then reload the settings at
a later time with the My.Settings.Rel oad() - 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
"Applicatio n 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 2976
<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.Sav e() - then reload the settings at
a later time with the My.Settings.Rel oad() - 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
8494
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. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track, though it does happen often.
1
7935
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 in italy, with italian settings) have the following method: MYXWS.MyMethod(input_var as datetime) On my dev machine (localized in italy, with italian settings) i have created a web application that use the proxy class for call the XML wer...
4
2316
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 screen. In particular some text boxes are getting too large and covering buttons and therefore preventing them from being pushed. It appears that some other application - or perhaps a plug-in - changes the default browser settings and then causes...
7
22488
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 added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
17
3248
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 production. I'm in the process of writing a site that will have lots of traffic so I'm trying to save resources everyplace that I can. My question is - do the web.config app settings get loaded once when the
7
1797
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 Settings\Administrator\Desktop\1\bye w&amp;y </dirname> <file> <name>def.txt</name> <time>200607130417</time> </file>
12
10112
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) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
0
1427
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 application, by default it creates an 'applicationSetings' area in the .config file. Whereas, the default enterprise library creates the older 'appSettings' area. What I am trying to do is that I have my entire app using EL 3.1 for the application...
6
4914
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) Windows 2003 server SP2 Now when I set a decimal DB field value to "123,32" (using ADODB.recordset ) updated value is (123.32)
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4525
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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 we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.