Hi,
I am trying to run the follwoing SQL command using an SQLCommand object,
Insert INTO RearTrace (ID_Production,Date,Barcode,PartNumber,PartDescription) VALUES ('168570',Convert(char,'28/07/2003 16:34:58',13),'PC000001','PC000001','LABEL 85X209.6')
but i get the following error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
Int32 ExecuteNonQuery()
If i copy and paste the SQL into SQL server query analyser it runs fine. Can canyone tell me why?
Neil
I am trying to run the follwoing SQL command using an SQLCommand object,
Insert INTO RearTrace (ID_Production,Date,Barcode,PartNumber,PartDescription) VALUES ('168570',Convert(char,'28/07/2003 16:34:58',13),'PC000001','PC000001','LABEL 85X209.6')
but i get the following error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
Int32 ExecuteNonQuery()
If i copy and paste the SQL into SQL server query analyser it runs fine. Can canyone tell me why?
Neil