Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I would like to know the binding technique for a text field and an array element in Win forms using C#. Here is the scenario.

I am having a Form with some controls loading dynamically and some statically. For dynamic controls, i get details from a DB-table as attribute id,name, data type and Control type. But the values entered into these controls have to be stored into another DB-Table. Now how do i achieve the binding in this context?
Posted
Comments
BillWoodruff 4-Nov-11 6:03am    
So, why cannot the code that does the transfer of values from one DataTable to another update the TextBox or some other control.

What exactly do you mean by "array element:" how does that relate to the two DB-Tables ?
SridharaReddyK 8-Nov-11 4:36am    
Sorry for delay as it was week-end.

The ATTRIBUTE table gives the ID,NAME,CONTROL-TYPE & DATA-TYPE. Each attribute data entered in the text boxes need to be saved into another table in which the column name is the attribute name. Hence the data entered into the text fields need to be saved into the another table instead of attribute table.

What i propose is to have an array for attributes from which GUI can be generated dynamically and also data is stored into the DB by mapping these array elements to the controls generated dynamically and binding them.

Hope u got it.

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