|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cast from string "" to type 'Date' is not validHello all,
I have a textbox in my asp.net (vb.net) aplicattion, I need to assign it's value to a Variable of type DATE, but it's not a required field, so sometimes I want to send a blank field. I declared a variable as a date datatype and when it´s going to receive the content of the text field, it shows the following error "Cast from string "" to type 'Date' is not valid" What should I do to handle this problem. ZafZal,
It depends if the receiving field is a db field, than it has to be DbNull.value if the receiving field is a net datatime, than you can use = nothing (which makes from it something as 1-1-1 1:1:1) I hope this helps, Cor If you are using 2.0, you can look into the Nullable Date type
Dim MyDate as Nullable(Of Date) Using objects, I often expose the date property as a string and handle the validity of the date as a business rule. Jim Wooley <zaf***@gmail.com> wrote in message news:1138959745.470834.49000@g49g2000cwa.googlegroups.com... I have a textbox in my asp.net (vb.net) aplicattion, I need toHello all, assign it's value to a Variable of type DATE, but it's not a required field, so sometimes I want to send a blank field. I declared a variable as a date datatype and when it´s going to receive the content of the text field, it shows the following error "Cast from string "" to type 'Date' is not valid" What should I do to handle this problem.
Search Arraylist in Arraylist.
Newbie Question: How To Open A File Non-Exclusively? Saving a Database to Disk PropertyBag in VB.NET? Windows Form Application Help Command line argument in NET unexpected split functionality - index out of bounds Accessing controls from another thread Executing a DTS package VS2005-VB Viewing 'Main' for MDIParent |
|||||||||||||||||||||||