Chirag Gupta
9/5/2002 3:52:00 AM
This is not the right way to use GetString(). GetString()
we use only when datatype is varchar. Otherwise for type
casting we use ToString function. Syntax would be
something like this:-
myReader.GetValue(0).ToString()
If you know the data type you can replace GetValue() with
GetInt32, GetString etc....
I hope this helps.
>-----Original Message-----
>I have an integer datatype defined in my odbc datasource,
when I
>attempt to do a GetString() from the OdbcDataReader, it
throws an
>InvalidCastException, why can't the .NET ODBC data
provider convert it
>to a string for me? Is this a limitation or is it
a "strong type"
>feature?
>
>Wil
>.
>