PB中想动态查询怎么弄?string City,Country,Series,STypeCity=ddlb_dq.textCountry=ddlb_xs.textSeries=ddlb_xl.textSType=ddlb_xh.textstring newsql,oldsqloldsql="select * from product where"int flagflag=0if cbx_dq.checked=true then //地区查询ne

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 19:46:23

PB中想动态查询怎么弄?string City,Country,Series,STypeCity=ddlb_dq.textCountry=ddlb_xs.textSeries=ddlb_xl.textSType=ddlb_xh.textstring newsql,oldsqloldsql="select * from product where"int flagflag=0if cbx_dq.checked=true then //地区查询ne
PB中想动态查询怎么弄?
string City,Country,Series,SType
City=ddlb_dq.text
Country=ddlb_xs.text
Series=ddlb_xl.text
SType=ddlb_xh.text
string newsql,oldsql
oldsql="select * from product where"
int flag
flag=0
if cbx_dq.checked=true then //地区查询
newsql=oldsql+" product.city = '"+City+"'"
flag=1
end if
if cbx_xs.checked=true then//按县市查询
if flag=0 then
newsql=oldsql+"and product.country ='"+Country+"'"
flag=1
else
newsql=newsql+"and product.country ='"+Country+"'"
end if
end if
if cbx_xl.checked=true then//按系列查询
if flag=0 then
newsql=oldsql+"and product.Series ='"+Series+"'"
flag=1
else
newsql=newsql+"and product.Series ='"+Series+"'"
end if
end if
if cbx_xh.checked=true then//按型号查询
if flag=0 then
newsql=oldsql+"and product.SType ='"+SType+"'"
flag=1
else
newsql=newsql+"and product.SType ='"+SType+"'"
end if
end if
dw_1.Filter()
dw_1.retrieve()
这个答不到筛选效果,还是整张表出现~应该怎么改呢?可以远程教教我吗?

PB中想动态查询怎么弄?string City,Country,Series,STypeCity=ddlb_dq.textCountry=ddlb_xs.textSeries=ddlb_xl.textSType=ddlb_xh.textstring newsql,oldsqloldsql="select * from product where"int flagflag=0if cbx_dq.checked=true then //地区查询ne
最下面的语法,FILTER是干什么的?SETFILTER()函数在哪里?
你拼出了SQL,可是没有赋给DW_1,所以即使retrieve,你拼接的SQL也没有起到作用.要使用DW_1.SETSQLSELECT()函数.
从你想表达的意思,FILTER函数应该是没有用的,把那个改成dw_1.setsqlselect(newsql).
再有,你的语句拼接也不对,如果按地区查询的CHECKBOX没有勾中,看看下面的拼接会出现 select .. from where and ...
就是这句,newsql=oldsql+"and product.country ='"+Country+"'"
后边也有.
还有,使用setsqlselect函数时,要求你拼的SQL(newsql)的select字段的顺序和类型都要和你dw_1是一致的,where条件不用一样,还有dw_1不能有参数.

PB中想动态查询怎么弄?string City,Country,Series,STypeCity=ddlb_dq.textCountry=ddlb_xs.textSeries=ddlb_xl.textSType=ddlb_xh.textstring newsql,oldsqloldsql=select * from product whereint flagflag=0if cbx_dq.checked=true then //地区查询ne C++中string ::size_ type PB时间段查询string chengbadatetime day_startdatetime day_endday_start=datetime(date(em_1.text),time(00:00:00))day_end=datetime(date(em_2.text),time(23:59:29))chengba=t_mat_outbill_mo_outputdate>='+string(day_start)+' and (t_mat_outbil 在录取动态查询中自由可投是什么意思?请知道的人帮个忙!急 急 怎样制作动态手机壁纸?想自己弄个动态壁纸, 怎么弄的动态签名图啊. 请问如下代码中?:{0:d}和{0:string str1=String.Format((d)Short date:{0:d} ,DateTime.Now);string str2 =String.Format((C)Currency:{0:C} ,89.0f); 中图分类号怎么查询 中远航运船员工资怎么查询? this.jdField_a_of_type_Double = paramc.java/io/Serializable();是什么意思?如果能顺便回答一下这个问题就更好了:像下面的代码中,编译器怎么动态的选择调用String a()和int a()的?(先回答题目中的问 c#.net中如何提取combobox被选中的值做了个combobox下拉框,想做个根据下拉框选中的值进行查询.问用什么语句可以把combobox控件中被选中的值复值给string a c#string.format的用法 string. string. C#中怎么测试变量类型?如:int num = 434;怎么知道他是int?string temp = gfdg;怎么知道他是string? 怎么提高动态评分? 电路怎么动态分析? 怎么提升动态评分