The old NZ function....

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hi,

Is there an equivalent to the old NZ function from VB6?

Cheers...Paul
 
Hi,

not really but it's pretty trivial task to write such yourself. Like:

Public Class NZ
Public Shared Function ToString(ByVal obj As Object,replaceValue As
String) As String
If Convert.IsDBNull(obj) Then
Return replaceValue
Else
Return obj.ToString()
End If
End Function
'...
End Class

for working with strings. Then of course similar for every type you wish to
work with. With Convert.IsDBNull you can check if value equals to
DBNull.Value and utilize it.
 

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