Re: Checkbox = null, Specified cast is not valid.

by Steven Cheng[MSFT] on 11/1/2007 9:07:00 AM Hi rkbnair,

As for the problem here, it seems the "Bind(..)" expression is the cause.
"Bind" is a bi-direction databinding keyword and which only support the
following usage

<%# Bind("columnname or propertyname") %>

You can not use it as an normal expression(just like what you can use on
"Eval" keyword).

Therefore, for the case here, I suggest you consider the following means:

1. provide a default value(false) for your datatable so as to avoid letting
the ASP.NET databinding to handle DBNull Value

2. Manually use code to do update(rather than use "Bind" keyword), you can
still use "Eval" to display the value.

How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

 
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

>Lines: 109
>Message-ID: <2C152B06-C95C-4E14-99C7-E82AA9F401EA@microsoft.com>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>Alexey,
>
>I tried that as well. But no luck.
>
>--
>test
>
>
>