My first thought is switching to a nullable type (available in 2.0). The
type would be short? in C#, changing the signature to:
ShowParent(short? val)
This may still not work, as the issue may not be in the parameter.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
*********************************************
Think outside the box!
*********************************************
"luqman" <pe*******@cyber.net.pkwrote in message
news:ee**************@TK2MSFTNGP04.phx.gbl...
>I have defined custom binding in DetailView Textbox.
<%# ShowParent(Eval("ParentID")) %>
Its calling a ShowParent() function which is as under:
The problem is that if ParentID field is Null,then the above line passes
the
Null to function and error occurs when converting DBNull to Int16.
How can I detect if ParentID is Null or not ?
Function ShowParent(byVal parentID as Int16) as String
'my code
End Sub
Best Regards,
Luqman