Hi,
I just need some advice on the best way to approach a project.
I need to create a form where users can enter data and this then gets written away to a database.
I will have a parent MDI form that lets you create child instances of the form so you can view/enter more than 1 at a time.
Do i create a form that holds or the methods i need for writing the data away and then create instances if this, or should i first be looking at writing a class that then creates an instance of a form. This class would then hold all the methods etc.
Im really just trying to see how anyone else would aproach this and to try and keep it inline with OOP.
Thanks
Loading
Sam HobbsPosted Mar 30, 2012, 6:12 PM
How will the forms be opened? Will each form be used to add, update or delete a record? How will a record be selected for update or deletion?
DavePosted Mar 30, 2012, 6:05 AM
Dave
VulpesPosted Mar 30, 2012, 5:06 AM
If the database code is not too extensive and only needs to be called from one form, then I'd include the methods to do that within the form itself.
Otherwise, I'd hive off the database code into a separate static class - assuming you don't need multiple instances, there's not much point in creating a normal class. You can then call the static methods of this class from any of your forms.