-- 作者:zhoushijun
-- 发布时间:2013/7/1 14:23:00
-- 临时表SQL查询
Dim strsql As String If values.Length >1 Then strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号 where a.成交价<> 0 And a.买家结算状况 In(\'已结算\',\'抵账\') and b.拍卖会名称 in(" & s & ") and c.姓名 in(" & name & ")" Else If tb1.text.Trim="" Then strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号 where a.成交价<> 0 And a.买家结算状况 In(\'已结算\',\'抵账\') and b.拍卖会名称 in(" & s & ") " Else strsql ="select a.图录号,a.名称,a.作者,a.年代,a.成交价,a.小计,a.买家结算状况,a.买家出帐单日期 ,a.买家付款状况,a.成交状况,a.买方付款,a.竞投牌号,c.姓名 ,a.竞投牌号,b.拍卖会名称 from storeall a inner join auctionall b on a.拍卖会ID=b.拍卖会ID inner join jtdjall c on a.竞投牌号=c.竞投牌号 where a.成交价<> 0 And a.买家结算状况 In(\'已结算\',\'抵账\') and b.拍卖会名称 in(" & s & ") and c.姓名 like \'%" & tb1.Text & "%\' " End If End If
Dim tem As String="" Dim cmd As New SQLCommand cmd.C
Dim dst As Table = Tables("买家结算关联表") cmd.CommandText=strsql dst.DataSource = cmd.ExecuteReader()
买家结算关联表是临时表,我上述代码查询不出来数据。sql语句测试过没有问题,是怎么回事?
[此贴子已经被作者于2013-7-1 14:24:15编辑过]
|