What should be a simple if statement!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • toxicpaint
    New Member
    • Sep 2006
    • 58

    What should be a simple if statement!

    Hi everyone,

    I have a problem which I'm sure should be very simple to solve, but I can't work out why!

    Background:
    I'm using visual studio to create apsx, access and vb pages. I have a DetailsView displaying information about a 5 step process. At the admin side, the user ticks a box for each stage. the user side then displays this to the user so they can see where the admin side are up to with their request.

    One of these steps is to organise training. What I have done is create a date field in my database and then the admin side changes from the current date to whenever the training is organised to.

    The problem:
    I set the date that the request was started and use this to also set the date for the training. What I want to do is say
    If the date the request started is the same as the date for the training, set the cssclass for a detailsview templatefield. If they are different, don't set one. This way the user doesn't see a date until the admin team set one.

    So basically, how can I check the values of two fields in a database against each other and then assign a style to a templatefield if they meet?


    If any of this is unclear (i#m not very good at explaining) please let me know!

    Cheers,

    Tom
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Select the two dates from the database and then compare them against each other?

    Comment

    • toxicpaint
      New Member
      • Sep 2006
      • 58

      #3
      Originally posted by Plater
      Select the two dates from the database and then compare them against each other?
      It's the comparing bit I have a problem with.. How do I code this?:

      If dateopened = trainingdate then
      templateifeld's css proerty is "hide"

      I don't know how to get vb to pull the values from the datatbase, you see.. =/

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Well, you're in luck, because we happen to have not one but two articles about using a Database in your .NET program.

        Comment

        Working...