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

VulpesPosted Jun 11, 2013, 9:07 AM
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:
VulpesPosted Jun 11, 2013, 7:30 PM
Ken HPosted Jun 11, 2013, 7:22 PM
thank for vulpes
ken
Ken HPosted Jun 11, 2013, 2:43 AM
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
VulpesPosted Jun 10, 2013, 10:52 AM
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):
Anubhav ChaudharyPosted Jun 10, 2013, 4:07 AM