FormView Null databound value

D

David C

I have a FormView that I want to do something to avoid a data exception.
The control is bound to a SqlDataSource column and is giving me an exception
because it is null. I am using the DropDownCalendar control from Steve Orr
and I have the SelectedDate property bound to a datetime column. Is there
something I can do before data binding to keep from getting this error and
still have the control bound to the SqlDataSource? Thanks.
David
 
P

Phil H

I have a FormView that I want to do something to avoid a data exception.
The control is bound to a SqlDataSource column and is giving me an exception
because it is null. I am using the DropDownCalendar control from Steve Orr
and I have the SelectedDate property bound to a datetime column. Is there
something I can do before data binding to keep from getting this error and
still have the control bound to the SqlDataSource? Thanks.
David

Remove the databinding between the DropDownCalendar control and the
database column. Write some code in the DataBound event to assign the
selected date to the DropDownCalendar on the condition that it is not
null.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top