我在一个窗口上放了一个ddlb,其项目有一个是全部订单,其余项目是从数据库那里读取的,我想让这个ddlb显示时,第一项是全部订单,后面的项,是按照从数据库读取时,按ID的倒序排序,我试着用两两种方式来写入ddlb的项目,但其显示效果还是一样的,请问这个是怎么回事呢?
string new_sql,allitemstr,columnname
new_sql="select BH from caigoudingdantxx order by ID desc limit 20"
allitemstr="全部采购订单"
columnname="BH"
bindddlbwithall(ddlb_caigoudingdanbh,allitemstr,new_sql,columnname)
ddlb.reset()
ddlb.additem(allitemstr)
datastore ds
string return_code
ds=getdsfromsql(new_sql,return_code)
long rowNum=1,rowCount
rowCount=ds.rowcount( )
if rowCount>0 then
do while rowNum<=rowCount
//ddlb.additem(ds.getitemstring(rowCount - rowNum+1,columnname))
ddlb.additem(ds.getitemstring(rowNum,columnname))
rowNum++
loop
end if
//ddlb.additem(allitemstr)
ddlb.selectitem(rowCount+1)