Dim str = "select * from 库存表 where "
If Me.CBname.Checked = True Then
str = str + " 名称 like '" + txtShoesID.Text + "%'" 这个可以查询
End If
If Me.CBname.Checked = True And Me.CBchicun.Checked = True Then
str = str + " ( 名称 like '" + txtShoesID.Text + "%' )" And "( 尺寸 = '" & CombNoID.SelectedItem.ToString & "' ) "
End If
If Me.CBname.Checked = True And Me.CBchicun.Checked = True And Me.CByanse.Checked Then
str = str + " 名称 like '" + txtShoesID.Text + "%' and 颜色 = '" & combColorID.SelectedItem & "'"
End If
If Me.CBchicun.Checked = True Then
str = str + " 尺寸 = '" & CombNoID.SelectedItem.ToString & "' " 这个可以查询
End If
If Me.CBchicun.Checked = True And Me.CByanse.Checked = True Then
str = str + " ( 尺寸 = '" & CombNoID.SelectedItem & "') And ( 颜色 = '" & combColorID.SelectedItem.ToString & "')"
End If
If Me.CByanse.Checked = True Then
str = str + " 颜色 = '" & combColorID.SelectedItem.ToString & "' " 这个可以查询
End If
If Me.CBname.Checked = True And Me.CBchicun.Checked = True And Me.CByanse.Checked = True Then
str = str + " 名称 like '" + txtShoesID.Text + "%' and 尺寸 = '" & CombNoID.SelectedItem.ToString & "' and 颜色 = '" & combColorID.SelectedItem.ToString & "'"
End If
当查询一个可以查询,但是多个就不能查询了,希望高手们帮帮小弟一下``想了很久都不知道怎么改,查询多个时就是跳出附近有语法错误。