Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I Know The Answer Is Probably Something very Easy But I'll Ask Anyway:

 

I Am Upgrading A Project Which Have A Field Of Type Date

And Some Of The Records R Null In It.

When I Try To Bind The Date Field To A DateTimePicker It Thorws Me An Error Because The DateTimePicker Can't Get Null As A Value.

 

I Am Trying To Make The DateTimePicker Get The Null Value And Show An Empty Text And That It Will Return A Null If The Text Is Empty.

 

I Hope Somebody Can Tell Me A Way To Do This

Thank U

  • 3 weeks later...
  • *Experts*
Posted

If you're using binding, you'll have to implement the Format and Parse events. The Format will have to convert the System.DBNull.Value to an empty string (or whatever the DateTime picker wants for a blank value). The Parse will have to convert the empty string to System.DBNull.Value.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...