[RESOLVED] SQLCE problem with DELETE
HI! :wave:
this is the code to delete a record
Code:
Code:
Chiave = DirectCast(Bs.Current, DataRowView).Item("ID")
MsgBox(Chiave)
MsgBox("Sei sicuro di voler eliminare questo contatto? ", MsgBoxStyle.YesNo, "Attenzione!")
If vbYes Then
If Not Conn.State = ConnectionState.Open Then Conn.Open()
sqL = "DELETE * FROM MiaTabella WHERE ID= " & Chiave
Cmd = New SqlCeCommand(sqL, Conn)
Cmd.ExecuteNonQuery()
Da.Update(Ds, "MiaTabella")
Ds.Reset()
Da.Fill(Ds, "MiaTabella")
Bs = New BindingSource(Ds, "MiaTabella")
DatiDB()
End If
but this code that work on an other program (but in vb 10 and with Access)
doesn't work !!!!!
On Cmd.ExcuteNonQuery() give me this error
Mistake during parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = * ]
How Could I resolve it ?
Re: SQLCE problem with DELETE
Have you tried using
a
instead of
Re: SQLCE problem with DELETE
You don't even need the From if you don't want it. This:-
"DELETE MiaTabella WHERE ID= "
would be fine.
Re: SQLCE problem with DELETE
Quote:
Originally Posted by
abhijit
Have you tried using
a
instead of
Quote:
Originally Posted by
FunkyDexter
You don't even need the From if you don't want it. This:-
"DELETE MiaTabella WHERE ID= "
would be fine.
Work Now :bigyello: I'm very happy thank you :wave: