integer initialization messing up params

  • Thread starter Thread starter Dan Christie
  • Start date Start date
D

Dan Christie

I am using the standard microsoft data access help class
which contains a helper function for attaching parameters
to a command object. The function contains the following:

If p.Direction = ParameterDirection.InputOutput And
p.Value Is Nothing Then
p.Value = Nothing
End If

This works well for all of my data types except for
integers which initialize at zero. I'd like to keep the
value at null in the database if I don't supply a value. I
could test for zero on an integer data type and set the
value to nothing, but I may have some cases where zero is
the value the client sets. How are people doing this? I am
setting the parameter values using properties in the same
object.

Thanks,

Dan
 

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

Back
Top