Results 1 to 2 of 2

Thread: Why else statement for function userexiststoday not work and how to solve it

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2016
    Posts
    37

    Why else statement for function userexiststoday not work and how to solve it

    I work in c# windows form vs 2015 selecting data from excel
    problem i face it
    supose i have in excel file
    user id dateprint
    1001 22/02/2017

    if try add this user 1001 again with date 23/02/2017
    it must give me message this user found before
    but this is not happen and this is actually my problem
    my code


    Code:
    bool c = QRC.UserExists(textBox1.Text);  
      
    bool b = UserExistsToday();  
      
    if (c == true)  
      
    {  
      
    if (b == true)  
      
    {  
      
      
    label8.Text = "User added today";  
      
      
      
    }  
      
      
    else  
      
    {  
      
      
    label8.Text = "User added before";  
      
      
    }

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: Why else statement for function userexiststoday not work and how to solve it

    How exactly are we supposed to answer that question? There's nothing wrong with your 'if' statements there. They will do exactly what they should do based on the values of 'c' and 'b'. That won't help if 'c' and 'b' have the wrong values though, but the logic to set those values is inside two methods that you have chosen not to shows us.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width