By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,382 Members | 2,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,382 IT Pros & Developers. It's quick & easy.

check for null

P: n/a
Why will this not work?
it comes back with an error saying it can't work because the value is null
this is a dataset value retreaved from db and it is null.
call to check for null
Me.txtExtra1.Text = Me.MNS(.usrExtra1)

function to return a default value:
Public Function MNS(ByVal s As Object) As String
If IsDBNull(s) Then
Return String.Empty
Else
Return CType(s, String)
End If
End Function
thnaks
kes
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
just out of curiosity...
Try a compare against System.DBNull.Value

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"WebBuilder451" wrote:
Why will this not work?
it comes back with an error saying it can't work because the value is null
this is a dataset value retreaved from db and it is null.
call to check for null
Me.txtExtra1.Text = Me.MNS(.usrExtra1)

function to return a default value:
Public Function MNS(ByVal s As Object) As String
If IsDBNull(s) Then
Return String.Empty
Else
Return CType(s, String)
End If
End Function
thnaks
kes
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.