By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

ViewState passed ID [OleDbException (0x80040e07): Data type mismatchin criteria expression.] error?

P: n/a
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
Sep 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
DELETE FROM user_table WHERE ID = '1132';

Try;

DELETE FROM user_table WHERE ID = 1132;

Note the lack of quotes.


Sep 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.