Move Up And Down rows in datagridview and update it in database
-
Hi,savers. i can move my row but after binding it will back to the previous state. how can i update it to my database e.g the second row become third row in both datagridview and database and also the ID column become update (resort assending from 1 to the end and 2become3 and 3become2) in my database(i can update that in datagridview by a foreach loop). please help me..... :(( :(( please guide me by your codes :-\ :-\ . thank you in advance.
-
Hi,savers. i can move my row but after binding it will back to the previous state. how can i update it to my database e.g the second row become third row in both datagridview and database and also the ID column become update (resort assending from 1 to the end and 2become3 and 3become2) in my database(i can update that in datagridview by a foreach loop). please help me..... :(( :(( please guide me by your codes :-\ :-\ . thank you in advance.
Add a column to the table and specify a value to determine the order, or create an index. Don't try to "order" rows in a database-table. A database is not meant for direct viewing, and the order in which it is stored is not related to the way it is shown.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
Add a column to the table and specify a value to determine the order, or create an index. Don't try to "order" rows in a database-table. A database is not meant for direct viewing, and the order in which it is stored is not related to the way it is shown.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
thank you so much for your answer. i have to sort them in my database because some calculation will perform in the DBS that data sorting and ID Numbers are very important. thank you any way to care about my question. i'll be grateful if you add your comments if anything else ocured to your mind. :-O :-O :thumbsup:
-
thank you so much for your answer. i have to sort them in my database because some calculation will perform in the DBS that data sorting and ID Numbers are very important. thank you any way to care about my question. i'll be grateful if you add your comments if anything else ocured to your mind. :-O :-O :thumbsup:
Member 13325846 wrote:
i have to sort them in my database
Rows in a database have no particular order. You can specify the order when fetching the rows, or if you want to save a user-defined "order", you add that column. Don't muck with the order that the rows are saved in.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
Member 13325846 wrote:
i have to sort them in my database
Rows in a database have no particular order. You can specify the order when fetching the rows, or if you want to save a user-defined "order", you add that column. Don't muck with the order that the rows are saved in.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Hi, thank you for you guide my friend. best wishes. :rose::rose::rose:
-
Hi, thank you for you guide my friend. best wishes. :rose::rose::rose: