Hi all I have written the following to display the integer values from database to the gridview column as follows
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblTotalReplies" runat="server" Text='<%#Eval("TotalReplies")==System.DBNull ? "0" : Convert.ToInt16(Eval("TotalReplies")).ToString() %>'></asp:Label> Replies</li>
</ItemTemplate>
</asp:TemplateField>
But I am getting an error as System.DBNull' is a 'type', which is not valid in the given context can some one help me how can I display 0 when I am having null value in database. I don’t want to bind using rowdatabound or some other
Compare with DBNull.Value
DBNull is the type, while the Value property