Hola
UNDR4, eso lo puedes validar en la acción click de tu boton de esta manera :
Código vb:
Ver original'Creas una variable string que contendra la consulta
Dim query As String
If txtTUTEXTBOX1.Text.Trim.Length == 0 And txtTUTEXTBOX2.Text.Trim.Length == 0 Then
query = "Select clave,nombre,descripcion,precioc,preciou from productos where id_marca='" & CBMarca.SelectedValue.ToString & "' order by nombre"
Else IF txtTUTEXTBOX1.Text.Trim.Length <> 0 And txtTUTEXTBOX2.Text.Trim.Length == 0 Then
query = "Select clave,nombre,descripcion,precioc,preciou from productos where clave='" txtTUTEXTBOX1.Text.Trim & "' and id_marca ='" & CBMarca.SelectedValue.ToString & "' order by nombre"
Else IF txtTUTEXTBOX1.Text.Trim.Length == 0 And txtTUTEXTBOX2.Text.Trim.Length <> 0 Then
query = "Select clave,nombre,descripcion,precioc,preciou from productos where nombre='" txtTUTEXTBOX2.Text.Trim & "' and id_marca ='" & CBMarca.SelectedValue.ToString & "' order by nombre"
Else ' txtTUTEXTBOX1.Text.Trim.Length <> 0 And txtTUTEXTBOX2.Text.Trim.Length <> 0 Then
query = "Select clave,nombre,descripcion,precioc,preciou from productos where clave='" txtTUTEXTBOX1.Text.Trim & "' and nombre = '" & txtTUTEXTBOX2.Text.Trim & "'and id_marca ='" & CBMarca.SelectedValue.ToString & "' order by nombre"
End If
'Y al final se lo pasas a tu adapter
'Crear Adaptador
oDataAdapter = New MySqlDataAdapter(query, Conexion)
Saludos!
.