下面语句错在哪里OleDbCommand cmd2 = new OleDbCommand("select sum(inv_sum_money)*6.75 from invoice where month(post_date)='" + month +" ' and paid_unit='USD'",con);string usd = cmd2.ExecuteScalar().ToString();double aaa = usd == null 0 :Conver

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/05 22:00:18
下面语句错在哪里OleDbCommand cmd2 = new OleDbCommand(
xSn@)LcAuKd̴md!5%@$*J̌*бݢnڪJ]yt=9sDy8k>6:n|ƥbYƒ(rR bjDuƧ45fEFe |RdP@x7M&#Z"i0W+>μ 'YI"XS5E^^Ko `Ҝrak)9LCqmv)6uYڂJ8~y}3p}U.ihs=jFT|d(=p7Bx^zfY MV} ɡݬrHydz4nb~Y 3<3'OVk2szMȼ=o!1߆ BU\Ż:yvhڱ _Q!i4YkgKk. rrkXÉ}BfNӂU3F\H<&@Ѻ#\>dA4͡fu¡L4uY9%><)]j^aA~7w8KD ]<4i.# 'EiD

下面语句错在哪里OleDbCommand cmd2 = new OleDbCommand("select sum(inv_sum_money)*6.75 from invoice where month(post_date)='" + month +" ' and paid_unit='USD'",con);string usd = cmd2.ExecuteScalar().ToString();double aaa = usd == null 0 :Conver
下面语句错在哪里
OleDbCommand cmd2 = new OleDbCommand("select sum(inv_sum_money)*6.75 from invoice where month(post_date)='" + month +" ' and paid_unit='USD'",con);
string usd = cmd2.ExecuteScalar().ToString();
double aaa = usd == null 0 :Convert.ToDouble(usd);
Response.Write(aaa);
当符合查询条件的记录为空时报错:
倒数第2句报错,输入字符窜的格式不正确,将一个字符串转换为DateTime的时候,先分析该字符串以获取日期,然后将每个变量放置到DateTime对象中
我不明白我根本没有转换datetiem类型啊,为什么会报错!

下面语句错在哪里OleDbCommand cmd2 = new OleDbCommand("select sum(inv_sum_money)*6.75 from invoice where month(post_date)='" + month +" ' and paid_unit='USD'",con);string usd = cmd2.ExecuteScalar().ToString();double aaa = usd == null 0 :Conver
Convert.ToDouble(usd);
转化为double,只有符合double的字符串才能转哦,null或空也会报错