Click here to Skip to main content
15,885,182 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Geeks,

I have one combo box in my form with database value integrate. It's work perfectly for single selection. Now I want to make it multiple selection. How I do this. Please guide me.

What I have tried:

I have tried so many ways but can't find solution.
Posted
Updated 12-Apr-22 8:46am

 
Share this answer
 
CodeProject is your friend: "CheckBox ComboBox Extending the ComboBox Class and Its Items" [^], and read the comments here: [^]
 
Share this answer
 
SqlCommand cmd = new SqlCommand("Select * from Add_Stock", con);
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
comboBox1.Items.Add(ds.Tables[0].Rows[i]["pdetails"] + " " + ds.Tables[0].Rows[i]["batchno"] + " " + Convert.ToDateTime(ds.Tables[0].Rows[i]["expdate"]).ToShortDateString() + " " + ds.Tables[0].Rows[i]["sttokk"]);

}
 
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