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. problem in Range selection

problem in Range selection

Scheduled Pinned Locked Moved C#
csharpdatabasehelp
12 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.
  • S Offline
    S Offline
    sailesh_gupta
    wrote on last edited by
    #1

    hi , can any one help me out in selection of range. for exmaple we have two list consisting of 1 to 10 each from first list we have selected 3 and other 7 in the second transaction we cannot have a rane say from 2 to 5. Also when we log off the application and log in again we should see that we do not interect the selected ranges. i have sql database for storage application and developing application on c#.net. pls help urgent :(

    C 1 Reply Last reply
    0
    • S sailesh_gupta

      hi , can any one help me out in selection of range. for exmaple we have two list consisting of 1 to 10 each from first list we have selected 3 and other 7 in the second transaction we cannot have a rane say from 2 to 5. Also when we log off the application and log in again we should see that we do not interect the selected ranges. i have sql database for storage application and developing application on c#.net. pls help urgent :(

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I can't follow the logic of what you want. Why can't you go from 2-5, how does that relate to 3 and 7 ?

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 1 Reply Last reply
      0
      • C Christian Graus

        I can't follow the logic of what you want. Why can't you go from 2-5, how does that relate to 3 and 7 ?

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        S Offline
        S Offline
        sailesh_gupta
        wrote on last edited by
        #3

        select x = a if x falls in the range 3-7 then its illogical to have select x=b if x falls in range 2-5 coz in such case x would satisfy both the condition.

        C 1 Reply Last reply
        0
        • S sailesh_gupta

          select x = a if x falls in the range 3-7 then its illogical to have select x=b if x falls in range 2-5 coz in such case x would satisfy both the condition.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          So what you really mean is that your second selection and your first can't be the same value ? 2 is not in the range 3-7

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S 1 Reply Last reply
          0
          • C Christian Graus

            So what you really mean is that your second selection and your first can't be the same value ? 2 is not in the range 3-7

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            S Offline
            S Offline
            sailesh_gupta
            wrote on last edited by
            #5

            what i mean that no two selection range should intersect each other. for eg:- range is 3-5 5-7 and not like 2-5 3-6 coz the value four falls in both the selection which is not possible

            C C 2 Replies Last reply
            0
            • S sailesh_gupta

              what i mean that no two selection range should intersect each other. for eg:- range is 3-5 5-7 and not like 2-5 3-6 coz the value four falls in both the selection which is not possible

              C Online
              C Online
              CPallini
              wrote on last edited by
              #6

              Well this is partitioning a (discrete) interval in not intersecting intervals. What is your trouble about (please detail)? BTW are you voting down Christian?

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

              S 1 Reply Last reply
              0
              • S sailesh_gupta

                what i mean that no two selection range should intersect each other. for eg:- range is 3-5 5-7 and not like 2-5 3-6 coz the value four falls in both the selection which is not possible

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                OK - so how do the ranges get selected, by selecting a group from both drop downs ? I guess you can just check when the second range is selected, if it intersects. This seems trivial to me. Where is the issue ?

                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                1 Reply Last reply
                0
                • C CPallini

                  Well this is partitioning a (discrete) interval in not intersecting intervals. What is your trouble about (please detail)? BTW are you voting down Christian?

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                  S Offline
                  S Offline
                  sailesh_gupta
                  wrote on last edited by
                  #8

                  the problem statement is i have two combo box's named max and min and a text box for entering value. in max we have values range from 0 - 10 and similarliy we have in min. now user has to select range from both the combo box. like he can select min to be 4 and max to be 7 and value for this range to be some X%. Now i have to restrcit user from selecting min to be 2 and max to be 6. When the user closes the application and restarts it we should see that the above condition entered before logging off is validated before entering the new ranges. i have sql database and using a application is begn developed using .NET C# YEs i m rating down cris

                  C 1 Reply Last reply
                  0
                  • S sailesh_gupta

                    the problem statement is i have two combo box's named max and min and a text box for entering value. in max we have values range from 0 - 10 and similarliy we have in min. now user has to select range from both the combo box. like he can select min to be 4 and max to be 7 and value for this range to be some X%. Now i have to restrcit user from selecting min to be 2 and max to be 6. When the user closes the application and restarts it we should see that the above condition entered before logging off is validated before entering the new ranges. i have sql database and using a application is begn developed using .NET C# YEs i m rating down cris

                    C Online
                    C Online
                    CPallini
                    wrote on last edited by
                    #9

                    sailesh_gupta wrote:

                    i have two combo box's named max and min and a text box for entering value.

                    OK. that's fine.

                    sailesh_gupta wrote:

                    n max we have values range from 0 - 10 and similarliy we have in min.

                    That's good (possibly min should range 0-9 and max 1-10).

                    sailesh_gupta wrote:

                    now user has to select range from both the combo box.

                    That is not clear. Do you mean:"The user has to define a range by selecting min and max values?"

                    sailesh_gupta wrote:

                    Now i have to restrcit user from selecting min to be 2 and max to be 6.

                    Why? This point is very obscure.

                    sailesh_gupta wrote:

                    When the user closes the application and restarts it we should see that the above condition entered before logging off is validated before entering the new ranges.

                    Due to previous cluttered statements that is not clear.

                    sailesh_gupta wrote:

                    i have sql database and using a application is begn developed using .NET C#

                    That's fine.

                    sailesh_gupta wrote:

                    YEs i m rating down cris

                    That's an unbelieveble mistake. The reason you can't get help is all in your obscure descriptions. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                    S 1 Reply Last reply
                    0
                    • C CPallini

                      sailesh_gupta wrote:

                      i have two combo box's named max and min and a text box for entering value.

                      OK. that's fine.

                      sailesh_gupta wrote:

                      n max we have values range from 0 - 10 and similarliy we have in min.

                      That's good (possibly min should range 0-9 and max 1-10).

                      sailesh_gupta wrote:

                      now user has to select range from both the combo box.

                      That is not clear. Do you mean:"The user has to define a range by selecting min and max values?"

                      sailesh_gupta wrote:

                      Now i have to restrcit user from selecting min to be 2 and max to be 6.

                      Why? This point is very obscure.

                      sailesh_gupta wrote:

                      When the user closes the application and restarts it we should see that the above condition entered before logging off is validated before entering the new ranges.

                      Due to previous cluttered statements that is not clear.

                      sailesh_gupta wrote:

                      i have sql database and using a application is begn developed using .NET C#

                      That's fine.

                      sailesh_gupta wrote:

                      YEs i m rating down cris

                      That's an unbelieveble mistake. The reason you can't get help is all in your obscure descriptions. :)

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                      S Offline
                      S Offline
                      sailesh_gupta
                      wrote on last edited by
                      #10

                      sailesh_gupta wrote: now user has to select range from both the combo box. That is not clear. Do you mean:"The user has to define a range by selecting min and max values?" yes you got it right. also sailesh_gupta wrote: Now i have to restrcit user from selecting min to be 2 and max to be 6. Why? This point is very obscure. i have to restrict the user from selecting the range between 2 to 6 because he has already selected a a range from 3 to 5. which means i should selectthe value of x = a if x lies between 3-5.this condition is set by user using the application. during the next time user cannot put a condition that select x = b if x lies between 2to 6 beacuse already a condition exist. i.e if both the constraint are there and input value is 4 what will be the value of x using the constarint.

                      C 1 Reply Last reply
                      0
                      • S sailesh_gupta

                        sailesh_gupta wrote: now user has to select range from both the combo box. That is not clear. Do you mean:"The user has to define a range by selecting min and max values?" yes you got it right. also sailesh_gupta wrote: Now i have to restrcit user from selecting min to be 2 and max to be 6. Why? This point is very obscure. i have to restrict the user from selecting the range between 2 to 6 because he has already selected a a range from 3 to 5. which means i should selectthe value of x = a if x lies between 3-5.this condition is set by user using the application. during the next time user cannot put a condition that select x = b if x lies between 2to 6 beacuse already a condition exist. i.e if both the constraint are there and input value is 4 what will be the value of x using the constarint.

                        C Online
                        C Online
                        CPallini
                        wrote on last edited by
                        #11

                        Well, I think you need to re-design a bit your application. probably you need to let the user to define a set of classes partitioning the range. For instance (Assuming adjacent interval classes):

                        Class min max assigned value
                        1 0 2 a
                        2 3 5 b
                        3 6 9 c
                        4 10 10 d

                        You can do that in several ways, neverthless a simple approach is the following: the program starts with one default class

                        Class min max assigned value
                        1 0 10 a

                        The user may choose to split the interval by choosing the discriminator value, suppose 3, this will produce:

                        Class min max assigned value
                        1 0 3 a
                        2 4 10 b

                        and so on. Note that user may only choose the descriminator (and class assigned value, i.e. a, b,...) properly rearranging intervals it is a program duty. Hope that helps. :)

                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                        S 1 Reply Last reply
                        0
                        • C CPallini

                          Well, I think you need to re-design a bit your application. probably you need to let the user to define a set of classes partitioning the range. For instance (Assuming adjacent interval classes):

                          Class min max assigned value
                          1 0 2 a
                          2 3 5 b
                          3 6 9 c
                          4 10 10 d

                          You can do that in several ways, neverthless a simple approach is the following: the program starts with one default class

                          Class min max assigned value
                          1 0 10 a

                          The user may choose to split the interval by choosing the discriminator value, suppose 3, this will produce:

                          Class min max assigned value
                          1 0 3 a
                          2 4 10 b

                          and so on. Note that user may only choose the descriminator (and class assigned value, i.e. a, b,...) properly rearranging intervals it is a program duty. Hope that helps. :)

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                          S Offline
                          S Offline
                          sailesh_gupta
                          wrote on last edited by
                          #12

                          THANKS A LOT .... I GOT THE SOLUTION

                          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