Jump to content
Fórum Script Brasil
  • 0

Falha na busca - Inner join


Lukhas

Question

Boa tarde pessoal.

Estava pesquisando aqui no forum algo a respeito de consulta com inner join e não consegui resolver meu problema, quero pedir ajuda no seguinte:

Tenho um banco de dados Access, dentro dele existem 2 tabelas, então quero comparar uma coluna de cada banco no VB.NET, se forem iguais devo mostrar os campos desejados

no respectivos campos, o codigo esta assim:

Using CN As New OleDb.OleDbConnection

CN.ConnectionString = (CONEXAO.ADMIN)

CN.Open()

Dim comando As New OleDb.OleDbCommand("select (endereco) from tb_endereco inner join TB_CLIENTES on TB_ENDERECO.ID=TB_CLIENTES.ID_ENDERECO where tb_endereco.ID='" & txt_id_endereco.Text & "'", CN)

Dim datareader As OleDb.OleDbDataReader = comando.ExecuteReader()

datareader.Read()

txt_endereco.Text = datareader("ENDERECO")

End Using

Resumindo o campo da tabela 'endereco' não aparece no textbox.

O que pode ser? já tentei de quase tudo.

Obrigado.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...