How can we find a Field data types from DataReader/Dataset/Datatable in
VB.net ??? For example code in VB6 where rstRecName is a recordset and j is
a column index:

If rstRecName.Fields(j).type = adLongVarChar Then
(do something)
end if

Thanks for your help

Vanny

Re: Field data type in VB.net by Petar

Petar
Mon May 21 09:57:49 CDT 2007

Vanny wrote:
> How can we find a Field data types from DataReader/Dataset/Datatable in
> VB.net ??? For example code in VB6 where rstRecName is a recordset and j is
> a column index:
>
> If rstRecName.Fields(j).type = adLongVarChar Then
> (do something)
> end if
>
> Thanks for your help
>
> Vanny
>
>

Hi, Vanny

use: oDs.Tables["MyTable"].Columns[j].DataType.ToString();

Check this out too:
Mapping .NET Framework Data Provider Data Types to .NET Framework Data Types
http://msdn2.microsoft.com/en-us/library/4e5xt97a(vs.71).aspx

Regards,
Petar Atanasov
http://a-wake.net

Re: Field data type in VB.net by Vanny

Vanny
Tue May 22 07:08:36 CDT 2007

Thanks Petar for your help

"Petar Atanasov" <ppa_info@mail.bg> wrote in message
news:e8eChh7mHHA.3888@TK2MSFTNGP03.phx.gbl...
> Vanny wrote:
>> How can we find a Field data types from DataReader/Dataset/Datatable in
>> VB.net ??? For example code in VB6 where rstRecName is a recordset and j
>> is a column index:
>>
>> If rstRecName.Fields(j).type = adLongVarChar Then
>> (do something)
>> end if
>>
>> Thanks for your help
>>
>> Vanny
>
> Hi, Vanny
>
> use: oDs.Tables["MyTable"].Columns[j].DataType.ToString();
>
> Check this out too:
> Mapping .NET Framework Data Provider Data Types to .NET Framework Data
> Types
> http://msdn2.microsoft.com/en-us/library/4e5xt97a(vs.71).aspx
>
> Regards,
> Petar Atanasov
> http://a-wake.net