G
Guest
I have aVB.NET application that uses an SQL Server wrapper class to connect
and perform any and all ADO.NET database activities. This is an MDI child
based application where the child forms are in an MDI tabbed environment. So
when a new MDI child form is displayed, a new tab is created much like VS.NET
2005 development environment.
Is it best to dimension a new SQL wrapper class at the module level of a
child form, or should I be creating a new class in every function that
accesses the database? If done at the function level, in theory, the class is
instantiated, used and then released for garbage collection when the function
terminates. As opposed to creating a new wrapper class at the module level
and using that variable in all the functions that access the database. This
would keep the class in memory until the child form is closed.
There may be many functions (10-15) within a given child form that access
the database. So should there be a Dim Myconn as New SQLWrapperClass in
every function or is it better to create the class once at the module level?
Thanks,
and perform any and all ADO.NET database activities. This is an MDI child
based application where the child forms are in an MDI tabbed environment. So
when a new MDI child form is displayed, a new tab is created much like VS.NET
2005 development environment.
Is it best to dimension a new SQL wrapper class at the module level of a
child form, or should I be creating a new class in every function that
accesses the database? If done at the function level, in theory, the class is
instantiated, used and then released for garbage collection when the function
terminates. As opposed to creating a new wrapper class at the module level
and using that variable in all the functions that access the database. This
would keep the class in memory until the child form is closed.
There may be many functions (10-15) within a given child form that access
the database. So should there be a Dim Myconn as New SQLWrapperClass in
every function or is it better to create the class once at the module level?
Thanks,