Re: Insert date into a datetime column in Visual Basic 2008
- From: "Bob Barrows" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 11 May 2009 21:01:02 -0400
Gum wrote:
I need to insert a date (i.e., "2009/05/12 02:46" or
system.datetime.tostring) into a datetime column using ADO. I got an
error saying that there is a problem converting the string into
datetime.
I am using a SQL string "INSERT insertTB([date],[close])
values('cast(dte as datetime)', 'Fnumber')"
How can I do this insert using the most efficient method?
Why would you think the string 'cast(dte as datetime)' could be inserted
into a datetime column? You do realize that's a literal string, don't you? I
think more of your code is necessary to enable someone to solve your
problem.
Are you using ADO or ADO.Net? If the latter:
***canned wrong-newsgroup reply************************
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) ADO newsgroup.
ADO.Net bears very little resemblance to classic ADO so, while you may be
lucky enough to find a dotnet-knowledgeable person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.adonet.
..******************************************************************
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Follow-Ups:
- References:
- Prev by Date: Insert date into a datetime column in Visual Basic 2008
- Next by Date: Re: Insert date into a datetime column in Visual Basic 2008
- Previous by thread: Insert date into a datetime column in Visual Basic 2008
- Next by thread: Re: Insert date into a datetime column in Visual Basic 2008
- Index(es):
Relevant Pages
|