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. Web Development
  3. ASP.NET
  4. how make a move next command??

how make a move next command??

Scheduled Pinned Locked Moved ASP.NET
questiontutorial
12 Posts 4 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.
  • M Offline
    M Offline
    meki_2118
    wrote on last edited by
    #1

    Hi, How can I create a move next command in web development??? Dim DS As New DataSet TextBox1.Text = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() + 1).Item("ITEM_NAME") This code that I've used just give a move last command and i can't figure out how to the move next so that I can look for the items in my data base one-by-one. can you give me some solution? Thanks a lot in advance.

    B N C 3 Replies Last reply
    0
    • M meki_2118

      Hi, How can I create a move next command in web development??? Dim DS As New DataSet TextBox1.Text = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() + 1).Item("ITEM_NAME") This code that I've used just give a move last command and i can't figure out how to the move next so that I can look for the items in my data base one-by-one. can you give me some solution? Thanks a lot in advance.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      do you want to show the ITEM_NAME one by one in textbox?

      Cheers!! Brij

      M 1 Reply Last reply
      0
      • B Brij

        do you want to show the ITEM_NAME one by one in textbox?

        Cheers!! Brij

        M Offline
        M Offline
        meki_2118
        wrote on last edited by
        #3

        yes, that's what I'm trying to do. But the code that I've used only showed me the last item in my query.

        B 1 Reply Last reply
        0
        • M meki_2118

          Hi, How can I create a move next command in web development??? Dim DS As New DataSet TextBox1.Text = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() + 1).Item("ITEM_NAME") This code that I've used just give a move last command and i can't figure out how to the move next so that I can look for the items in my data base one-by-one. can you give me some solution? Thanks a lot in advance.

          N Offline
          N Offline
          Nishant Singh
          wrote on last edited by
          #4

          Keep a Global Variable and increment it's value when u click on MoveNext Global Variable intGlobalCount TextBox1.Text = DS.Tables(0).Rows(intGlobalCount ).Item("ITEM_NAME")

          M C 2 Replies Last reply
          0
          • N Nishant Singh

            Keep a Global Variable and increment it's value when u click on MoveNext Global Variable intGlobalCount TextBox1.Text = DS.Tables(0).Rows(intGlobalCount ).Item("ITEM_NAME")

            M Offline
            M Offline
            meki_2118
            wrote on last edited by
            #5

            how can i declare this Global Variable?

            1 Reply Last reply
            0
            • N Nishant Singh

              Keep a Global Variable and increment it's value when u click on MoveNext Global Variable intGlobalCount TextBox1.Text = DS.Tables(0).Rows(intGlobalCount ).Item("ITEM_NAME")

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

              Global variables are ALWAYS a sign of bad design and bad programming. In any case, where would he keep it so that it maintains it's state between postbacks ?

              Christian Graus Driven to the arms of OSX by Vista.

              M 1 Reply Last reply
              0
              • M meki_2118

                Hi, How can I create a move next command in web development??? Dim DS As New DataSet TextBox1.Text = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() + 1).Item("ITEM_NAME") This code that I've used just give a move last command and i can't figure out how to the move next so that I can look for the items in my data base one-by-one. can you give me some solution? Thanks a lot in advance.

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

                Well, the basic issues you have are: 1 - you are requesting the last row ( actually one past ), so that's what you see 2 - as it's a website, if you want the user to click next, and then see a new record, what you're doing is very wasteful. Why not just request the row you want to see ? 3 - the best place for you to store an index of the current record, is the URL. The second best, is viewstate. A static variable is an idiotic idea, it will break your site as soon as you have two users.

                Christian Graus Driven to the arms of OSX by Vista.

                M 1 Reply Last reply
                0
                • C Christian Graus

                  Global variables are ALWAYS a sign of bad design and bad programming. In any case, where would he keep it so that it maintains it's state between postbacks ?

                  Christian Graus Driven to the arms of OSX by Vista.

                  M Offline
                  M Offline
                  meki_2118
                  wrote on last edited by
                  #8

                  yes your right. I've tried to make a variable to act like a counter but ever time the page will postback, the value of the counter will return to its original value.

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    Well, the basic issues you have are: 1 - you are requesting the last row ( actually one past ), so that's what you see 2 - as it's a website, if you want the user to click next, and then see a new record, what you're doing is very wasteful. Why not just request the row you want to see ? 3 - the best place for you to store an index of the current record, is the URL. The second best, is viewstate. A static variable is an idiotic idea, it will break your site as soon as you have two users.

                    Christian Graus Driven to the arms of OSX by Vista.

                    M Offline
                    M Offline
                    meki_2118
                    wrote on last edited by
                    #9

                    yeah. but actually I'm just trying to get the logic of how to check the item one-by-one. Because I'm trying to make a loop statement that will check for the item one-by-one and arrange it in a hierarchy arrangement in my repeater. But if you could give some other alternative and easiest way to do this, that will be a huge help. :)

                    C 1 Reply Last reply
                    0
                    • M meki_2118

                      yes, that's what I'm trying to do. But the code that I've used only showed me the last item in my query.

                      B Offline
                      B Offline
                      Brij
                      wrote on last edited by
                      #10

                      You can do onething Start from 0,increment it and save it in viewstate then next commond take the value from viewstate and show it again same way increment and save it viewstate .Do the same till last element.And show the value like below TextBox1.Text = DS.Tables(0).Rows(int.Parse(viewstate["counter"])).Item("ITEM_NAME")

                      Cheers!! Brij

                      M 1 Reply Last reply
                      0
                      • B Brij

                        You can do onething Start from 0,increment it and save it in viewstate then next commond take the value from viewstate and show it again same way increment and save it viewstate .Do the same till last element.And show the value like below TextBox1.Text = DS.Tables(0).Rows(int.Parse(viewstate["counter"])).Item("ITEM_NAME")

                        Cheers!! Brij

                        M Offline
                        M Offline
                        meki_2118
                        wrote on last edited by
                        #11

                        Brij wrote:

                        TextBox1.Text = DS.Tables(0).Rows(int.Parse(viewstate["counter"])).Item("ITEM_NAME")

                        I've tried your code but there are some errors. The "int" can't be loaded and there's a identifier need in the ["counter"] part. :(

                        1 Reply Last reply
                        0
                        • M meki_2118

                          yeah. but actually I'm just trying to get the logic of how to check the item one-by-one. Because I'm trying to make a loop statement that will check for the item one-by-one and arrange it in a hierarchy arrangement in my repeater. But if you could give some other alternative and easiest way to do this, that will be a huge help. :)

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

                          The whole point of a repeater is that you define a single template, then bind to a data source, and it takes care of that. If your data is heirarchical, then you need to nest repeaters and create a data source that presents the data in a logical way. However, this question is pretty much totally unrelated to what you asked inthe first instance.

                          Christian Graus Driven to the arms of OSX by Vista.

                          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