|
using System;
using System.Data;
namespace DBHelper
{
public class TypeMapping
{
static SqlDbTypeToTypeAssociation map;
public static SqlDbTypeToTypeAssociation Mapping
{
get {return map;}
}
static TypeMapping()
{
map = new SqlDbTypeToTypeAssociation();
map.Add(SqlDbType.BigInt, typeof(Int64));
map.Add(SqlDbType.Binary, typeof(Array));
map.Add(SqlDbType.Bit, typeof(Boolean ));
map.Add(SqlDbType.Char, typeof( String ));
map.Add(SqlDbType.DateTime, typeof( DateTime ));
map.Add(SqlDbType.Decimal, typeof( Decimal ));
map.Add(SqlDbType.Float, typeof( Double ));
map.Add(SqlDbType.Image, typeof( Array));
map.Add(SqlDbType.Int, typeof( Int32 ));
map.Add(SqlDbType.Money, typeof( Decimal));
map.Add(SqlDbType.NChar, typeof( String ));
map.Add(SqlDbType.NText, typeof( String ));
map.Add(SqlDbType.NVarChar, typeof( String ));
map.Add(SqlDbType.Real, typeof( Single ));
map.Add(SqlDbType.SmallDateTime, typeof( DateTime ));
map.Add(SqlDbType.SmallInt, typeof( Int16 ));
map.Add(SqlDbType.SmallMoney, typeof( Decimal));
map.Add(SqlDbType.Text, typeof( String ));
map.Add(SqlDbType.Timestamp, typeof( DateTime ));
map.Add(SqlDbType.TinyInt, typeof( Byte ));
map.Add(SqlDbType.UniqueIdentifier, typeof( Guid ));
map.Add(SqlDbType.VarBinary, typeof( Array ));
map.Add(SqlDbType.VarChar, typeof( String ));
map.Add(SqlDbType.Variant, typeof( Object ));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.