Cast from string "" to type 'Date' is not valid
-
Hello 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=B4s 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. rs_net
-
Hello 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=B4s 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. rs_net
You can not convert an Emtpy String to a date. C#: if (TextBox1.Text != String.Empty) { // Convert String to Date here }
-
You can not convert an Emtpy String to a date. C#: if (TextBox1.Text != String.Empty) { // Convert String to Date here }
-
hi, Is there anyway to store the empty value like "00/00/0000" or 0 for the datetime column? rs_net
A DateTime structure doesn't have an empty value. You can use some other value to represent that value, like DateTime.MinValue or DateTime.MaxValue. If you store the value in a database, you can set the field to null (DbNull.Value). --- b { font-weight: normal; }
-
Hello 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=B4s 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. rs_net