locked
Code help RRS feed

  • Question

  •  

    Hi
    I´m just in my build up phase off learning and using...
    I´m running on visual basic 2008 express ed.. and SQL Server 2008 express

    For the moment I´m trying to connect and compare some checkboxes True/False values to a SQL database and then retrieve data from the data base.

    For example:

    I have ten checkboxes (A-J) in a forme display that are enabled for True/False by clicking the mouse.

    __A     x_B     __C     __D     __E    __F     __G    __H      __I     __J

    When I mark one to “True” by clicking the checkbox, for example “B”, I  want to go to the SQL data base and compare and get some returned answers.  

    My data base is a table containing A-J in rows and columns declaring relations between each outer.

                                 A                          B                          C                          D                          E                           F

    Row A                True                    False                   False                   True                    True                    True

    Row B                False                   True                    True                    True                    False                   True

    Row C                False                   True                    True                    False                   True                    True

    To J

    The result I expect is that by marking B I want to go to the data base Row B and retrieve the values True/False for A-J. These values should then effects the ten checkboxes by turning “Enabled”  to True or False.

    The results of marking B: (d and red color symbolize disabled /Value False checkboxes)

    b_A     x_B     __C     __D     b_E    __F     ………..

    Then I want to continue and mark one more box C:

    b_A     x_B     x_C     __D     b_E    __F     …………..

    The program vill then go to the data base row and retrieve relations. Result will be:

    b_A     x_B     x_C     d_D      b_E    __F     ………….

     Is this possible to achieve?


    Many tanks // Steeri

    PS: Svenska går också bra...

    Saturday, August 23, 2008 10:05 AM

Answers

  • It's absolutely possible. Now, which part do you need help with?

    Mattias, C# MVP
    Monday, August 25, 2008 12:16 PM

All replies

  • It's absolutely possible. Now, which part do you need help with?

    Mattias, C# MVP
    Monday, August 25, 2008 12:16 PM
  •  

    Hi, tanks for the replay and invitation to help me out.

     

    For the first I need an example how to write the code for checking the ten checkboxes for true or false and load the results in to a “variable”. I don’t just want to write a code row fore each box. For example:

     

    If CheckBox1.Checked = True then “box1” = 1 Else “box1” = 0

    If CheckBox2.Checked = True then “box2” = 1 Else “box2” = 0

    If CheckBox3.Checked = True then “box3” = 1 Else “box3” = 0

     

    And so on.

     

    Then I need to now how to take the “variable” whit the ten answers and compare whit the data base. Fore example:

     

    __A     x_B     __C     __D     __E    __F     __G    __H      __I     __J

     

    The “variable” will now have the value of  0,1,0,0,0,0,0,0,0. That will tell us to go to the second row in the data base and get the new “enabled” value True ore False for each of the ten check box.

     

    My data base is a table containing A-J in rows and columns declaring relations between each outer.

                               A                          B                          C                          D                          E                           F

    Row A                True                    False                   False                   True                    True                    True

    Row B                False                   True                    True                    True                    False                   True

    Row C                False                   True                    True                    False                   True                    True

    To Row J

    The return answer will turn all boxes whit false value in the database row 2 to “enabled” value False. The result will be:

     

    __A     x_B     __C     __D     __E    __F     __G    __H      __I     __J

     

    A and E is then disabled and can not be chosen but are visible.

     

    Best regards // Stefan E

    Friday, August 29, 2008 9:01 AM