vendredi 18 octobre 2019

Insert and Update Data from Check Combo-box to SQL server using c#

Combobox-Checkbox

I am new to C#. I Installed a library from NuGet https://www.nuget.org/packages/Common.CheckComboBox/ (Multiple Checkbox with Combo-box). If the checkbox is selected insert 1 in SQL or else 0 is inserted in SQL. In Normal Checkbox, I know how to insert the data but its multiple checkboxes in combo-box help me solve the problem.

Code:

 string[] color = new string[6] { "Blue", "Red", "Orange", "Pink", "White","Grey" };
 for (int i = 0; i < color.Length; i++)
    {
       checkedComboBox1.Items.Add(color[i]);
    }
 checkedComboBox1.SetItemChecked(1, true);



Aucun commentaire:

Enregistrer un commentaire