开发者

inner exception in jquery using the entity framework

开发者 https://www.devze.com 2023-03-03 16:16 出处:网络
I am using the entity framework. In my development computer the application runs great. I uploaded the application to the server and when I open the web page I get an alert of my jquery ajax call to w

I am using the entity framework. In my development computer the application runs great.

I uploaded the application to the server and when I open the web page I get an alert of my jquery ajax call to webservice that return query result from the framework entity. The exception sais: An error occurred while executing the command definition. See the inner exc开发者_JAVA百科eption for details.

The problem is that I don't know how to get the inner exception since it not got to the server.

I used firebug and saw that the response include only the exception I wrote and the stacktrace without the inner exception.

How can I know what is wrong??

UPDATE

This is my ajax call:

$.ajax({
                dataType: 'json',
                processData: false,
                type: 'POST',
                contentType: "application/json",
                url: url,
                context: s.context,
                data: JSON.stringify(s.data),
                error: function (xhr, textStatus, errorThrown) {
if (xhr.responseText) {
        if (xhr.responseText) {
            var message = xhr.responseText;
            try {
                var ex = JSON.parse(xhr.responseText);
                jAlert(ex.Message);
            } catch (e) {
                jAlert('Unknown server error.');
                throw e;
            }
        } else {
            jAlert('Unknown server error.');
        }
    }
    return;
},
                success: function (data, textStatus, xhr) {
                    ........
                }
            });


To view the inner exception remotely, you can wrap the offending code in a try/catch and then display the full exception in the catch by calling:

exception.ToString();

More info in this thread.


This is not an error with your jQuery code. You have an error in your server-side code either in your service or business logic that executes your query. You can view the exception message in the ajax error handler. You can also open up fiddler or the IE9 F12 tools to examine the response body being sent back by your service.

0

精彩评论

暂无评论...
验证码 换一张
取 消