|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get a column size in VB.netHow could I get a column size from a datareader or a datatable? We're
moving from VB6 where the code looks like this: rcs.Fields(i).Size (rcs is a recordset). Thank for your help Vanny Vanny,
With a datareader only with a lot of trouble. With a datatable . http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.maxlength(VS.71).aspx Be aware that this is of course only for a string value Cor Thank you for the response. I tried this code : dt.Columns(i).MaxLength
where dt is a datatable. It always gives the value -1. It does not return the field sizes for the varchar fields of the table. Thanks, Vanny Show quote "Cor Ligthert[MVP]" <notmyfirstn***@planet.nl> wrote in message news:FFF031CF-F3DA-4798-A902-5E61B354E9C4@microsoft.com... > Vanny, > > With a datareader only with a lot of trouble. > > With a datatable . > > http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.maxlength(VS.71).aspx > > Be aware that this is of course only for a string value > > Cor |
|||||||||||||||||||||||