get the sql statement

A

Afton Wynona

How can I get the actual SQL statement rather than this sh@thole error?

Data type mismatch in criteria expression.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Data type mismatch in
criteria expression.

Source Error:

Line 265: Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Line 266: saveImages()
Line 267: FormView1.InsertItem(True)
Line 268: End Sub
Line 269: Protected Sub btnPanel1Cancel_Click(ByVal sender As Object,
ByVal e As System.EventArgs)
 
D

David Wier

It's hard to tell, with the little information you provided....
The main thing is that, since it's a datatype mismatch - just look at the
data for each field, then check the Database table to see if the datatypes
match - I'm willing to bet you're trying to enter information that the table
wasn't made to have entered.
 
A

Afton Wynona

well no kidding.
How about the question that I asked. Do you have any information on that?
 
M

Mark Fitzpatrick

You might want to try a different approach. If you're going to be like that
to someone who is taking their valuable time to answer you, why should they
bother.

Chances are, you can't get the SQL since it's not the framework that's
throwing the error, it's the database itself, which has no need to make the
SQL statement available. If you're connecting to a database that has a
profiler tool, such as the SQL Server Profiler for SQL Server, you can
capture the entire communication and the actual query that's sent to the db.
You can then run this query directly against the db and see what it responds
then. Usually in these cases the database isn't going to give you any answer
as to what's going on and you just have to figure out which datatype is
incorrect on your own. If it's a stored procedure I often iterate through
all the parameters and their values so I have a list of what's getting
passed and compare it to the stored procedure parameter list. Usually I'm
off because I've jumped an element in the parameter array.
 
A

Afton Wynona

yes, that does help.

I ought to be able to get from ASPX the statement that ASPX is sending to
the database, even though I might not be able to get the statement from the
database.
(I used to be able to do it with ASP).

Next, as far as being rude, believe me I am doing the world a favor by
discouranging people from posting ill-thought out, irrelevant answers that
are nothing but time wasters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top