[dba-VB] VB.Net - using the new() constructor

Charlotte Foust cfoust at infostatsystems.com
Tue May 22 10:51:34 CDT 2007


Depends on what specifically you're doing.  New returns an initialized
instance of the class, so if you test to see if it's Nothing, that's one
way (if it IS nothing, it failed).  Using a try/catch block in the
calling routine is another way, since any exception will bubble up to
it.  We use both techniques in our shop because we also event log the
exceptions.  

Charlotte Foust

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, May 21, 2007 11:53 AM
To: dba-vb at databaseadvisors.com
Subject: [dba-VB] VB.Net - using the new() constructor

Assuming that you use New() to pass in arguments and do stuff (open a
connection, set up a data adapter etc) how do you verify that those
processes completed correctly?  So you use a flag that says it worked?
Do you simply pass in the connection string and store it, then use a
different function to start the process happening?

John W. Colby
Colby Consulting
www.ColbyConsulting.com

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list