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
M

Member 4372331

@Member 4372331
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Upgrading from Vista to Weven?
    M Member 4372331

    I upgraded and have not been sorry. I used the Vista disk management tools to shrink the primary (Vista) partition. I then created a new partition and installed 7 on the new partition. This automatically creates a menu at boot that allows you to choose to boot into Vista or 7, allowing you to boot back into your old setup if you run into problems. And since the Vista partition appears as a secondary drive in 7, it makes it much easier to copy documents from Vista to 7. I still have the Vista partition on my machine, but haven't booted into Vista for couple months now.

    The Lounge com question career

  • Search/Evaluate My.Settings.StringCollection
    M Member 4372331

    Thanks! That is it. I had tried '.toshortdatestring' and a few others, and none worked. For some reason I never thought of simply formatting the string.

    Visual Basic csharp dotnet visual-studio testing business

  • Search/Evaluate My.Settings.StringCollection
    M Member 4372331

    Excellent thing to check. However, I have already checked that the holidays are there. The 'Holidays' are pre-populated with some default values at build time. The user can change them at will. The settings are there, I verified this with:

    For each st as string in My.Settings.Holidays
    msgbox(st)
    Next

    The messages show the correct dates, which reflect any changes made on the specific machine. I also have user settings for fore and back colors, window location, etc. which are always applied correctly. I also tried aggregating all the holidays into one string and search it using 'InStr'. Once again, this worked fine on the dev machine but not others. Does the problem lie in the fact that I am comparing a "date.tostring" with a "string"? But it does work on the dev machine.... :sigh:

    Visual Basic csharp dotnet visual-studio testing business

  • Search/Evaluate My.Settings.StringCollection
    M Member 4372331

    I wrote a "widget" to report sales data, etc. I need to make some calculations based on business days to date this month. Business days are Mon-Fri, minus any holidays. Holidays are defined in my.settings, using a string collection. The function below iterates through the days of the current month until it reaches today. For each iteration, it checks to see if the day is a weekday, then checks to see if it is listed in my.settings.holidays. If it is a weekday, and not a holiday, the counter is incremented. If it is a holiday I receive a message "Holiday". This works exactly as I expect on my dev machine. However, when running the widget on any other machine, the "IF" statement that checks the holidays never evaluates to true. Any ideas anybody? Am I missing an import statement?

    Protected Overridable Function CountBusinessDays() As Integer
        Dim BusDays As Integer
        Dim RefMonth As Integer = Month(Now)
        Dim CalcDate As Date = DateSerial(Year(Now), Month(Now), 1)
        Do While Month(CalcDate) = RefMonth
            Dim wkday As Integer = Weekday(CalcDate)
            If wkday <> 1 And wkday <> 7 Then
                If Not My.Settings.Holiday.Contains(CalcDate.ToString) Then
                    BusDays = (BusDays + 1)
                Else : MsgBox("Holiday") 'For testing....
                End If
            End If
            If CalcDate = Date.Today Then Exit Do
            CalcDate = CalcDate.AddDays(1)
        Loop
        Return BusDays
    End Function
    

    We use Visual Studio 2005, and have .Net framework 3.5 installed on all machines.

    Visual Basic csharp dotnet visual-studio testing business
  • Login

  • Don't have an account? Register

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