Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
8
Answers
Error on null values (when format is date)
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Dealy
14y
4.4k
1
Reply
Hello,
how can I handle null values in the following code? The problem is if user don't fill the textfield (end_date.Text) i get an error message even thought END_DATE database field is nullable.
SqlCommand command = new SqlCommand(sproc, conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@END_DATE",SqlDbType.DateTime).Value = Convert.ToDateTime(end_date);
//end_date is a string
Thank you in advance.
Post
Reset
Cancel
Answers (
8
)
Next Recommended Forum
string concatenation in regex C#
Validation of textboxes