473,385 Members | 1,343 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,385 software developers and data experts.

Is anyone able to make My.Settings work? I can't!

I save some data to an array in my program. I can reopen the setting
screen and see that the data is, in fact, in the array.

I then do a lot of these:

My.Settings.Brkr1 = BreakerAmps(1)
My.Settings.Brkr2 = BreakerAmps(2)
My.Settings.Brkr3 = BreakerAmps(3)
My.Settings.Brkr4 = BreakerAmps(4)
My.Settings.Brkr5 = BreakerAmps(5)
then I do a: My.Settings.Save

after all of the My.Settings commands and exit the program.
On the way in next time, I do:

BreakerAmps(1) = CInt(My.Settings.Brkr1)
BreakerAmps(2) = CInt(My.Settings.Brkr2)
BreakerAmps(3) = CInt(My.Settings.Brkr3)
BreakerAmps(4) = CInt(My.Settings.Brkr4)
BreakerAmps(5) = CInt(My.Settings.Brkr5)

and when I get to my settings screen, they are back to the default that
was entered when I set up the settings entries by hand.

I tried doing a My.Settings.Reload during the invocation just in case
but it made no different.

Ideas?

Where can I see the "persistent" values so help find the problem area.

My MSDN help is still broken via the VS help system. Says it is down
(does not seem to be) or my User/PW is broken (but does not let me
reenter it) so getting help got just that much harder and it was already
hard enough!

Mike Morrow
MMSA00E62537

Jun 30 '08 #1
7 3291
Mike,

In this millenium there is more than Atari programming. The mySettings are
based on all kind of data in the computer.

By instance the XML config file. It is not just simple a piece of memory
that you withouth having allocated can use.

Cor

<Ju********@home.netschreef in bericht
news:r1********************************@4ax.com...
>I save some data to an array in my program. I can reopen the setting
screen and see that the data is, in fact, in the array.

I then do a lot of these:

My.Settings.Brkr1 = BreakerAmps(1)
My.Settings.Brkr2 = BreakerAmps(2)
My.Settings.Brkr3 = BreakerAmps(3)
My.Settings.Brkr4 = BreakerAmps(4)
My.Settings.Brkr5 = BreakerAmps(5)
then I do a: My.Settings.Save

after all of the My.Settings commands and exit the program.
On the way in next time, I do:

BreakerAmps(1) = CInt(My.Settings.Brkr1)
BreakerAmps(2) = CInt(My.Settings.Brkr2)
BreakerAmps(3) = CInt(My.Settings.Brkr3)
BreakerAmps(4) = CInt(My.Settings.Brkr4)
BreakerAmps(5) = CInt(My.Settings.Brkr5)

and when I get to my settings screen, they are back to the default that
was entered when I set up the settings entries by hand.

I tried doing a My.Settings.Reload during the invocation just in case
but it made no different.

Ideas?

Where can I see the "persistent" values so help find the problem area.

My MSDN help is still broken via the VS help system. Says it is down
(does not seem to be) or my User/PW is broken (but does not let me
reenter it) so getting help got just that much harder and it was already
hard enough!

Mike Morrow
MMSA00E62537
Jun 30 '08 #2
I found out what is happening.

When you copy code around to clean things up a little bit and get stuff
that is similar, together, (refactoring, sorta) VB loses the Handles
clauses. They simply vanish. It has happened several times to me and
this time, it happened on the form close and it was not running to save
the values. I put it back in and now the routine runs and I save the
data.

Don't say I forgot to copy it. I copied the Sub command and the code
and the Handles is right inline with it. I could not miss copying it
when I move a whole routine but at the destination, the Handles is
missing and I missed noticing that it had gone away.

Settings is not "working" since the routine to drive it is back.

I hope someone fixes that little problem soon.

Mike

On Mon, 30 Jun 2008 05:31:28 +0200, in
microsoft.public.dotnet.languages.vb "Cor Ligthert[MVP]"
<no************@planet.nlwrote:
>Mike,

In this millenium there is more than Atari programming. The mySettings are
based on all kind of data in the computer.

By instance the XML config file. It is not just simple a piece of memory
that you withouth having allocated can use.

Cor

<Ju********@home.netschreef in bericht
news:r1********************************@4ax.com.. .
>>I save some data to an array in my program. I can reopen the setting
screen and see that the data is, in fact, in the array.

I then do a lot of these:

My.Settings.Brkr1 = BreakerAmps(1)
My.Settings.Brkr2 = BreakerAmps(2)
My.Settings.Brkr3 = BreakerAmps(3)
My.Settings.Brkr4 = BreakerAmps(4)
My.Settings.Brkr5 = BreakerAmps(5)
then I do a: My.Settings.Save

after all of the My.Settings commands and exit the program.
On the way in next time, I do:

BreakerAmps(1) = CInt(My.Settings.Brkr1)
BreakerAmps(2) = CInt(My.Settings.Brkr2)
BreakerAmps(3) = CInt(My.Settings.Brkr3)
BreakerAmps(4) = CInt(My.Settings.Brkr4)
BreakerAmps(5) = CInt(My.Settings.Brkr5)

and when I get to my settings screen, they are back to the default that
was entered when I set up the settings entries by hand.

I tried doing a My.Settings.Reload during the invocation just in case
but it made no different.

Ideas?

Where can I see the "persistent" values so help find the problem area.

My MSDN help is still broken via the VS help system. Says it is down
(does not seem to be) or my User/PW is broken (but does not let me
reenter it) so getting help got just that much harder and it was already
hard enough!

Mike Morrow
MMSA00E62537
Jun 30 '08 #3
Ju********@home.net wrote:
I found out what is happening.

I hope someone fixes that little problem soon.

Mike
I've posted the following code at earlier times, and I'll list it again,
it will fix your problem -

1. Create a new setting, such as "SettingsValid" and set its default
value to False. (This is important!)

2. Place the following code at the beginning of your Form_Load event -

If Not My.Settings.SettingsValid Then
My.Settings.Upgrade()
My.Settings.SettingsValid = True
My.Settings.Save()
End If
Hope this helps.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Jun 30 '08 #4
Mike,

That is no problem, the problem is that you are meshing up with the code.

You can cut it and set it on another place, but how would be known which of
the exact equal event methode should be taken as you copy it. Be happy that
it is not deleted from the original one too.

However, I am curious how you think that you can refactor code as you don't
even know the basics?

Cor

<Ju********@home.netschreef in bericht
news:sd********************************@4ax.com...
>I found out what is happening.

When you copy code around to clean things up a little bit and get stuff
that is similar, together, (refactoring, sorta) VB loses the Handles
clauses. They simply vanish. It has happened several times to me and
this time, it happened on the form close and it was not running to save
the values. I put it back in and now the routine runs and I save the
data.

Don't say I forgot to copy it. I copied the Sub command and the code
and the Handles is right inline with it. I could not miss copying it
when I move a whole routine but at the destination, the Handles is
missing and I missed noticing that it had gone away.

Settings is not "working" since the routine to drive it is back.

I hope someone fixes that little problem soon.

Mike

On Mon, 30 Jun 2008 05:31:28 +0200, in
microsoft.public.dotnet.languages.vb "Cor Ligthert[MVP]"
<no************@planet.nlwrote:
>>Mike,

In this millenium there is more than Atari programming. The mySettings are
based on all kind of data in the computer.

By instance the XML config file. It is not just simple a piece of memory
that you withouth having allocated can use.

Cor

<Ju********@home.netschreef in bericht
news:r1********************************@4ax.com. ..
>>>I save some data to an array in my program. I can reopen the setting
screen and see that the data is, in fact, in the array.

I then do a lot of these:

