Home All Groups Group Topic Archive Search About

Re: Determining field type CHAR vs VARCHAR

Author
13 Jul 2006 11:00 PM
Shawn Wildermuth
As an alternative to being specific to SQL Server, you might want to
look at DbDataReader.GetSchemaTable().  It provides a mechanism to get
the schema of a SqlDataReader (which might be a good way of getting this
data). No way that I know of to get this from a
DataAdapter/DataSet/DataTable, but does work across managed providers.


Thanks,

Shawn Wildermuth
Wildermuth Consulting Services, LLC
http://adoguy.com
C# MVP, MCSD.NET, Author and Speaker


Show quote
> -----Original Message-----
> From: Jared [mailto:goo***@tripletreesoftware.com]
> Posted At: Thursday, July 13, 2006 6:35 PM
> Posted To: microsoft.public.dotnet.framework.adonet
> Conversation: Determining field type CHAR vs VARCHAR
> Subject: Re: Determining field type CHAR vs VARCHAR
>
>
> Hi Marina,
>
> I was hoping this would be exposed in DataColumn, but
> querying the system tables should work, too.  Thanks for your
> quick response!
>
> Jared
>
> Marina Levit [MVP] wrote:
> > You can query the sql server system tables to find out. Try
> looking at
> > syscolumns.
> >
>
>
>

AddThis Social Bookmark Button