How do people deal with datasets, textboxes and DBNulls?
Woof
Printable View
How do people deal with datasets, textboxes and DBNulls?
Woof
Verrry carefully....
Actualy, I don't allow DBNulls to reach the application. Since I use stored proces for everything, I wrap all my fields (when applicable) with ISNULLs.
Tg
if you don't us isnull, then i would write the function below (make sure it's public)
private sub BindPageData()
txtFirstName.Text = convertdbnulltostring(row("FirstName"))
end sub
'on some module page
public function convertdbnulltostring(obj as object) as object
if isdbnull(obj) then
return ""
else
return obj
end if
end function