D
DC
Any idea why this code would cause a [OleDbException (0x80040e07): Data
type mismatch in criteria expression.] error?
The SQL that gets executed seems to be (using record 1132 as an example)
DELETE FROM user_table WHERE ID = '1132';
And the value of ViewState("ID") =1132
ID is an Access database autonumber field. Is Viewstate data passed as
an odd type or something?
Thanks in advance,
Code
____________________________________________________________________________
Sub Get_Command (Src As Object, Args As DetailsViewCommandEventArgs)
If Args.CommandName = "Yes" Then
DetailsSource.DeleteCommand = "DELETE FROM user_table WHERE ID = '"
& ViewState("ID") & "';"
DetailsSource.Delete()
GridView.DataBind()
EditMSG.Text = " Record " & ViewState("ID") & " deleted"
End If
End Sub
type mismatch in criteria expression.] error?
The SQL that gets executed seems to be (using record 1132 as an example)
DELETE FROM user_table WHERE ID = '1132';
And the value of ViewState("ID") =1132
ID is an Access database autonumber field. Is Viewstate data passed as
an odd type or something?
Thanks in advance,
Code
____________________________________________________________________________
Sub Get_Command (Src As Object, Args As DetailsViewCommandEventArgs)
If Args.CommandName = "Yes" Then
DetailsSource.DeleteCommand = "DELETE FROM user_table WHERE ID = '"
& ViewState("ID") & "';"
DetailsSource.Delete()
GridView.DataBind()
EditMSG.Text = " Record " & ViewState("ID") & " deleted"
End If
End Sub