Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:25:09+00:00 2026-06-14T20:25:09+00:00

Just want to ask why this wont work for me? I’m trying to bring

  • 0

Just want to ask why this wont work for me?

I’m trying to bring back data for booking system (or something which like that).

The problem is that it only go to only one if statement and ignore the second one.

Using VB.net and trying to connect to MySQL database.

Thanks all…

Petr

thanks for answers guys i will try all the problem is that if its not = to let say Monday then it should make the color of the check-box white.

I will try the select case and see.

I did some changes add there checkbox lists that it make it easier. The problem is to clear the checkbox on different days.

    CheckBoxListMon.BackColor = Drawing.Color.White
    CheckBoxListMon.Enabled = True
    CheckBoxListMon.ClearSelection()

This make the checkbox enabled and not selected but I still cant can’t click on them they are disabled.

Anyone have some idea?

    Try
        strQuery = "SELECT BookingDate, BookingTime,BookRegUserID,Booked FROM bookings"

        MySQLCmd = New MySqlCommand(strQuery, dbCon)

        dbCon.Open()

        DR = MySQLCmd.ExecuteReader

        While DR.Read

            bookDate = DR.Item("BookingDate")
            bookTime = DR.Item("BookingTime")
            bookRegID = DR.Item("BookRegUserID")
            booked = DR.Item("Booked")

            Select Case True

                Case bookDate = lblMonday.Text And    CheckBoxListMon.Items.FindByValue(test) IsNot Nothing

                    CheckBoxListMon.Items.FindByValue(bookTime).Enabled = False
                    CheckBoxListMon.Items.FindByValue(bookTime).Selected = True
                    CheckBoxListMon.Items.FindByValue(bookTime).Attributes.Add("Style", "color: red;")


                Case bookDate = lblTuesday.Text And CheckBoxListTue.Items.FindByValue(test) IsNot Nothing

                    CheckBoxListTue.Items.FindByValue(bookTime).Enabled = False
                    CheckBoxListTue.Items.FindByValue(bookTime).Selected = True
                    CheckBoxListTue.Items.FindByValue(bookTime).Attributes.Add("Style", "color: red;")
        End While
        DR.Close()
        dbCon.Close()
    Catch ex As Exception

    End Try
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:25:10+00:00Added an answer on June 14, 2026 at 8:25 pm

    I think Isee the problem now. You dont want to flip the comboboxes back if they do not match. Lets say you have Monday Tuesday being returned in your result set. The first row will flip monday to true and tuesday to false, the second will set monday to false – which I do not think you want – and set tuesday to true, leaving everything being decided by the last row. The answer is to set them all to false before processing the rows, and only set to true if you get a match, otherwise ignore it.

       CbMon10.BackColor = Drawing.Color.White
        CbMon10.Checked = False
        CbMon10.Enabled = True
        CbTue10.BackColor = Drawing.Color.White
        CbTue10.Checked = False
        CbTue10.Enabled = True
    

    While DR.Read

    bookDate = DR.Item("BookingDate")
    bookTime = DR.Item("BookingTime")
    bookRegID = DR.Item("BookRegUserID")
    booked = DR.Item("Booked")
    
        Select Case True
            Case bookDate = lblMonday.Text And bookTime = CbMon10.Text
                CbMon10.BackColor = Drawing.Color.Red
                CbMon10.Checked = True
                CbMon10.Enabled = False
    
            Case bookDate = lblTuesday.Text And bookTime = CbTue10.Text
                CbTue10.BackColor = Drawing.Color.Red
                CbTue10.Checked = True
                CbTue10.Enabled = False
    
        End Select
    
    End While
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to ask if anybody has done something like this. Basically, it's
Can you help me on this one? Just want to ask on how to
This is my first here in Stackoverflow. So I just want to ask question
Just want to ask a question if this is possible ? $('element').each(function(){ var name
Just want to ask if i can use Custom Validator in client side without
Just want to ask can netbean IDE get connected to clearcase remote client server
I just want to ask if is it okay that I use native PHP
i just want to ask about my html code here, i have a bit
I just want to ask for your experience. I'm designing a public website, using
I just want to ask if there is any PHP/MySQL datatype that can store

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.