Dynamically create form or windows user control for database table

  • Thread starter Thread starter Aaron Prohaska
  • Start date Start date
A

Aaron Prohaska

Does anyone have any suggestions for how to create a win form or user
control based on the schema of a database table. I'm asking this
question because I would like to create add/edit forms for each table
I have in my database without having to hand code the form for every
table in the system. I have over 30 tables that need data entry forms,
but coding a form or usercontrol for each table would is going to be a
huge amount of work. Any ideas would be greatly appreciated.

thanks,

Aaron
 
Can you use the wizard? In VB.Net... File - Add New Item - Data Form Wizard. This will allow you to select the table and records.

--
Brian P. Hammer
Does anyone have any suggestions for how to create a win form or user
control based on the schema of a database table. I'm asking this
question because I would like to create add/edit forms for each table
I have in my database without having to hand code the form for every
table in the system. I have over 30 tables that need data entry forms,
but coding a form or usercontrol for each table would is going to be a
huge amount of work. Any ideas would be greatly appreciated.

thanks,

Aaron
 
one option could be to use the data grid control. It would have it's
datasource property set to the data table.

Another but a tedious option would be to loop through the columns of the
table and then write code to generate labels and textboxes. in this case,
you would have to set the location, size etc. properties yourself.
 
Back
Top