Click here to Skip to main content
16,006,065 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Read/Amend of MS words in C# (ASP.NET) Pin
HatakeKaKaShi27-Oct-09 23:48
HatakeKaKaShi27-Oct-09 23:48 
GeneralRe: Read/Amend of MS words in C# (ASP.NET) Pin
Christian Graus27-Oct-09 23:49
protectorChristian Graus27-Oct-09 23:49 
GeneralRe: Read/Amend of MS words in C# (ASP.NET) Pin
HatakeKaKaShi28-Oct-09 0:11
HatakeKaKaShi28-Oct-09 0:11 
QuestionThis SqlTransaction has completed; it is no longer usable Pin
Karan_TN27-Oct-09 20:12
Karan_TN27-Oct-09 20:12 
AnswerRe: This SqlTransaction has completed; it is no longer usable Pin
Sachin Dubey27-Oct-09 20:17
Sachin Dubey27-Oct-09 20:17 
GeneralRe: This SqlTransaction has completed; it is no longer usable Pin
Karan_TN27-Oct-09 21:12
Karan_TN27-Oct-09 21:12 
GeneralRe: This SqlTransaction has completed; it is no longer usable Pin
Christian Graus27-Oct-09 21:25
protectorChristian Graus27-Oct-09 21:25 
AnswerRe: This SqlTransaction has completed; it is no longer usable Pin
Abhishek Sur27-Oct-09 22:13
professionalAbhishek Sur27-Oct-09 22:13 
Are you talking about ThreadAbortException...

Both Response.Redirect and Server.Transfer creates a new Thread and terminates the Current Thread by calling Thread.Abort and redirects the Response stream to new thread. Thus It generates a First chance ThreadAbortException.

If you call
Response.Redirect(url,false)
it will not throw the first chance exception as it will skip the call to Response.End in the current thread.

so your code should be
SqlTransaction trans = null;
try
{
trans = conn.BeginTransaction();
sqlCmd = new SqlCommand("UPDATE tble SET col1=null", conn);
sqlCmd.Transaction = trans;
sqlCmd.ExecuteNonQuery();
sqlCmd.Dispose();
trans.Commit();
Response.Redirect("NewInc.aspx", false);
}
catch
{
trans.Rollback();
throw;
}

I hope this help you. Smile | :)

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords
/xml>

GeneralRe: This SqlTransaction has completed; it is no longer usable Pin
Karan_TN27-Oct-09 22:33
Karan_TN27-Oct-09 22:33 
AnswerRe: This SqlTransaction has completed; it is no longer usable Pin
carlecomm28-Oct-09 1:39
carlecomm28-Oct-09 1:39 
QuestionProblem in excel opening on IIS 5.1 Pin
amittinku27-Oct-09 20:08
amittinku27-Oct-09 20:08 
AnswerRe: Problem in excel opening on IIS 5.1 Pin
Christian Graus27-Oct-09 21:26
protectorChristian Graus27-Oct-09 21:26 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
amittinku27-Oct-09 21:37
amittinku27-Oct-09 21:37 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
Christian Graus27-Oct-09 22:15
protectorChristian Graus27-Oct-09 22:15 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
amittinku27-Oct-09 22:21
amittinku27-Oct-09 22:21 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
Christian Graus27-Oct-09 22:36
protectorChristian Graus27-Oct-09 22:36 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
amittinku27-Oct-09 22:57
amittinku27-Oct-09 22:57 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
amittinku28-Oct-09 17:23
amittinku28-Oct-09 17:23 
GeneralRe: Problem in excel opening on IIS 5.1 Pin
amittinku28-Oct-09 18:43
amittinku28-Oct-09 18:43 
QuestionFavIcon.Ico Problum Pin
Sachin Dubey27-Oct-09 18:32
Sachin Dubey27-Oct-09 18:32 
AnswerRe: FavIcon.Ico Problum Pin
sashidhar27-Oct-09 19:19
sashidhar27-Oct-09 19:19 
QuestionVertical and Horizontle scroll bars in a dropdownlist Pin
haleemasher27-Oct-09 18:15
haleemasher27-Oct-09 18:15 
AnswerRe: Vertical and Horizontle scroll bars in a dropdownlist Pin
Sachin Dubey27-Oct-09 18:43
Sachin Dubey27-Oct-09 18:43 
GeneralRe: Vertical and Horizontle scroll bars in a dropdownlist Pin
haleemasher27-Oct-09 19:37
haleemasher27-Oct-09 19:37 
GeneralRe: Vertical and Horizontle scroll bars in a dropdownlist Pin
Sachin Dubey27-Oct-09 20:00
Sachin Dubey27-Oct-09 20:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.