读取数据库中的NULL的字段出错的问题?代码如下
SqlCommand scd = new SqlCommand("select * from gjxx where 稿件编号 = " + li_gjbh, conn);
SqlDataReader sdr = scd.ExecuteReader();
tb_gjbt.Text = sdr.GetString(2);
这个字段数据库中是NULL,运行就提示我出错了
应该怎么写啊 各位高手帮帮忙 谢谢!
SqlCommand scd = new SqlCommand("select * from gjxx where 稿件编号 = " + li_gjbh, conn);
SqlDataReader sdr = scd.ExecuteReader();
tb_gjbt.Text = sdr.GetString(2);
这个字段数据库中是NULL,运行就提示我出错了
应该怎么写啊 各位高手帮帮忙 谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货