Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ADO Parameter of The Wrong Type

Reply
Thread Tools

ADO Parameter of The Wrong Type

 
 
Gargamel
Guest
Posts: n/a
 
      11-06-2003
Hiya.

I've taken over the development of a web app written in ASP. It's not
very well coded. In the live environment it's fine, but on my local
machine it falls over whenever it tries to pass a date to a SQL Server
sproc. No idea why the person before me's been doing all this string
formatting with his dates, but anyway, the error is:

Application uses a value of the wrong type for the current operation.

The dates throughout are in mmddyyyy format, and presumably ADO
running on my local machine wants ddmmyyyy. I'm rebuilding the whole
app in C#.Net anyway so I don't think it's worth me running through
and making this jumble of code international date friendly, so my
question is, where exactly is the date format for ADO defined?
Windows? SQL Server?

Thanks loads!

Gargamel.
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      11-06-2003
Gargamel wrote:
> Hiya.
>
> I've taken over the development of a web app written in ASP. It's not
> very well coded. In the live environment it's fine, but on my local
> machine it falls over whenever it tries to pass a date to a SQL Server
> sproc. No idea why the person before me's been doing all this string
> formatting with his dates, but anyway, the error is:
>
> Application uses a value of the wrong type for the current operation.
>
> The dates throughout are in mmddyyyy format, and presumably ADO
> running on my local machine wants ddmmyyyy. I'm rebuilding the whole
> app in C#.Net anyway so I don't think it's worth me running through
> and making this jumble of code international date friendly, so my
> question is, where exactly is the date format for ADO defined?
> Windows? SQL Server?
>
> Thanks loads!
>
> Gargamel.


http://www.aspfaq.com/show.asp?id=2040


HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
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"


 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      11-06-2003
Hi,

It depends...

Each user has their own settings, and ASP, IIS, and SQL Server can all be
running under different user accounts (for an extreme example).

If you are passing string literal dates via ADO to SQL Server, then the best
format is yyyy/mm/dd (or some other version of ISO date formats that can be
miscontrued). String literals need to be parsed by SQL Server, and converted
to a valid date/time format.

Cheers
Ken



"Gargamel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
: Hiya.
:
: I've taken over the development of a web app written in ASP. It's not
: very well coded. In the live environment it's fine, but on my local
: machine it falls over whenever it tries to pass a date to a SQL Server
: sproc. No idea why the person before me's been doing all this string
: formatting with his dates, but anyway, the error is:
:
: Application uses a value of the wrong type for the current operation.
:
: The dates throughout are in mmddyyyy format, and presumably ADO
: running on my local machine wants ddmmyyyy. I'm rebuilding the whole
: app in C#.Net anyway so I don't think it's worth me running through
: and making this jumble of code international date friendly, so my
: question is, where exactly is the date format for ADO defined?
: Windows? SQL Server?
:
: Thanks loads!
:
: Gargamel.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Type/Size Property Values for VARCHAR(MAX) Stored Proc Parameter jcpc ASP .Net 2 01-26-2011 11:48 AM
Translating Oracle Package Call from ADO to ADO.Net dmiratsky@yahoo.com ASP .Net 0 02-14-2005 10:39 PM
Transfer ADO Code to ADO.NET ronaldlee ASP .Net 1 12-17-2004 04:08 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments