Dear members,
I'm working on a form with a datagridview that is getting filled
with the 'txtKlantnummer_Changed' method.
With closing the form i've got an sqlexception with debugging.
the message: Incorrect syntax near '='.
How it works:
in the form is a textbox with a number that is getting filled.
With the change of that number ("txtKlantnummer_Changed ') a datagridview get filled.
This works, but when closing of the form, the error comes when executing
Da.Fill(TaKlant).
Code:PrivateSub txtKlantnummer_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtKlantnummer.TextChanged Dim Cn AsSqlConnection Cn = NewSqlConnection(Cnst) Dim Cmd AsSqlCommand = Cn.CreateCommand Cmd.CommandText = "Select Klant.Klantnummer, Klant.Naamvoornaam, Klant.Adres From Klant Where Klant.Klantnummer=" & txtKlantnummer.Text Da = NewSqlDataAdapter(Cmd) Dim TaKlant AsNewDataTable Da.Fill(TaKlant) DGV1.DataSource = TaKlant EndSub
What can be the problem?
Grtz,
John


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks