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.