How would I get the length of a column from a SQLDataReader? I'm looking
for something like Query Analyzer uses to display its data. So, I would
need to know that a varchar(200) is 200 where a varchar(20) is only 20.
Also I need to know how many characters a datetime would fill up. This
kinda information.

Does this make sense?

-Roger

Re: SQLDataReader and Columns by W

W
Mon Jan 24 12:56:40 CST 2005

You can use the GetSchemaTable which will return Schema INformation if you
are using SqlClient
http://www.knowdotnet.com/articles/getoledbschematable.html

If you let an adapter fill a datatable - it will have the schema information
contained as well.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Roger Webb" <rwebb@nos.twia.org> wrote in message
news:%23$wSwMkAFHA.2112@TK2MSFTNGP09.phx.gbl...
> How would I get the length of a column from a SQLDataReader? I'm looking
> for something like Query Analyzer uses to display its data. So, I would
> need to know that a varchar(200) is 200 where a varchar(20) is only 20.
> Also I need to know how many characters a datetime would fill up. This
> kinda information.
>
> Does this make sense?
>
> -Roger
>
>
>