Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development 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 ......

Posted On Friday, September 28, 2007 10:56 AM

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

Posted On Friday, September 14, 2007 4:13 PM

Generic function to removeDuplicates from Generic List
//created based on //Why it is not in .Net Framework yet? Why HashSet<T> is only in Orcas( public static List<GenericType> removeDuplicates<Generic... inputList) { Dictionary<GenericType, int> uniqueStore = new Dictionary<GenericType, int>(); List<GenericType> finalList = new List<GenericType>(); ......

Posted On Tuesday, September 11, 2007 3:42 PM

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

Posted On Monday, September 10, 2007 9:05 PM

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

Posted On Friday, September 7, 2007 2:15 PM

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

Posted On Monday, September 3, 2007 6:35 PM

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

Posted On Monday, September 3, 2007 1:08 AM

Copyright © Michael Freidgeim | Powered by: | Join free