People who have used these two items will generally find that checklistbox and ListBox are very similar. yes. checklistbox and ListBox are inherited from the same base class. when we need to save the content in checklistbox and ListBox to the database. you can use either of the following methods:
Method 1 for (INT I = 0; I <checklistbox. Count; I ++)
{
Sqlcommand1.commandtext = "insert into groups values ('' "+ checklistbox. value + "'', ''" + ListBox. text + "'', ''" +... others, such as user ID + "'')";
}
Method 2: checklistbox and ListBox have no value or text. therefore, we need to bind the content of checklistbox to the same field of the database (for example, group name). The content of ListBox is also the content of the same field bound to the database (for example, the user email address ), then, enter these in another table.