tell me how to do so. I only see a maxlength property of -1
cmd.CommandText = "select top 1 * from " & TableName
myReader = cmd.ExecuteReader(CommandBehavior.KeyInfo)
tbl = myReader.GetSchemaTable()
For Each col In tbl.Columns
' 'Display the field name and length
i = col.MaxLength
MsgBox(i & col.ColumnName )
"William Vaughn" <billvaNoSPAM@betav.com> schreef in bericht
news:7E309E57-328F-43A0-BC39-69D2DA0A8FF1@microsoft.com...
[quoted text, click to view] > The same interfaces that VS uses to display these properties in the Server
> Explorer are available via the GetSchema methods.
>
> --
> __________________________________________________________________________
> William R. Vaughn
> President and Founder Beta V Corporation
> Author, Mentor, Dad, Grandpa
> Microsoft MVP
> (425) 556-9205 (Pacific time)
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> ____________________________________________________________________________________________
> "ton" <ton@nospam.nl> wrote in message
> news:925ab$47e17a67$541eee8e$12159@cache3.tilbu1.nb.home.nl...
>> Hi,
>>
>> In ADO I could read the property .DefinedSize of a field of a recordset
>> to determine the max size of the field. This is very usefull to set the
>> maxlength property of a textbox. How can this value be determined in the
>> ADONET- Dataset or datatable.
>>
>> thanks for a reply
>>
>>
>> Ton
>>
>