forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDbTypeLookup.cs
More file actions
50 lines (48 loc) · 4.38 KB
/
DbTypeLookup.cs
File metadata and controls
50 lines (48 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
namespace Simple.Data.SqlCe40
{
using System.Collections.Generic;
using System.Data;
internal static class DbTypeLookup
{
private static readonly Dictionary<string, SqlDbType> SqlDbTypeLookup = new Dictionary<string, SqlDbType>
{
{"text", SqlDbType.Text},
{"uniqueidentifier", SqlDbType.UniqueIdentifier},
{"date", SqlDbType.Date},
{"time", SqlDbType.Time},
{"datetime2", SqlDbType.DateTime2},
{
"datetimeoffset",
SqlDbType.DateTimeOffset
},
{"tinyint", SqlDbType.TinyInt},
{"smallint", SqlDbType.SmallInt},
{"int", SqlDbType.Int},
{"smalldatetime", SqlDbType.SmallDateTime},
{"real", SqlDbType.Real},
{"money", SqlDbType.Money},
{"datetime", SqlDbType.DateTime},
{"float", SqlDbType.Float},
{"sql_variant", SqlDbType.Variant},
{"ntext", SqlDbType.NText},
{"bit", SqlDbType.Bit},
{"decimal", SqlDbType.Decimal},
{"numeric", SqlDbType.Decimal},
{"smallmoney", SqlDbType.SmallMoney},
{"bigint", SqlDbType.BigInt},
{"varbinary", SqlDbType.VarBinary},
{"varchar", SqlDbType.VarChar},
{"binary", SqlDbType.Binary},
{"char", SqlDbType.Char},
{"timestamp", SqlDbType.Binary},
{"nvarchar", SqlDbType.NVarChar},
{"nchar", SqlDbType.NChar},
{"xml", SqlDbType.Xml},
{"image", SqlDbType.Image},
};
public static SqlDbType GetSqlDbType(string typeName)
{
return SqlDbTypeLookup[typeName];
}
}
}