Contents
-Introduction-Background-Using the Code-Conclusion-Licensing and Limitation of Liability
Introduction
This User controls uses the following simple controls:textbox , label, button, image (Picture Box).
The purpose of these controls in my case is find the simple way to made dynamic insert queries, I pretend develop for delete query and update query.
The
TextBoxControl
user control permits any value but when receive an empty value display an image standard for error and notifies the empty field, also you can made a simple relation with ButtonsControl control this relation permits that the
TextBoxControl
control will be read it by the ButtonsControl.
Background
When you add the
TextBoxControl
to the form, you can add any as you need and after put into your form the
ButtonsControl
and configure both.
IMPORTANT: The
ButtonsControl
Control doesn't make a connection only create an INSERT string and display in message box if you had enable to True the property ModoTest, if you change to False the control will verify your Database Connection and will insert into the table assigned.
UPGRADE 30-AGO-06: Now you can create insert querys and verify that the regitry that you're triying to insert is not repeat in your data table, also is implemented a delete button, just write the
TextBoxControl
name in the PrimaryKey property field in your
ButtonsControl
.
Using the Code
1. Download the DLL file and, after unzipping, place it in an appropriate folder of your choosing.
2. In the Visual Studio Toolbox, right click in the General Controls tab to open a popup menu. (A form must be open for the control tabs to show in the Toolbox.) Click on the Add/Remove Items menu item.
3. In the Customize Toolbox dialog box, click on the Browse button to open the DLL file.
4. Click the OK button.
How configure these controls?
TextBoxControl
Property
| Type
| Description
|
LabelName
| String
| Get/Set the Label Name
|
TextBoxName
| String
| Get/Set the Textbox Name
|
TextBoxValue
| String
| Get/Set the Textbox Value
|
LabelValue
| String
| Get/Set the Label Value
|
ImageEmptyField
| System.Drawing.Image
| Get/Set the Validation Image
|
TextboxBackColor
| System.Drawing.Color
| Get/Set the Textbox Color
|
TextBoxReadOnly
| Boolean
| Get/Set the Textbox ReadOnly
|
ControlAssociated
| String
| Get/Set the Name of ButtonsControl Associated
|
DBField
| String
| Get/Set the Database Field
|
ButtonsControl
Property
| Type
| Description
|
ConnectionString
| String
| Get/Set the Connection String (not implemented)
|
DBTable
| String
| Get/Set the Database Table
|
TestMode
| Boolean
| Get/Set the Control Mode
|
PrimaryKey
| String
| Get/Set the Table Primary Key
|
Conclusion
With
TextBoxControl
control and
ButtonsControl
control, I can now create records in my data base quickly. I hope you find it useful and if you want to contribute contact me to make this control more robust and flexible for many tasks.
Licensing and Limitation of Liability
You may use all code offered in this article any way you choose without restriction.
Under no circumstances, and under no legal theory, tort, contract, or otherwise, will Roberto Cervantes (hereafter referred to as "software author") or his licensors, be liable to the user of the Double Text library and all code offered in this article (hereafter referred to collectively as "article code") for any damages, including any lost profits, lost data, or other indirect, special, incidental, or consequential damages, arising out of the use or inability to use the article code, and data or information supplied, even if the software author, his licensors, or authorized dealer have been advised of the possibility of such damages, or for any claim by any other party.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.