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. C#
  4. Reminder Project

Reminder Project

Scheduled Pinned Locked Moved C#
xmlhelptutorial
7 Posts 3 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
    MumbleB
    wrote on last edited by
    #1

    Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.

    K A 2 Replies Last reply
    0
    • M MumbleB

      Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      You probably need another varible. Something like

      bool sentReminder = false;
      if (time == datetime.now && !sendreminder)
      {
      sentReminder = true;
      //do your thing
      }

      if (time != datetime.now)
      {
      //re-set for next time
      sentReminder = false;
      }

      Anyway, that is one quick thought on what you could do. Ben

      1 Reply Last reply
      0
      • M MumbleB

        Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.

        A Offline
        A Offline
        Adam m Nelson
        wrote on last edited by
        #3

        I'm sure there are better ways, but this would work.

        //Declarations
        int intFlag = 0;

        //On timer tick
        if ((date and time == DateTime.Now) && (intFlag == 0))
        {
        intFlag++;
        Show reminder;
        }

        if (date and time != DateTime.Now)
        {
        intFlag = 0;
        }

        -- modified at 16:25 Wednesday 3rd October, 2007

        M 1 Reply Last reply
        0
        • A Adam m Nelson

          I'm sure there are better ways, but this would work.

          //Declarations
          int intFlag = 0;

          //On timer tick
          if ((date and time == DateTime.Now) && (intFlag == 0))
          {
          intFlag++;
          Show reminder;
          }

          if (date and time != DateTime.Now)
          {
          intFlag = 0;
          }

          -- modified at 16:25 Wednesday 3rd October, 2007

          M Offline
          M Offline
          MumbleB
          wrote on last edited by
          #4

          Thanx mate. I will give this a go. Much appreciated.

          A 1 Reply Last reply
          0
          • M MumbleB

            Thanx mate. I will give this a go. Much appreciated.

            A Offline
            A Offline
            Adam m Nelson
            wrote on last edited by
            #5

            np.. good luck

            M 1 Reply Last reply
            0
            • A Adam m Nelson

              np.. good luck

              M Offline
              M Offline
              MumbleB
              wrote on last edited by
              #6

              Adam, last question. The exmple you provided, is that for using with SQL or with XML? I'm a bit lost at which base to use for storing the information in.

              A 1 Reply Last reply
              0
              • M MumbleB

                Adam, last question. The exmple you provided, is that for using with SQL or with XML? I'm a bit lost at which base to use for storing the information in.

                A Offline
                A Offline
                Adam m Nelson
                wrote on last edited by
                #7

                That was for C#, which i am assuming you are writing your GUI in. The code was just a logic loop so it will only post your reminder once. I don't personally know XML, but SQL is a great program to store information. There's an excellent article on here about SQL by Matt Newman, it might be useful for your project. http://www.codeproject.com/cs/database/sql\_in\_csharp.asp Oh, and the "data and time" in there would be a string in your app... if your using SQL you may have to use the .TrimEnd( ) Command to get rid of extra spaces at the end of the saved "date and time" to make it work right as SQL fills any un-used room with spaces for you. I hope that answered your question, if not just message back. Adam

                --Its not broken if it never worked.

                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