September 2007 Entries

Creating composite controls using Html Designer.

In the current architecture od our application I have to use composite controls to implement significant amount of HTML UI. It will not be good to load child user controls into parent composite control(but technically probably still possible). I've followed the approach described in David Ebbo's Turning an ascx user control into a redistributable custom control blog post (and in MSDN article). However if you want to modify the control, process of Publish and copy DLL may be annoyed. I've decided ......

Unit Testing in .Net Notes.

Some time ago I posted my Unit Testing ASP.NET Applications notes. This post is to put togeter a few links that I found useful about general Unit testing frameworks. MbUnit vs. NUnit Vs. Team System Unit Testing - Choosing a unit test framework NUnit vs Team System Unit Test In our solutions we are using both NUnit and VSTS Unit testing. I like VSTS for the ability to generate test stubs code. But our build server has only VS Professional installed, that doesn't allow to include VSTS projects to ......

Generic function to removeDuplicates from Generic List

//created based on http://www.kirupa.com/net/r... //Why it is not in .Net Framework yet? Why HashSet<T> is only in Orcas(http://blogs.msdn.com... public static List<GenericType> removeDuplicates<Generic... inputList) { Dictionary<GenericType, int> uniqueStore = new Dictionary<GenericType, int>(); List<GenericType> finalList = new List<GenericType>(); ......

Dynamic URL Web Service URL is not loaded from applicationSettings section in Console application

I have a class library DLL, that has client web services reference. The reference is dynamic and in generated app.config the URL is listed inside <applicationSettings>. I am using the class from web Application(WAP) and by copying <..Properties.Settings> to web.config I am able to change the URL just by modifying value in web.config(I even wrote helper class to Update Dynamic Web reference URLs Diring Installation in Visual Studio 2005). The approach is well described in How to share ......

Do not cache Web ListItems

In our ASP.NET application we have DropDownLists with standard values from reference data(e.g list of Countries). And we used Cache to avoid re-loading them from the database. The function was like the following: private void LoadItems() { ListItem[] cachedItems; cachedItems = GetAppCacheItems(); if (cachedItems == null) { //Load the reference data from the database omitted for simplicity SetAppCacheItems(cachedItems); } Items.Clear(); Items.AddRange(cachedItems); } And this method worked for a long ......

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 ......

"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.InvalidOperationExce... This SqlTransaction has completed; it is no longer usable. at System.Data.SqlClient.SqlTr... at System.Data.SqlClient.SqlTr... I was pointed to MS Kb http://support.microsoft.co... 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 ......

«September»
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456