Groups | Blog | Home
all groups > dotnet ado.net > may 2007 >

dotnet ado.net : Field data type in VB.net


Vanny
5/21/2007 9:58:21 AM
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

Petar Atanasov
5/21/2007 5:57:49 PM
[quoted text, click to view]

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
Vanny
5/22/2007 8:08:36 AM
Thanks Petar for your help

[quoted text, click to view]

AddThis Social Bookmark Button