Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am storing time from datetimepiker in vb.net to sql server in a column with time(2) data type and want to retrieve it in a date time picker in vb.net

What I have tried:

Data Sent to Sql in Query is DtpAddmissionTime.Value
Data Stored in Sql Server is like 22:55:40
Data Calling with command is DtpAddmissionTime.Value = dt.Rows(0).Item(18)
and the error is Conversion from type 'TimeSpan' to type 'Date' is not valid (InvalidCastException was unhandled)
Posted
Updated 13-May-20 22:57pm

1 solution

If you would like to display time only in DateTimePicker control, please read this: How to: Display Time with the DateTimePicker Control - Windows Forms | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900