Senior Posted November 3, 2009 at 09:04 AM Report Share #294439 Posted November 3, 2009 at 09:04 AM oi tenho aqui um problemazinho no meu programa,queria que o programa fosse buscar a informacoes a minha bd eu pos uma textbox numa form,a minha intencao e escrever um nome de uma pessoa e ia buscar as informacoes a base de dados,tipo de uma consulta obrigado Link to comment Share on other sites More sharing options...
Gooden Posted November 3, 2009 at 09:39 AM Report Share #294442 Posted November 3, 2009 at 09:39 AM Bom dia Senior. Mas onde tens problemas? que base de dados usas? a criar a query? a ligar a base de dados? Tens de ser mais especifico por favor =) Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 09:54 AM Author Report Share #294449 Posted November 3, 2009 at 09:54 AM por exemplo se escrever maria santos na textbox depois queria que aparecesse as informacoes da maria Link to comment Share on other sites More sharing options...
Gooden Posted November 3, 2009 at 09:58 AM Report Share #294451 Posted November 3, 2009 at 09:58 AM Mas tens conexão a base de dados? Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 09:59 AM Author Report Share #294452 Posted November 3, 2009 at 09:59 AM tenho Link to comment Share on other sites More sharing options...
Gooden Posted November 3, 2009 at 10:02 AM Report Share #294454 Posted November 3, 2009 at 10:02 AM Dim nome As String = "Nome" Dim da As New SqlClient.SqlDataAdapter("Select * from Clientes where nome like '%" & nome & "%'", cnn) Dim ds As New DataSet da.Fill(ds) If ds.Tables(0).Rows.Count = 0 Then MsgBox("Sem Clientes") Else For Each DR As DataRow In ds.Tables(0).Rows MsgBox("Encontrado: " & DR("Nome").ToString) Next End If Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 10:11 AM Author Report Share #294456 Posted November 3, 2009 at 10:11 AM tenho de por o codigo no botao ou na textbox? Link to comment Share on other sites More sharing options...
Gooden Posted November 3, 2009 at 10:34 AM Report Share #294461 Posted November 3, 2009 at 10:34 AM Se quiseres quando mudas o texto metes no textbox text change. Senão mete no botão Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 10:41 AM Author Report Share #294462 Posted November 3, 2009 at 10:41 AM ja compreendi obrigado Gooden Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 05:36 PM Author Report Share #294530 Posted November 3, 2009 at 05:36 PM as informacoes vao aparecer numa DataGridView? Link to comment Share on other sites More sharing options...
Senior Posted November 3, 2009 at 08:54 PM Author Report Share #294575 Posted November 3, 2009 at 08:54 PM o meu codigo esta a dar erro mas na sei porque,diz que o cnn nao foi declarado Dim nome As String = "Nomemembro" Dim da As New SqlClient.SqlDataAdapter("Select * from membros where nome like '%" & nome & "%'", cnn) Dim ds As New DataSet da.Fill(ds) If ds.Tables(0).Rows.Count = 0 Then MsgBox("Sem Clientes") Else For Each DR As DataRow In ds.Tables(0).Rows MsgBox("Encontrado: " & DR("Nome").ToString) Next End If Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now