2
Hello, I am creating a form to generate reports using the Reportviwer control and I came across a problem, I have a Dataset created with Dsclient name, I created a clausa to filter the search (Dataset Configuration)at the end of the Dataset query adds the following clause:
WHERE cliente_cnpj LIKE '%' + @clienteCnpj + '%'
where the @Clientecnpj parameter comes from a textbox, but when I finish an error occurs, saying that the syntax near @client is wrong, but I do not find the error!
Thanks in advance!
this is the code of the form:
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Me.clienteTableAdapter.Fill(Me.testebaseDataSet1.cliente,TextBox1.Text)
Me.ReportViewer1.RefreshReport()
End Sub
I added the Reportviwer controls, when I added it he asked me to create a Dataset, I created the Dataset I selected the tables, everything working perfect, I opened the Dataset in Vb where he put the table I added, I selected Configure where opened a window with the query they are running:
SELECT cod_cliente, cliente_razaosocial, cliente_cnpj, cliente_cpf, cliente_codPraca, cliente_tipo, cliente_isencao, cliente_Redespacho, cliente_bloqueioCadastro,
cliente_fantasia, cliente_ColetaCidade, cliente_ColetaBairro, cliente_ColetaUf, cliente_ColetaCep, cliente_ColetaHorario, cliente_ColetaEndereco,
cliente_ExpedicaoBairro, cliente_ExpedicaoCep, cliente_ExpedicaoContato, cliente_ExpedicaoSigla, cliente_ExpedicaoObs, cliente_ExpedicaoData,
cliente_ExpedicaoTelefone, cliente_ExpedicaoEndereco, cliente_ExpedicaoCidade, cliente_ExpedicaoRamal, cliente_ExpedicaoEmail, cliente_ExpedicaoFax,
cliente_ExpedicaoColeta, cliente_ExpedicaoFormaCalculo, cliente_ExpedicaoUf, cliente_ExpedicaoZona, cliente_ExpedicaoMercEspecial, cliente_msgColeta,
cliente_msgExpedicao, cliente_msgCotacao, cod_cotacao, cliente_cobrancaEndereco, cliente_cobrancaBairro, cliente_cobrancaCidade, cliente_cobrancaContato,
cliente_cobrancaCadastrado, cliente_cobrancaTelefone, cliente_cobrancaCalculo, cliente_cobrancaDataCobranca, cliente_cobrancaFinalizado,
cliente_cobrancaEmissao, cliente_cobrancaDataVEncimento, cliente_cobrancaSituacao, cliente_cobrancaUf, cliente_cobrancaObs, cliente_cobrancaUltimaAlteracao,
cliente_cobrancaCep, cliente_inscricaoEstado, cliente_ColetaNumero, cliente_ZONA, cliente_cep, cliente_uf, cliente_numero, cliente_Bairro, cliente_Endereco,
cliente_Cidade, cliente_telefone, cliente_contato FROM cliente
at the end I added the line WHERE cod_cliente LIKE '%' + @clienteCnpj + '%'
when I click Finish it error saying it has error in syntax =\
@clienteCnpj indicates that you will enter a parameter in your query, it can better describe your problem?
– Marconi
@Marconi I followed these steps video classroom but in the cloister where of error...
– Hebert Lima
Describe your problem better and try adding more snippets of code, which you actually tried.
– Marconi
@Marconi were those steps I made.
– Hebert Lima
I Hebert. If you solved the problem, even if totally changing the code, it would be nice to post below a reply explaining how you did it. So future visitors to this page can benefit from your solution. Thank you!
– bfavaretto