No data is cleared after querying the CS-developed datagridview.

Source: Internet
Author: User

Recently, a query system was developed using CS because you want to view the data and then query it again. If no data is found, the datagridview must be cleared without displaying the originally queried data, by default, the original data is retained, so you need to manually set the data.

The goal is to clear the data source of your dview, but in order to ensure the data format of each column of the datagridview, you can only clear the data of the data source in the future. The format is as follows:

DS. Tables ["dtcustomerinfo"]. Rows. Clear (); // clear data
This. datagridview. datasource = Ds. Tables ["dtcustomerinfo"]; // after data is cleared, the datatable structure mode remains unchanged.

Digress:

It is recommended that you do not select a project signature. Otherwise, when the project manager adds a new reference to the project, a message indicating a signature is prompted and compilation is not possible, unless you develop something independently, do not need to load it to another project, or do business independently, you still need to hook up the signature.

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.