Helper Classes that I am using.

I've posted a few helper classes, that I've created by myself or based on some others source code.
There are also a few classes from other authors, that I am using in my applications without or with minor changes.

Below I will list the  links to their classes:

Configuration:
C#/.NET Command Line Arguments Parser(by the way, it was the first class in C#, that I included to VB solution)

Custom app.config  -load configuration settings from an external file(alternatively see Reading a config section from an external file in ASP.NET 2.0)

ADO.NET  helpers:

Export Data to CSV ( Excel ), C# Samples (alternatively

C# class library for exporting data to CSV/Excel file - The CodeProject could be used)

ASP.NET

Common Web Page Class Library - Part 2 By Eric Woodruff - Detecting changes in data controls in ASP.NET web forms
(Consider to use Dirty Panel Extender (ASP.NET AJAX) - The Code Project  instead)

To manipulate with URI/URL I am using my own UriHelper class as well as UrlUtils class, downoaded from Mono(some early version can be viewed here). I've just changed class to public,and commented references to internal methods.

I've noticed that some of my  helper classes are not searched by Google, that II hope that these links will help Google to crawl it:
DataBinderHelper class..
My StreamHelper class
My ArrayHelper class.

"This SqlTransaction has completed; it is no longer usable." errors

Our system started to get intermittent errors like the foolowing in the code that was NOT changed recently:

System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
at System.Data.SqlClient.SqlTransaction.ZombieCheck()
at System.Data.SqlClient.SqlTransaction.Rollback()

I was pointed to MS Kb http://support.microsoft.com/kb/912732, that I've installed, but it didn't change -errors still appeared.

Unfortunately, the KB doesn't have a list of changed files and their versions, so I can't say for sure that my install was successful.

The same issue reported in different places: http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic21204.aspx , http://support.citrix.com/forums/thread.jspa?forumID=115&threadID=93236 ;http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic37219.aspx

In  the thread SQL Server Raiserror and .NET SqlDataAdapter noted ,that the error ould be result of extra commit/Rollbcks in SQL trigger that uses @@ROWCOUNT > 0 .

Some people(see here) had this problem back in 2003 and MS dona fix for them. Why we have the same errors now?

The post "SQL Server, ADO.NET and Nested Transactions" points that SQL Server setting SET XACT_ABORT ON can cause the errors.
But the setting of SET XACT_ABORT is by default OFF and can be set at execute or run time ,   can't be specified on Server/Database level.

The MSDN SqlTransaction.Rollback Method () documentation has a good example , showing that in a catch block, error should be logged first, and then call Rollback in another Try block.(see also  this Microsoft Knowledgebase entry).

Finally I understood that Rollback is NOT required when using block is specified, because "The transaction is rolled back in the event it is disposed before Commit or Rollback is called."
It is confirmed in  Community Content in http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.aspx and in CodeProject Easier Database Transactions - Extending the Using Statement to Perform Automatic Database Transactions,

We will need to change our code to get rid of Rollback() in catch sections,when using block is specified.It will help to see the actual error causing exception.

Update: After removing explicit calls to Rollback we found that tte most of errors were caused by timeouts in access to database. It is still required to solve these errors, but it is another story.


«September»
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456