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’)”