Geeks With Blogs
Viktor Bergman .Net für alles VB.Net
Maintaining treeview state across pages
The TreeView control in ASP.NET 2.0 is one of my favourite controls for building easy-to-use navigation. But it has some limitations, or at least they appear to me as limitiations. The problem is to maintain the state of the nodes when jumping around pages, especially in an masterpage based UI. So this is the task. I am using the Treeview to present product categories in hierarchy with an unlimited amount of childnodes. I am not interested in using the postback method with javascript as it will not ......

Posted On Monday, November 12, 2007 1:07 PM

A nice trick when you run out connections in the SqlClient pool
Connection pooling is a great feature in the native SqlClient connector. For you who have not heard about it here's an introduction. Which you can obviously skip if you've heard about it ;-): SQL Connections are an expensive resourceBased on your connection string SqlClient will connect to a given Microsoft SQL Server using sockets, named pipes or whatever. This is an un-managed resource which means that it must be explicitly opened and closed; this has to be done since the server has a limit for ......

Posted On Sunday, May 13, 2007 1:50 PM

Detecting overlapping datetime ranges
So, I was working on this method for detecting overlapping time periods for approx 11 hours. The objective was at first simple: take two timeranges and compare them. If they overlap then shout out loud, if not swallow and get on with your miserable life. I must say that this was MUCH more complex than I first thought. You cannot simply check if (dtmOrigEnd > dtmNewStart ) And (dtmOrigStart < dtmNewEnd ). What happens if the new startdate actually is lower than the old startdate, aswell as the ......

Posted On Thursday, April 26, 2007 12:39 AM

Overloading operators in VB.Net
Firstly I must note that this could mess things up pretty bad in your code so keep that in mind before getting all to excited.I am talking about custom operators for classes and structures, that if done with grace can help you a lot. I will begin with introducing the concept of operators first for those of you who might have forgotten about it and then I'll show you how to create your own. What is an operator anyway?The recognition of operators is universal, in maths as well as in programming. The ......

Posted On Monday, April 16, 2007 9:42 PM

The ‘=’ operator vs. Equals() in VB.Net
As I was reading yet another chapter in Code Complete Second Edition by Steve McConnell I started to think about the VB operator '=' versus the C equivalent '=='. Even though im a big VB fan I must say the C style is much better. In VB we use the same operator for two purposes, in one place we use it for ASSIGNING data and in another we use it for COMPARING data. However, I thought that why not use Equals(obj,1 obj2) instead of '=' for comparisons, if not only for the sake of maintaining a more consequent ......

Posted On Monday, March 26, 2007 8:07 AM

Copyright © Viktor Bergman | Powered by: GeeksWithBlogs.net | Join free