Quantcast
Viewing all articles
Browse latest Browse all 32084

from Listbox1 add the name to listbox2 using button

i get the staff name from data base to listbox1; for that code has follows; SqlConnection con = new SqlConnection("Server=(local);initial catalog=master;Trusted_Connection=True"); private void Btn_Load_Click(object sender, EventArgs e) { string com = " Select Faculty_Name from Faclist"; SqlDataAdapter adpt = new SqlDataAdapter(com, con); DataSet mydataset = new DataSet(); adpt.Fill(mydataset, "Faclist"); DataTable mydatatable = mydataset.Tables[0]; DataRow temprow = null; foreach (DataRow tempRow_Variable in mydatatable.Rows) { temprow = tempRow_Variable; listBox1.Items.Add((temprow["Faculty_Name"])); } } it is working fine. design as follows; Listbox1 ADD Listbox2 ADD ALL Remove Remove ALL output as follows; Lisbox1 (staff name) Button Listbox2 Suresh ADD Ramesh ADD ALL Vigensh when i click the ADD ALL Button all staff name should be added to Listbox2. and Similarily when i select the Suresh (Name) and Click the ADD Button Suresh should be added to Listbox2. how to do please help me.for that how to write the code.help me.

Viewing all articles
Browse latest Browse all 32084

Trending Articles