c# - What is the best way to reduce assignations from DataSets to WinForm Controls -


i have several entities like: customer, products, order, orderdetails, employees, etc. each 1 has window form crud capabilities.

the problem i'm having i'm coding lot of lines when passing data dataset controls viceversa.

search() {  dataset dsresult = server.invokesearch();  txtcustname.txt = dsresult.tables["customer"].rows[0]["custname"];  ... //like 50 columns  txtaddress.txt = dsresult.tables["customer"].rows[0]["address"]; }  save() {  dsupdate.tables["customer"].rows[0]["custname"] = txtcustname.txt;  ... //like 50 columns  dsupdate.tables["customer"].rows[0]["address"] = txtaddress.txt; server.update(dsupdate); } 

it ve nice if control has way retrieve value if specify table.column like:

txtcustname.dbcolumn = "customer.custname"; search() { mainds = server.invokesearch(); } update() { server.update(mainds); } 

i'm complety lost. have no idea topics should search & investigate. tips, help, links , examples welcome.

did explore winforms data binding possiblities ? allow directly map controls data source.


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -