Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sqlce delete error.. what does it mean???

Status
Not open for further replies.

Schimsky

Programmer
Oct 4, 2003
23
0
0
US
Hi,

I've created a simple pocket pc app that adds/edits/and deletes records from a simple database table.

I've got the Adding and Editing records working. The problem I'm having is with the Deleting of Records.

Here's the code...

'************ NONQUERY DELETE CODE ******************
Dim objConn As New SqlCeConnection
Dim objCommand As New SqlCeCommand
objConn = New SqlCeConnection("Data Source = \My Documents\SampleDB.sdf")
objCommand = New SqlCeCommand("DELETE * FROM Candidates Where Candidates.Ssn ='" & txtSsn.Text & "'", objConn)
objConn.Open()
Try
objCommand.ExecuteNonQuery()
Catch ex As SqlCeException
MessageBox.Show(ex.Message)
End Try
objConn.Close()
'*****************************************************

Now Here is the error I get:

There was an error parsing the query. [Token line number, Token Line number, Token line offset,, Token in error,,]

Can anyone tell me what I'm doing wrong here????

Thanks.

Steve



 
Found the problem!

I don't need an * in the query... Just:

Delete From Candidates Where....


thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top