Re: String was not recognized as a valid DateTime
- From: "Miha Markic [MVP C#]" <miha at rthand com>
- Date: Tue, 28 Feb 2006 14:15:48 +0100
Hi Herby,
You should really look into parametrised queries (instead of concatenating
sql commands you would pass values as parameters).
There is plenty of docs on the topic and you might start from .net help
file.
--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
"Herby" <prmarjoram@xxxxxxxxx> wrote in message
news:1141129035.383857.188990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi im relatively new to both .NET and ADO.NET.
Im having a problem with dates when using SQL.
I have something like:
effective_date = '1/1/1990'
Iv then tried things like
effective_date = {ts '1990-01-01 00:00:00'}
Whatever i try i keep getting the following exception.
String was not recognized as a valid DateTime
Is there not some conversion routine, whereby if i give it some ad-hoc
string which represents a date in its many forms i.e. 1-1-1990, it will
return me the correct format to use in an SQL expression????
Thanks.
.
- Follow-Ups:
- References:
- String was not recognized as a valid DateTime
- From: Herby
- String was not recognized as a valid DateTime
- Prev by Date: Re: SQL Server Express - Detach & Shrink
- Next by Date: Re: String was not recognized as a valid DateTime
- Previous by thread: String was not recognized as a valid DateTime
- Next by thread: Re: String was not recognized as a valid DateTime
- Index(es):
Relevant Pages
|
|