こんにちはすべて私はデータベースからグリッドビュー列に整数値を表示するために次のように書いています
<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>
しかし、データベースにnull値がある場合にSystem.DBNull' is a 'type', which is not valid in the given context
表示する方法を教えてくれる人がいるため、エラーが発生します。0
を使ってバインドしたくrowdatabound
ない