473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
1 2698
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Davis | last post by:
I don't understand when I do (2), it will throw the error when I run the ASP. (1) is working fine. Should I use a single quote between the string in SQL statement in ASP? (1) strSQL = "SELECT *...
3
by: martlaco1 | last post by:
Trying to fix a query that (I thought) had worked once upon a time, and I keep getting a Data Type Mismatch error whenever I enter any criteria for an expression using a Mid function. Without the...
0
by: dim mzeura via .NET 247 | last post by:
(Type your message here) -------------------------------- From: dim mzeura I have the same problem too. Please help! System.Data.OleDb.OleDbException: Syntax error (missing operator) in...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
5
by: blackburnj55 | last post by:
Hi, I am constructing a website for a bike shop. I am using dreamweaver and an access database to create it. I have made a query where two criteria are entered to get results. These are :...
1
by: Bobby Edward | last post by:
Using Access db with VS2008 (ASP.NET/VB.NET).... On the INSERT command I get this error: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. I haven't found a...
9
by: nixonmg | last post by:
When the Command Button "Notify" is clicked, I am wanting to send out an email to the user with appropriate information in the email (works great), check the "Notified" check box (does not work), and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.