I have a checkbox that is databound to a field in my database and that field is a bit in the database.
This is my Checkbox:
<asp:CheckBox ID="chkDownloaded" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "Downloaded")%>' />
When I run the code I get the following error:
Specified cast is not valid.
Any idea how to fix this?
Thanks!
Option #1
Your request to
Databaseshould be like below….Option #2
In the
Business Logic LayerConverttheDownloadedvalue tofalsein case ofNull.Option #3