How to resolve System.Type to System.Data.DbType?

前端 未结 5 620
礼貌的吻别
礼貌的吻别 2020-12-04 22:20

What is the best way to find System.Data.DbType enumeration value for Base Class Library types in System namespace?

5条回答
  •  旧时难觅i
    2020-12-04 22:31

    I am not aware of any automated logic, you should do the mapping yourself because those are different types and the .NET Framework cannot do this for you alone.

    see here the whole mapping table: SQL Server Data Type Mappings (ADO.NET) you can imagine that for Oracle, MySQL, sqLite and other engines there could be similar tables also depending on the .NET data provider / connect

提交回复
热议问题