当前位置:Gxlcms > 数据库问题 > c#读取数据库bool值

c#读取数据库bool值

时间:2021-07-01 10:21:17 帮助过:24人阅读

xxx= Convet.ToInt16(reader["xxx"]);//或Convet.ToInt32 bool xxx= bool.Parse(reader["xxx"]);

 

其他的都有可能会报错,即便不报错,也不能保证数据库设置或操作系统的问题,导致突然报错了!

如int.Parse(),有时就会报一下错误:

在 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
在 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

c#读取数据库bool值

标签:报错   inf   code   两种   system   col   设置   布尔   类型   

人气教程排行