Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
frens i have two tables consisting of similar fields , i have two list boxes in the form. for the first time i will save all the data in one table, as soon as i save one value of item will be displayed in the listbox1 for example "itemname". now i will move the item name from one list box to another,and the listbox1 will not contain that item name. now wat i want to do is, i want to save the item with the values which i moved to listbox2 in the second table with all the previosouly entered values. someone pls see that if u can help me with codeing part.


Thank you
Posted

K. Just write a code in sql to retrieve information of itemname (which you moved form listbox1 to listbox2) from table1 and insert it to table2 in the following manner

SQL
Insert into table2[column_names]
Select [column_names] from table1 where [column_name] = @parameter
/* 
Here column_names means what the columns you want to insert.
@paramenter means itemname you want to pass form listbox.  user stored procedure to increase performance and avoid security leaks in the application.
column_name means what is the column you are looking for.
*/
 
Share this answer
 
Before you get to any of the possible solutions do yourself a favor, read and understand this: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900