My.Settings.Brkr1 = BreakerAmps(1)
My.Settings.Brkr2 = BreakerAmps(2)
My.Settings.Brkr3 = BreakerAmps(3)
My.Settings.Brkr4 = BreakerAmps(4)
My.Settings.Brkr5 = BreakerAmps(5)
then I do a: My.Settings.Save

after all of the My.Settings commands and exit the program.
On the way in next time, I do:

BreakerAmps(1) = CInt(My.Settings.Brkr1)
BreakerAmps(2) = CInt(My.Settings.Brkr2)
BreakerAmps(3) = CInt(My.Settings.Brkr3)
BreakerAmps(4) = CInt(My.Settings.Brkr4)
BreakerAmps(5) = CInt(My.Settings.Brkr5)

and when I get to my settings screen, they are back to the default that
was entered when I set up the settings entries by hand.

I tried doing a My.Settings.Reload during the invocation just in case
but it made no different.

Ideas?

Where can I see the "persistent" values so help find the problem area.

My MSDN help is still broken via the VS help system. Says it is down
(does not seem to be) or my User/PW is broken (but does not let me
reenter it) so getting help got just that much harder and it was already
hard enough!

Mike Morrow
MMSA00E62537
Jun 30 '08 #5
<Ju********@home.netschrieb:
>I save some data to an array in my program. I can reopen the setting
screen and see that the data is, in fact, in the array.

I then do a lot of these:

My.Settings.Brkr1 = BreakerAmps(1)
My.Settings.Brkr2 = BreakerAmps(2)
My.Settings.Brkr3 = BreakerAmps(3)
My.Settings.Brkr4 = BreakerAmps(4)
My.Settings.Brkr5 = BreakerAmps(5)
then I do a: My.Settings.Save

after all of the My.Settings commands and exit the program.
On the way in next time, I do:

BreakerAmps(1) = CInt(My.Settings.Brkr1)
BreakerAmps(2) = CInt(My.Settings.Brkr2)
BreakerAmps(3) = CInt(My.Settings.Brkr3)
BreakerAmps(4) = CInt(My.Settings.Brkr4)
BreakerAmps(5) = CInt(My.Settings.Brkr5)

and when I get to my settings screen, they are back to the default that
was entered when I set up the settings entries by hand.
Make sure the settings are /user/ settings and not /application/ settings.
Only user settings can be saved.

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

Jun 30 '08 #6
"Cor Ligthert[MVP]" wrote:
However, I am curious how you think that you can refactor code as you don't
even know the basics?

Cor
What a rude and unhelpful reply!

--
David Streeter
Synchrotech Software
Sydney Australia
Jul 1 '08 #7
What a rude and unhelpful reply!
>
Did you understand it?
Cor
Jul 1 '08 #8

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

Similar topics

162
by: Isaac Grover | last post by:
Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites...
14
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
11
by: ricolee99 | last post by:
Hi everyone, I'm trying to invoke my .exe application from a remote server. Here is the code: ManagementClass processClass = new ManagementClass ("\\\\" +"RemoteServerName" +...
31
by: Jim Hubbard | last post by:
I am downloading the REALbasic 5.5 demo and was just wondering if anyone else had tried it. I am tired of Microsoft constantly changing things and breaking backward compatibility ON PURPOSE. ...
2
by: Jim | last post by:
I'm trying to use the Application Settings option in VS2005 with C#. So far I've no success getting my settings to save or load. Various tutorials on the 'net seem to be outdated. Even MSDN's...
0
by: shapper | last post by:
Hello, I want to create an ordered list where each list item can have various controls: <ol> <li>textbox, label, ...</li> ... </ol>
26
by: Protoman | last post by:
I've written this program that simulates a 36 character, 10 rotor reciprocal rotor cipher, w/ a plugboard. Any way I can make the plugboard function more compact and/or be able to change the...
13
by: Anonymous | last post by:
On MS site: http://msdn2.microsoft.com/en-us/library/esew7y1w(VS.80).aspx is the following garbled rambling: "You can avoid exporting classes by defining a DLL that defines a class with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.