initialising Properties correctly

C

Craig G

i use a class for all by database actions, the class has the following
properties
Private m_intDrugid As Integer
Private m_intInumber As Integer
Private m_intEnumber As Integer
Private m_strDrugname As String
Private m_strDoseage As String

i'm having problems when i assign all of the values in the properties to a
method that inserts a record in a Oracle(7) table via a stored proc

not all of the values need to be populated, i.e. they can be Nulls. problem
is. how do i set them to Null so that the it will insert the record
correctly. if i populate all the properties the method will fire
sucessfully.

is there a way to initialise them to the correct Null so to speak

Cheers,
Craig
 
S

Scott Allen

Craig:

You can assign Nothing to a String field to represent null, but it's
not possible to assign Nothing to a value type like an Integer. If you
need a nullable field you might need to make the field type Object, or
wrap an Integer inside of a new class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top