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