-
Apr 9th, 2012, 11:20 AM
#1
Thread Starter
Member
[RESOLVED] SQLCE problem with DELETE
HI!
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 ?
Last edited by MThaste; Apr 9th, 2012 at 12:10 PM.
-
Apr 9th, 2012, 12:14 PM
#2
Re: SQLCE problem with DELETE
Have you tried using
a
instead of
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Apr 11th, 2012, 08:08 AM
#3
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.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Apr 11th, 2012, 10:53 AM
#4
Thread Starter
Member
Re: SQLCE problem with DELETE
Originally Posted by abhijit
Have you tried using
a
instead of
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 I'm very happy thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|