Visual Studio automatically generates query images and C # code based on the table structure
Principle:
1. Compile the VS plug-in through C #; call the VS designer; create controls and code
2. the SQL code parses the query conditions using regular expressions and generates controls.
3. Use the SQL code to obtain the queried DataTable and DataColumn. Then, create a Grid.
The Code is as follows:
IDesignerHost host; host of the VS designer
Form forhm = (Form) host. RootComponent; get the interface of the designer
You can create a widget in either of the following ways:
1. dynamically create controls (such as new Button () through C ())
= = = = System.Drawing.Size(, = System.Drawing.Point(, (Line + ) * + (Line + ) * + = TypeDescriptor.GetProperties(btn1).Find(, );
2. dynamically create controls through reflection
Control cl == System.Drawing.Point(= == System.Drawing.Size(, = System.Drawing.Point( + + ColV * - cl.Size.Width - , (LineV + ) * + LineV * + = TypeDescriptor.GetProperties(cl).Find(, = TypeDescriptor.GetProperties(cl).Find(, + rd[].ToString());
Dynamic code creation
======);
Note:
Before creating a control, you must reference the DLL used by this control to the VS project.
Run the following command:
1. Original Design Interface of
2. Start the VS plug-in and set SQL statements
3. Set the SQL condition name
4. automatically generated interface
5. automatically generated C # code