hi friend,
how to extract the value of dynamically generated controls and generates SQL statements.
you can download attachments view, it provides a detailed description.
Let me be clear, this program is designed to meet the user complex query.
thank very much.
Loading


VulpesRank #55 · 29.2K reputationPosted Jun 11, 2013, 5:07 AM EDT
Also you'll need to store the state of the controls (if the checkbox is checked) when the form closes rather than when the checkbox's checked state changes.
Taking these points into account, I'd try adding the following code (the 'skeleton' handlers for the form's Load and FormClosed events should of course be added from the VS designer rather than manually):
using System.IO;
// ....
private void Form1_Load(object sender, EventArgs e)
// helper methods
Incidentally, I've just noticed a small mistake in my previous post:
Anubhav ChaudharyRank #29 · 42K reputationPosted Jun 10, 2013, 12:07 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 10, 2013, 6:52 AM EDT
In order to identify dynamic controls, you'll need to set their Name properties which I've done. It's also useful to set their Tag property so you can quickly tell which ones have been added dynamically when it comes to removing them.
I've assumed for now that if the values need to be surrounded by single quotes (because they're strings or dates), then the user will include these in the textbox(es):
Ken HRank #2,315 · 610 reputationPosted Jun 10, 2013, 10:43 PM EDT
thank for you,but there is a problem is not resolved,that is how to make the program remember the current dynamically generated controls and user selection or input values.
for example, the user dynamically generate the N controls, then the next time you start the Form, also with N controls and the last entered value.
I try to will current control the number and user input values ??are saved to the configuration file, but failed.
thank for vulpes
Ken
Ken HRank #2,315 · 610 reputationPosted Jun 11, 2013, 3:22 PM EDT
thank for vulpes
ken
VulpesRank #55 · 29.2K reputationPosted Jun 11, 2013, 3:30 PM EDT