If rbapellido.Checked = True Then
cad = "Select * from registro_usuarios where ape_usu like '%" & TextBox1.Text & "%'"
Else
cad = "Select * from registro_usuarios where login like '" & TextBox1.Text & "%'"
rbapellido.Checked = False
End If
cn.Open()
Dim cmd As New SqlCommand(cad, cn)
'Ejecuta el comando
Dim dre As SqlDataReader
dre = cmd.ExecuteReader
If dre.HasRows = True Then
'Visualizar los datos
Label3.Visible = False
lblerror.Visible = False
DataGrid1.Visible = True
DataGrid1.DataSource = dre
DataGrid1.DataBind()
Else
DataGrid1.Visible = False
lblerror.Text = "Lo sentimos " & TextBox1.Text & "no existe en la base de datos"
Label3.Visible = True
lblerror.Visible = True
End If
End Sub
cad = "Select * from registro_usuarios where ape_usu like '%" & TextBox1.Text & "%'"
Else
cad = "Select * from registro_usuarios where login like '" & TextBox1.Text & "%'"
rbapellido.Checked = False
End If
cn.Open()
Dim cmd As New SqlCommand(cad, cn)
'Ejecuta el comando
Dim dre As SqlDataReader
dre = cmd.ExecuteReader
If dre.HasRows = True Then
'Visualizar los datos
Label3.Visible = False
lblerror.Visible = False
DataGrid1.Visible = True
DataGrid1.DataSource = dre
DataGrid1.DataBind()
Else
DataGrid1.Visible = False
lblerror.Text = "Lo sentimos " & TextBox1.Text & "no existe en la base de datos"
Label3.Visible = True
lblerror.Visible = True
End If
End Sub