I have a stored procedure as follows:
However I want to ensure that the date time format from SQL Server is in UK format i.e. dd/mm/yyyy hh:mm:ss however when I use the code below it gives me an error when trying to convert the date time returned from SQL.
Can anyone help???
Thanks in advance
Simon
VB.NET:
CREATE PROCEDURE [dbo].[spQrySQLDate]
AS
SELECT GETDATE() as SQLDate
GO
However I want to ensure that the date time format from SQL Server is in UK format i.e. dd/mm/yyyy hh:mm:ss however when I use the code below it gives me an error when trying to convert the date time returned from SQL.
VB.NET:
Dim myCmdDate As New OleDb.OleDbCommand("spQrySQLDate")
myCmdDate.CommandType = CommandType.StoredProcedure
myReaderDate = myDB.RunMyDataQuery(myCmdDate)
' Gets license validate information from database
Dim strDate As String = Nothing
Do While myReaderDate.Read
strDate = (myReaderDate.Item("SQLDate"))
Loop
Dim strServerDateTime As String = strDate.ToString("dd/MM/yyyy hh:mm:ss")
Can anyone help???
Thanks in advance
Simon