How to bind a label in gridview from zero to zero from sql server
Hello everyone, I have an integer value null
in my table, I would like to bind it to the gridview label using 0
, when value null
, for a row nullable
I write this which works fine, but the same with changes does not work, can someone help
<asp:Label ID="lbl" runat="server" Text='<%#(String.IsNullOrEmpty(Eval("call").ToString()) ? "NULL" : Eval("call"))%>'></asp:Label>
The same for Integer I write as follows
<%# string.IsNullOrEmpty(Eval("send2").ToString()) ? "0" : Convert.ToInt16(Eval("send2")).ToString() %>
It didn't work, any help was appreciated
source to share