各位老师,我想实现条件查询和模糊查询相结合的实现,
1、通过代码建立sqltable;DataTables("InstiUserList_table1").fill("select * f rom {N_AgriInsti} where AgriInstiId <> 9",Vars("Url1"),False)
2、实现条件查询和模糊查询相结合
Dim ccb1 As String =e.Form.controls("ccb1").value
Dim tb1 As String =e.Form.controls("tb1").value
Dim sql1 As String ="InstiType='" & ccb1 & "' "
Dim sql2 As String ="InstiName like '% & tb1 & % ' "
Dim sql As String ="select * f rom {N_AgriInsti} where 1=1 "
If ccb1 <> ""
sql=sql & " and " & sql1
End If
If tb1 <> ""
sql=sql & " and " & sql2
End If
If ccb1 = "" AndAlso tb1 = ""
MessageBox.show("请选择查询条件!","提示")
Else
DataTables("InstiUserList_table1").sqlload(sql)
End If
结果不显示数据,不知道问题出拿了?