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
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