CodeSmith Community
Your Code. Your Way. Faster!

Differentiate between Varchar and Text

Latest post 05-02-2007 9:09 PM by pwelter34. 1 replies.
  • 05-01-2007 9:51 PM

    Differentiate between Varchar and Text

    Does anyone know of a way to differentiate between a VarChar column and a Text column?  The only way to determine column type seems to be comparing [columnObject].SystemType with TypeOf(System.[TypeName]), like this...

    if (column.SystemType == TypeOf(System.String))
    {
        // Do something here
    }

    This finds ALL string types, and does not differentiate between the various types.

    If I am referencing a Text column, it would be nice to know that so I can generate the appropriate TextBox type, preferably multi-line with no limit.

    Please help!

    Thanks,

    Eric.

    • Post Points: 35
  • 05-02-2007 9:09 PM In reply to

    • pwelter34
    • Top 25 Contributor
    • Joined on 03-13-2003
    • Eden Prairie, MN
    • Posts 255
    • Points 680,955

    Re: Differentiate between Varchar and Text

    Hi,

    You can use the ColumnSchema.NativeType property.  That will have varchar or text for the sql server type.

    ~ Paul
     

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems