2023年12月6日发(作者:校舍)
DbType与Type之间的转换1. DbType ==>Type:public static DbType TypeToDbType(Type t){ DbType dbt; try { dbt = (DbType)(typeof(DbType), ); } catch { dbt = ; } return dbt;}
2. Type ==> DbType:static Type ConvertType(DbType dbType){ Type toReturn = typeof(DBNull); switch (dbType) { ca 64: toReturn = typeof(UInt64); break; ca 64: toReturn = typeof(Int64); break; ca 32: toReturn = typeof(Int32); break; ca 32: toReturn = typeof(UInt32); break; ca : toReturn = typeof(float); break; ca : ca me: ca : toReturn = typeof(DateTime); break; ca : ca FixedLength: ca ring: ca ringFixedLength: toReturn = typeof(string); break; ca 16: toReturn = typeof(UInt16); break; ca 16: toReturn = typeof(Int16); break; ca : toReturn = typeof(byte); break; ca : toReturn = typeof(object); break; ca eric: ca l: toReturn = typeof(decimal); break; ca cy: toReturn = typeof(double); break; ca : toReturn = typeof(byte[]); break; ca : toReturn = typeof(Double); break; ca : toReturn = typeof(Guid); break; ca n: toReturn = typeof(bool); break; } return toReturn;}
本文发布于:2023-12-06 17:32:03,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/zhishi/a/88/39111.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:DbType与Type之间的转换.doc
本文 PDF 下载地址:DbType与Type之间的转换.pdf
留言与评论(共有 0 条评论) |