Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB.NET / APPLICATION SETTINGS

VB.NET / APPLICATION SETTINGS

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mebjen
    wrote on last edited by
    #1

    I have an the following application setting [Name: PO / Type: Integer / Scope: User / Value: 100001] This setting increments every time the user logs into the application and is displayed in a textbox - it is working fine on 4 different workstations - but on workstation 5 it is only displaying 1 then 2 then 3 and so on instead of 100001,100002,100003 . . . .. There is a mixture of operating systems anything from XP to Windows 8. Workstation 5 is Windows 7. Is there something obvious I'm missing? Thanks, MB

    D 1 Reply Last reply
    0
    • M mebjen

      I have an the following application setting [Name: PO / Type: Integer / Scope: User / Value: 100001] This setting increments every time the user logs into the application and is displayed in a textbox - it is working fine on 4 different workstations - but on workstation 5 it is only displaying 1 then 2 then 3 and so on instead of 100001,100002,100003 . . . .. There is a mixture of operating systems anything from XP to Windows 8. Workstation 5 is Windows 7. Is there something obvious I'm missing? Thanks, MB

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Without knowing anything about how you implemented this functionality, it's pretty much impossible to tell you what's going wrong. How are you getting this setting and from where? How are you updating this setting and persisting it?? We'd need to see the relavent code snippets.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Without knowing anything about how you implemented this functionality, it's pretty much impossible to tell you what's going wrong. How are you getting this setting and from where? How are you updating this setting and persisting it?? We'd need to see the relavent code snippets.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        M Offline
        M Offline
        mebjen
        wrote on last edited by
        #3

        OK - lets see if this helps - have the following variable under Public Class Main: Dim poIncNo As Integer Then in the formLoad Event I have: txtBx_poNo.Text = genPoNo(currUser) Private Function genPoNo(ByVal user As String) As String Dim strNum As String = "1" poIncNo = My.Settings.po + 1 Dim poNum As String Select Case user Case uFred poNum = strNum & userId + CStr(poIncNo) Return poNum End Select End Function In Application.Settings I have: Name = po Type = integer Scope = user Value = 100001 Thanks, MB

        D 1 Reply Last reply
        0
        • M mebjen

          OK - lets see if this helps - have the following variable under Public Class Main: Dim poIncNo As Integer Then in the formLoad Event I have: txtBx_poNo.Text = genPoNo(currUser) Private Function genPoNo(ByVal user As String) As String Dim strNum As String = "1" poIncNo = My.Settings.po + 1 Dim poNum As String Select Case user Case uFred poNum = strNum & userId + CStr(poIncNo) Return poNum End Select End Function In Application.Settings I have: Name = po Type = integer Scope = user Value = 100001 Thanks, MB

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          OK, so are these application-scope settings or user-scope settings?? You also don't have any code in what you posted that sets the settings with new values and persists them.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            OK, so are these application-scope settings or user-scope settings?? You also don't have any code in what you posted that sets the settings with new values and persists them.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            M Offline
            M Offline
            mebjen
            wrote on last edited by
            #5

            Dave, It is 'user-scope' Private Function genPoNo(ByVal user As String) As String 08 Dim strNum As String = "1" 09 poIncNo = My.Settings.po + 1 '----IT'S INCREMENTED HERE ! 10 Dim poNum As String 11 Select Case user 12 Case uFred 13 poNum = strNum & userId + CStr(poIncNo) 14 Return poNum 15 End Select 16 End Function Thanks MB

            D 1 Reply Last reply
            0
            • M mebjen

              Dave, It is 'user-scope' Private Function genPoNo(ByVal user As String) As String 08 Dim strNum As String = "1" 09 poIncNo = My.Settings.po + 1 '----IT'S INCREMENTED HERE ! 10 Dim poNum As String 11 Select Case user 12 Case uFred 13 poNum = strNum & userId + CStr(poIncNo) 14 Return poNum 15 End Select 16 End Function Thanks MB

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              mebjen wrote:

              poIncNo = My.Settings.po + 1   '----IT'S INCREMENTED HERE !

              NO, IT'S NOT! You set the value of poIncNo to the setting + 1, but you never showed where you saved that new value back into settings!

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups