Two Methods of checklistbox and ListBox!

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.