Limpar o que nao esta na tabela
Dim dr As SqlDataReader = Nothing
Using con As SqlConnection = CONCETA_DB()
Try
con.Open()
Dim strCmd As String = "SELECT USUARIOS.LOGON FROM CONFIGURACOES_EMPRESA "
strCmd += "INNER JOIN USUARIOS ON CONFIGURACOES_EMPRESA.ID_EMPRESA = USUARIOS.ID_USUARIO"
strCmd += " WHERE CONFIGURACOES_EMPRESA.RazaoSocial ='" & cbxEmpresa.Text & "'"Dim cmd As SqlCommand = New SqlCommand(strCmd, con)
dr = cmd.ExecuteReader(CommandBehavior.SingleResult)
Dim dt As New DataTable
If dr.HasRows Then
If dt.Rows.Count >= 1 Then
For i = 0 To dt.Rows.Count - 1
cbxUsuario.Items.Add(dt.Rows(i).Item("LOGON"))
Refresh()
Next
Else
MsgBox("Nenhum usuario encontrado")
End If
End If
Catch
MsgBox("Erro com a sua base de dados, detalhes.: " & vbCrLf & vbCrLf & Err.Description & vbCrLf & vbCrLf & "Informe de ao suportes", MsgBoxStyle.Information)
Finally
con.Close()
End Try
End Using
=====================================================================================================
como eu limpo o que nao esta com outro ID de empresa
Discussão (3)
Carregando comentários...