VBobCat
Well-known member
Hello people,
I have a class which is constructed by a Sub New with parameters.
In this sub, these parameters are used to query a database in search of data that will define new class' properties.
Though unlikely, it may happen that the query returns no elements with such combination defines the entity my class represents.
In this case, I would like the class' construction to be cancelled, so that when program calls
or
then MyClass won't be instantiated and NewClass will remain as Nothing, which I shall test and tell user that he cannot proceed without going back and another part of the app in order to insert data that defines that entity.
Is that possible?
Thank you very much.
I have a class which is constructed by a Sub New with parameters.
In this sub, these parameters are used to query a database in search of data that will define new class' properties.
Though unlikely, it may happen that the query returns no elements with such combination defines the entity my class represents.
In this case, I would like the class' construction to be cancelled, so that when program calls
VB.NET:
Dim NewClass as New MyClass(parameters)
VB.NET:
Dim NewClass as MyClass
NewClass = New MyClass(parameters)
Is that possible?
Thank you very much.