Hello,
I have to insert a current date and current time into a database.
I am using vb 2005 and sql 2005.
I am using the above to get the time and the day. I would like to display the date as 1/11/2006 and the time as 10:08.
However, in the database it is showing as:
Date: 10/31/2006 12:00:00 AM
Time: 10/31/2006 9:34:11 PM
I have set the database field to nvarchar(50). I can't have the fields as dateTime, as I don't want to display a pop calandar in my ultragrid.
Is there a problem with the code?
Thanks in advance,
Steve
I have to insert a current date and current time into a database.
I am using vb 2005 and sql 2005.
Code:
Dim time As DateTime
Dim day As DateTime
time = Date.Now.ToShortTimeString()
day = Date.Now.ToShortDateString()
I am using the above to get the time and the day. I would like to display the date as 1/11/2006 and the time as 10:08.
However, in the database it is showing as:
Date: 10/31/2006 12:00:00 AM
Time: 10/31/2006 9:34:11 PM
I have set the database field to nvarchar(50). I can't have the fields as dateTime, as I don't want to display a pop calandar in my ultragrid.
Is there a problem with the code?
Thanks in advance,
Steve