开发者

Programmatically mapping .NET types onto SQL Server types?

Is there any way to programmatically map a .NET type (such a开发者_如何学Pythons typeof(int)) into its corresponding SqlDbType (such as SqlDbType.Int)?


Have you looked into The Entity Framework? This will do all of the mappings for you.


Not that I know of, tehre is no exposure of whatever method is used internally. Your best bet it your own extension method / mapping repository that uses a switch statement or a hashtable.


See Also:

SQL Server Data Type Mappings (ADO.NET)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