Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

FormView Null databound value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C - 07 Dec 2007 18:03 GMT
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
Phil H - 08 Dec 2007 21:49 GMT
> 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
[quoted text clipped - 3 lines]
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.