Re: Eval - DBNull - ObjectDataSource
- From: "Konstantinos Pantos" <kostas_pantos@xxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 18:12:41 +0200
Have you tried
<asp:HyperLink ID="HyperLink2" runat="server" Visible='<%# !Convert.IsDBNull(Eval("someID")) %>' NavigateUrl="#">My Link</asp:HyperLink>?
"Alexander Widera" <awid@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:O7m0dnLDHHA.4992@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
i'm using an asp:Reader and an ObjectDataSource. With this I get some strings and integer-values... but some of the intergervalues could be a <DBNull>-value.
In the repeater is a link, which should only be visible, if the an integer-value isn't null (dbnull) (the value should be a number!).
I've tried much, but nothing worked. I get always an error-message with an exception, that says, that the intergervalue is DBNull.
here is the code of the last try:
<asp:HyperLink ID="HyperLink2" runat="server" Visible='<%#
Eval("someID")!=DBNull.Value %>' NavigateUrl="#">My Link</asp:HyperLink>
I tried also:
((int?)Eval("someID")).HasValue
no success until now.
Could someone help me please?
thanks a lot,
Alex
.
- Follow-Ups:
- Re: Eval - DBNull - ObjectDataSource
- From: Alexander Widera
- Re: Eval - DBNull - ObjectDataSource
- References:
- Eval - DBNull - ObjectDataSource
- From: Alexander Widera
- Eval - DBNull - ObjectDataSource
- Prev by Date: Mysql5 + Select command, function and datareader
- Next by Date: aspnet_regiis.exe -ir -enable destroys perf counters?
- Previous by thread: Eval - DBNull - ObjectDataSource
- Next by thread: Re: Eval - DBNull - ObjectDataSource
- Index(es):
Relevant Pages
|