Jump to content

problem using settings in vb.net

- - - - -

  • Please log in to reply
11 replies to this topic

#1
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
im tying to use settings in visual basic; i have my sentece in the settings; i want to program a click event in order to appear that sentence in a textbox, after the click i i have this error here

Posted Image

"failed system boot configuration"

please help, i want to use the settings,
thanks

Edited by Paulo_Jorge, 18 April 2011 - 08:15 AM.


#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
Please post your source code so we can determine where the problem is.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
please see the image now, really need this

thanks

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
It's very difficult to read the code in the image. If you could please use the CODE tags so I can read all of it and copy and paste the parts of it I need to test.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#5
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
this works in another project i have, but not in this project

this is the code;

Private Sub NoteTaker_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

        My.Settings.notes = TextBox1.Text

        My.Settings.Save()

    End Sub


    Private Sub NoteTaker_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        TextBox1.Text = My.Settings.notes

    End Sub

have an error here: in settings.designer.vb

Public Property notes() As String

            Get

                'THE ERROR IS HERE

                Return CType(Me("notes"), String)


            End Get

            Set

                Me("notes") = value

            End Set

        End Property

IN return ctype(me("notes"),string); it says "failed system boot configuration"

please help , thanks

#6
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
I'm not really fluent in VB, but I thought the Set method had to have (ByVal value as type) after it. Correct me if I'm wrong.
Also, I'm not familiar with the Me("string") method. I thought you accessed members using the dot, like Me.notes.

Can someone correct me if I'm wrong?
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#7
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
i dont written this code; when i have the error, visual basic directs me here and to that code

thats the problem

#8
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
Where did you get the code then? Who wrote it?
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#9
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
the code where i have the error, is automatically written by visual basic

#10
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
I'm not sure then. Sorry I can't be of much more help. Hopefully someone who is more versed in Visual Basic can give you the answer.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#11
HighKing Scott

HighKing Scott

    Newbie

  • Members
  • PipPip
  • 15 posts
I would suggest trying to save the settings on something other than the "Close" event of your form to test it out.... put it in a button.click event to test if it is the setting or the form designer that's giving you the problem. you may need to delete the form and start a new form if the form designer is giving you an error.

#12
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
i've tried change the event where the settings are acctioned and it didn't work;

i will try the delete and create a new form; but i dont know, the problem is occuring in the 99% of the project :(

thanks anyway




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users