[讨论]老是这个地方出问题
我在做一个采购的项目,在做里面的子模块时老是出现一个这样的错误啊this.dgvGoodsFindInfo.DataSource = G_SqlClass.GetDs(P_Str_cmdtxt).Tables[0];这句代码老是异常啊
谁能帮帮我啊?
现在刚好又在做一个子模块又有这个问题了
顺便把代码付上啊
if (this.radioButton4.Checked)
{
P_Str_select = "GoodsID LIKE '%" + this.txtGoodsID.Text + "%' AND ReGoodsName LIKE '%" + this.txtGoodsName.Text + "%'";
P_Str_select += " AND ReGoodsTime BETWEEN '" + this.dtStartTime.Value.ToString("yyyy-MM-dd") + "' AND ";
P_Str_select += "'" + this.dtEndTime.Value.ToString("yyyy-MM-dd") + "'";
P_Str_cmdtxt = "SELECT ReGoodsID as 退货ID,GoodsID as 商品ID,ReGoodsName as 商品名称,ReGoodsTime as 退货日期,ReGoodsNum as 退货数量";
P_Str_cmdtxt += ",ReGoodsUnit as 商品单位,ReGoodsSpec as 商品规格,ReGoodsPrice as 进货价格,NeedPay as 应收金额,HasPay as 实收金额,ReGoodsResult as 退货原因";
P_Str_cmdtxt += " FROM tb_ReGoods WHERE "+P_Str_select+"";
this.dgvGoodsFindInfo.DataSource = G_SqlClass.GetDs(P_Str_cmdtxt).Tables[0];
}
就是这一段,其他段没有这个问题。
谢谢!