cool hit counter Two good pairs of friends in the SqlParameter class: SqlDbType and DbType, SqlValue and Value_Intefrankly

Two good pairs of friends in the SqlParameter class: SqlDbType and DbType, SqlValue and Value


These two pairs of attributes were not different just from the MSDN, and they caused me some trouble when it came to which one to choose, but then I had a nagging feeling that they might be related, and decided to experiment with them.

Sure enough, they're fornicating with each other internally. Assign one of them and the other will follow . By reverse-editing, it was found that SqlDbType and DbType are private through a class called MetaType (this class is internal, so it is not accessible externally), while SqlValue and Value are private through a private field _value in the SqlParameter class, the details of which are not discussed here. Anyway, just know that the two base pairs have a link, so you don't have to struggle with which one to use in the future.

PS: Actually, there is a linkage between SqlDbType and DbType mentioned in MSDN, refer tohttp://msdn.microsoft.com/zh-cn/library/system.data.sqlclient.sqlparameter.dbtype(v=vs.80).aspx

For the correspondence between SqlDbType and DbType, see this table (but where SqlDbType does not actually refer to the SqlDbType enumeration, but the meaning is understood).http://msdn.microsoft.com/zh-cn/library/system.data.sqltypes(v=vs.80).aspx

PS: the original cnblogs hyperlink is the default original window open, I want to curse


Recommended>>
1、The Death of Smart Contract Games Analysis of Fomo3Dlike Attacks
2、Pragmatism Separating MOCK data on the front and back ends
3、Top 15 Hot GitHub Projects in Data Science 2017
4、The Death of Smart Contract Gaming An Analysis of the GodGame Incident
5、Heavy MIT AI Lab unveils 16 black technologies of the year neural networks and robotics at the forefront

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号