Any way to lookup the SqlServer data type for a given C# type (such as string, bool, DateTime, etc...) RRS feed

  • Question

  • Hi,

    I need to generate some DDL based on the names and data types of a collection of DataColumn instances in C#. 

    Does anyone know of a class/method that provides the SQLServer datatype for a given C# data type, such as string, DateTime, bool, etc... I know that there is a mapping on this site that I could put into a dictionary and use, but I'm hoping that there is a class somewhere that provides this lookup.

    thanks in advance,
    Friday, June 13, 2008 7:03 PM

All replies