日期:2014-05-20 浏览次数:20841 次
Dim a As String = someVlaue
Dim b As String = someVlaue
Dim sql As String = "select * from table1 where column1 = 1"
If a <> "" Then
sql = sql + " and columnA = '" + a + "'"
End If
If b <> "" Then
sql = sql + " and columnB = '" + b + "'"
End If