Results 1 to 4 of 4

Thread: [RESOLVED] SQLCE problem with DELETE

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2012
    Posts
    47

    Resolved [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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width