[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

(Wil)

7/12/2002 6:30:00 AM

The documentation on the OdbcParameter class states:

Both the DbType and OdbcType properties can be inferred by setting
Value. If applicable, the size, precision and scale will also be
inferred from Value.

When I do this:
...
OdbcCommand cmd = new OdbcCommand("INSERT INTO T1 VALUES (?)", conn);

cmd.Parameters.Add("@p1", System.DateTime.Now);

Console.WriteLine(cmd.Parameters["@p1"].DbType);

I also tried

cmd.Parameters["@p1"].Value = System.DateTime.Now; // still gives me
String!

It displays the "String" type, shouldn't the DbType property be
"DateTime" instead????? I tried this on the SQL .NET provider and it
does what the doc says!

What happened to the inference of the value as stated in the doc??
Is this a bug?

Wil
4 Answers

(Wil)

7/15/2002 8:04:00 PM

0

Anyone??

Wil

(Wil)

7/17/2002 2:00:00 AM

0

Can someone at Microsoft answer this??

Shawn Aebi [MS]

7/17/2002 8:18:00 AM

0

I'll have someone look at it tomorrow...sorry for the delay.

Shawn
This posting is provided "AS IS" with no warranties, and confers no rights.

"Wil" <piyobean@sbcglobal.net> wrote in message
news:c486bc45.0207161437.549b0443@posting.google.com...
> Can someone at Microsoft answer this??


(Microsoft Developer Support)

7/18/2002 12:40:00 AM

0

Hi Wil,

This looks like a bug in ODBC.NET Provider. I will be filing this bug
shortly.
This may turn out to be "by design" in that case we will fix the
documentation for ODBC.NET provider.

Thanks
Syed Mehdi
Microsoft Developer Support


This posting is provided “AS IS” with no warranties, and confers no rights.
Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....