(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