Home > Software engineering >  vb.net
vb.net

Time:11-19

Bosses solve me the selected part I don't quite understand

CodePudding user response:

Completely useless code, the estimate is write wrong, not deleted

CodePudding user response:

Temporarily can only judge this is after the Update, refresh the result code, but the refresh code is awful,
Because your myada myconn, mycomm is reuse, so as long as the one-time setup myada. Selectcommand=mycom, mycom. Connection=myconn, open the myconn on that line, all code without setting, back in use also don't need to close the connection,
Mycom.com mandtext set after can directly use myada. The fill (myda), the results query into myda, then put myda bound to the DataGridView, realize the refresh,
Look at the selected the four lines of code, mycom. Connection=myconn excess, front set has been made.
Myda no deposit and the process (should use myada. The fill (myda) to query and store the result, with DataGridView1. The Datasource=myda to implement binding and show data);
Myda. The clear (), excess myda never fill data already, didn't also used data, and even filled is not clear, because the data source if bound to the controls, once the clear, control data will be lost,