Torna al Thread
For Each ctrl In Me.Panel1.Controls
If TypeOf (ctrl) Is TextBox Then
If Not CType(ctrl, TextBox).Text.Equals("") Then
WhereCondition = WhereCondition & CType(ctrl, TextBox).Tag.ToString() & " LIKE @" & CType(ctrl, TextBox).Tag.ToString() & " AND "
cmd.Parameters.AddWithValue("@" & CType(ctrl, TextBox).Tag.ToString(), CType(ctrl, TextBox).Text)
End If
else If TypeOf (ctrl) Is ComboBox Then
If Not CType(ctrl, ComboBox).Text.Equals("") Then
WhereCondition = WhereCondition & CType(ctrl, ComboBox).Tag.ToString() & " LIKE @" & CType(ctrl, ComboBox).Tag.ToString() & " AND "
cmd.Parameters.AddWithValue("@" & CType(ctrl, ComboBox).Tag.ToString(), CType(ctrl, ComboBox).Text)
End If
End If
Next