how make a move next command??
-
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.
-
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.
-
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.
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")
-
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")
-
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.
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.
-
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")
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.
-
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.
-
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.
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. :)
-
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.
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
-
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
-
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. :)
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.