Store current time in Sql database table with column type "time"

Hi,

I want to create a column in my datatable which stores the current time. After that, I want to insert this column data to sql table where column datatype is “time”. Currently, I added a column to my existing datatable as below
image

But it is in string format and the datatype of column of sql is in “time” so there is a mismatch. How can I solve this problem?
Note: I do not want to use any custom library.

Hi @WASEEM_KHAN,
String type and time type are different. Have you tried to push data without parsing it to string?

Here you have some information about SQL date and time data types:
https://www.microfocus.com/documentation/enterprise-developer/ed23/VS2012/GUID-DC5B9C1F-353F-4C08-95DE-E1D825CD65C7.html

@WASEEM_KHAN

You can solve this problem by just changing the datatype of the column to System.TimeSpan also change the default value to Now.TimeOfDay that’s it

image