0
that’s the code:
Dim clientesCadastrados As DataTable = MnipulaDB.ConsultaSql("SELECT CAMPO1 AS NOME FROM TAB_CLIENTES WHERE CAMPO21 =1")
For Each cliente As DataRow In clientesCadastrados.Rows
If campo3.texto <> cliente.ToString Then
MessageBox("Cliente não cadastrado!")
Return
End If
Next
A returned error says that a Datarow cannot be transformed into a String. How can I make this campo3.texto
with cliente.ToString
?
You need to compare but, brings a list of items from a correct Datatable, your SQL is not wrong?
– novic
That, I need to compare the text box string
campo3
with the resulting names in the Datatable clientesCadastrados. I just debugged here and sql is working. The problem is that it is not possible to compare a string with a datarow.– Facalesta
tried to
cliente["NOME"]
?, ie, specify the field! your SQL could be acount(*) as c
what you think?– novic
tried, this syntax does not work with Vb.net :/
– Facalesta
because that’s how it is
cliente("NOME")
, I confused with C#– novic
opa, it worked! thanks a lot @novic
– Facalesta