Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had one table named as table_mapping
Table_mapping table contain the all database table fields with the related control name of form
Like
Table: Table_mapping
PK    TableName     FieldName     FormField
Yes     STUDENT     RegNo     txtRegNo
No     STUDENT     RollNo     MaskTextBoxRollNo
No     STUDENT     Name    MaskTextBoxName
Yes     MARKS    RegNo     txtRegno
No     MARKS    SUB1     txtSub1
No     MARKS     SUB2    txtSub2



Other tables are like
STUDENT
Field Name     Data type            PK
RegNo     Unsigned Int(12)     yes
RollNo     Unsigned int(12)     -
Name     Varchar(70)     -

Marks
Field Name    Data type    PK
RegNo     Unsigned Int(12)    yes
RollNo    Unsigned int(12)    -
Name     Unsigned int(12)    -

I am creating one user control that contain save button .
Which is useful for globally save.

I want to write query like”INSERT INTO TABLE (FieldName) VALUES(FormField)”
Here Table name getting from ActiveForm .Tag.toString(),
FieldName getting from query like “SELECT FieldName FROM TableMapping WHERE TableName=’Tabel’ ”
And FormField getting similarly like FieldName from Table Mapping.

I had put the result of FieldName into Insert Query .
Now I need the compare the control list name and FormField , if they match then assign value to them in Insert Query.

Eg.

Like “INSERT INTO STUDENT (Regno, RollNo, Name) VALUES (‘1’, ’1’, ’Mahesh’)”;

Eg.
Like “INSERT INTO MARKS (Regno,Sub1,Sub2) VALUES(‘1’, ‘90’, ’100’)”
Posted
Updated 15-Mar-13 2:43am
v3
Comments
ZurdoDev 15-Mar-13 8:52am    
Sorry, I can't find what your question actually is.
Mahesh_Bhosale 19-Mar-13 1:30am    
want to create one user control like toolbar dll for globally used for insert , update and delete.
ZurdoDev 19-Mar-13 6:54am    
OK, but what is the exact question? What do you need help with?
Mahesh_Bhosale 19-Mar-13 7:17am    
can u give me the example of simple toolbar.dll file
ZurdoDev 19-Mar-13 7:25am    
There are likely samples all over the internet. Create a new project and add a user control and then the toolbar and buttons and code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900