System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
hi guys,
This is the Error i am getting when i execute a stored procedure with giving all parameter as null values.,
Wts the problem actually, I created my stored proc to allow null value but i got this error why?
if you give true(defalut is true) it will immediate redirects to your new page.
example:
void MyMethod(int i)
{
Response.Redirect("~/default.aspx",true); //The code here will not execute, as it will throw the error and come out of the function.... }
if you give false it will execute your whole method code, even its after response.redirect.
void MyMethod(int i)
{
Response.Redirect("~/default.aspx",false); //The code here will execute. }
MARK AS ANSWER IF IT HELPS
Marked as answer by ssjGanesh on Nov 24, 2011 06:01 AM
ssjGanesh
Participant
1970 Points
1395 Posts
See the Error,why it comes guys?
Nov 23, 2011 05:00 AM|LINK
Mark as answer,if it helped U!
jassi_singh
Participant
1713 Points
419 Posts
Re: See the Error,why it comes guys?
Nov 23, 2011 05:16 AM|LINK
Hello,
Are you executing the SP from application or SSMS?
ssjGanesh
Participant
1970 Points
1395 Posts
Re: See the Error,why it comes guys?
Nov 23, 2011 05:17 AM|LINK
from application.....
I am calling that procedure from code behind file.,
Mark as answer,if it helped U!
nilay.kothar...
Member
231 Points
44 Posts
Re: See the Error,why it comes guys?
Nov 23, 2011 06:34 AM|LINK
Can you please post the code from where you are calling SP? since it is thread aboart exception most likely it is from C# part.
Nilay Kothari
ssjGanesh
Participant
1970 Points
1395 Posts
Re: See the Error,why it comes guys?
Nov 23, 2011 08:32 AM|LINK
Mark as answer,if it helped U!
Ruchira
All-Star
44342 Points
7194 Posts
MVP
Re: Exception was unhandled by the user code
Nov 23, 2011 09:15 AM|LINK
It's nothing to do with passing null parameteres. I think you SQL server instance is running out of memory.
See the below link to manage memory in SQL.
http://blogs.msdn.com/b/sqlclr/archive/2006/03/24/560154.aspx
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.sendtosree
Participant
874 Points
201 Posts
Re: Exception was unhandled by the user code
Nov 23, 2011 09:18 AM|LINK
Please post the code
Sree
Mark as Answer if it helps
patricgreat
Participant
983 Points
278 Posts
Re: Exception was unhandled by the user code
Nov 23, 2011 09:20 AM|LINK
this is becausee of your Response.Redirect Code, pass second parameter as a false in response.redirect.
Response.Redirect("~/Default.aspx",false)
ssjGanesh
Participant
1970 Points
1395 Posts
Re: Exception was unhandled by the user code
Nov 24, 2011 04:30 AM|LINK
Thanks., that problem got clear,
But why we should give "false" as a 2nd parameter.
whatwill happen if we give "true" and whatwill happen if we give "false" .-
Mark as answer,if it helped U!
patricgreat
Participant
983 Points
278 Posts
Re: Exception was unhandled by the user code
Nov 24, 2011 05:55 AM|LINK
if you give true(defalut is true) it will immediate redirects to your new page.
example:
void MyMethod(int i)
{
Response.Redirect("~/default.aspx",true);
//The code here will not execute, as it will throw the error and come out of the function....
}
if you give false it will execute your whole method code, even its after response.redirect.
void MyMethod(int i)
{
Response.Redirect("~/default.aspx",false);
//The code here will execute.
}