string sqlselect3 = “select pk_iSPID as 销售合同收款编号,pk_iSXID as 销售合同编号,fpayment_amount as 收款金额,cpay as 支付形式,tcollection_time as 收款时间 from collection_payments where pk_iSXID in (select pk_iSXID from sell_contract where pk_iID=””+tlcb1.Text+””)”;
dgv4.DataSource = Bdingsource(sqlselect3, tableName1).Tables[0];
运行后报错:
问一下是不是嵌套查询语句的格式错了 该怎么该?
dgv4.DataSource = Bdingsource(sqlselect3, tableName1).Tables[0];
运行后报错:
问一下是不是嵌套查询语句的格式错了 该怎么该?
解决方案
10
你先把你sql语句拿到sql查询器去执行下,另外pk_iID是什么类型的?
10
假如是整形的话,就不需要加单引号
select pk_iSXID from sell_contract where pk_iID=””+tlcb1.Text+”“