Hilton Giesenow's Jumbled Mind

the madness that is...

News

This is my little spot in cyberspace where you will find a collection of random (but mostly software-related) thoughts and ideas that are frightening in their shining brilliance (or something like that ;->).
 
Please enjoy your stay and feel free to Contact Me.
 
Microsoft MVP
 
I'm a Shoe Circus Member!

.Net Links

BlogRoll

Misc. Links

Syndication

February 2005 - Posts

Unit Testing - finally
Ok, I am ashamed to admit it, but I have finally only now gotten around to using unit testing and nUnit. Man, this stuff rocks! I am using TestDriven.net which includes nUnit, a gui for nUnit and some other tools. If you are not using it, get it now and try it out, trust me. I've been using it for 1 day and it is already saving me time!
Posted: Feb 24 2005, 06:38 PM by hiltong | with 1 comment(s)
Filed under:
More Notes on Typed Datasets

In a recent MSDN Magazine article, Efficient Coding with Strongly Typed Datasets, John Papa discussed the common practice of extending standard ADO.NET datasets through auto-generated derived classes that wrap much of the complexity and inefficiencies one faces with “raw” datasets. The article highlights some of the benefits of this approach as well as some of the caveats. However, there are a number of essential points that developers and architects need to be aware of both in going down this route and actually negotiating the path. This article covers various enhancements and additional benefits to this approach as well as important caveats and potential pitfalls (and how they can be avoided) that are generally less well covered but nonetheless important.

The full article is available here on the asp.netPRO website (registration required) or in print in the March 2005 edition.

Posted: Feb 17 2005, 06:40 PM by hiltong | with no comments
Filed under:
Installing Windows Sharepoint Services - Advanced Options

Just a small gripe today ;-). I've been looking through the Sharepoint admin guide at some of the advanced installation options and it lets you do a lot more customization than the installation gui (like setting the port that the admin website runs on).

Now it is definitely useful to have these options but its annoying that so few of them can be done from the gui. MS: Any chance of having them added, like most applications have an “advanced” option for installing?

Posted: Feb 10 2005, 10:30 AM by hiltong | with no comments
Filed under: ,
Installing Windows Sharepoint Services - Check Your SQL Server Setup

I mentioned a little while ago that we was having trouble getting Sharepoint installed at our client. We finally found the solution. What was happening was this: when you install Sharepoint it creates an administration web site with a configuration database. When you then create actual sharepoint sites (1..n) they have separate content databases. However, the first step in rendering the site is to find out what its content database is set to in the config database. When this happened the site would crash with an error “cannot connect to configuration database”.

Of course this only happened in the live environment. Test was fine (!).

Googling this or the similar error in the event log didn't help much. Mostly it pointed to this kb which stated that the application pool account didn't have the incorrect permissions to the database. We then tried multiple setups with the test environment and VPCs connecting to various databases. What we finally discovered was that the live SQL environment we were connecting to was set up to run on port 1495, and not the default 1433! Sharepoint, it seems will only work if (a) the database accepts TCP/IP requests, and (b) only on port 1433 (default). There were three possible workarounds we came up with:

  1. Change the port SQL Server is running on
  2. Install SQL Client Tools on the web server and create an alias
  3. Point to another SQL Server (not as funny as it sounds - this is what we had to do for a variety of reasons)

Now, what really irks me is that it explicity asks for database information for the config database and the content database and it does use these settings to connect. However, it also uses Windows authentication to connect to the config database using the IIS application pool account identity, which it does not seem you can override. This kind of defeats the purpose of even allowing you to specify settings for the config database connection - it's not going to use them.

Am I incorrect here? Did I miss something in the admin guide / sdk / etc.? If not - please adjust this!

[Update] It seems that a number of visitors are getting to this post after searching for help on this. If the information in this post helps you or you find another good solution then please let me know - H]

Posted: Feb 09 2005, 12:17 PM by hiltong | with 1 comment(s)
Filed under: ,
A New Belt Buckle for Chuck

There is a lot of banter around SADev about Chuck's Ford belt buckle and getting a replacement, so I decided to come up with a new one for him to wear proudly in his new position at Microsoft ;-)

Posted: Feb 09 2005, 11:56 AM by hiltong | with 1 comment(s)
Filed under:
Sealed Keyword

I'm currently reading Enterprise Solution Patterns Using Microsoft .NET  an I am really enjoying it. It is a practical application of some of the more common design patters. Once again, great work done by the Patterns group at Microsoft. In the last chapter I read there is a link to a very interesting discussion on Chris Sells' site called Sealed Sucks. Sealed, for us vb.net guys, is the equivalent of NotInheritable.

What this means is that the class you (or someone else) have written cannot be inherited and expanded upon in a derived class. Chris feels that “Sealed pre-supposes that the designer of the base class either 1) knew everything it'd ever be used for or 2) was too scared to let someone else try their own stuff with it“ and to some degree I agree with him. If you seal a class you effectively eliminate some of the fundamentals of OO. Inheritance is a great feature that lets you take an existing class to a completely new level. However, that said, I do believe there are times when a class should be sealed, especially in a specialized situation. For example, I imagine there is some pretty nasty stuff going on in the sqlclient namespace, and I wouldn't feel too happy about using an overridden version of it that I had just picked up from the scary www.

This problem, however, is further exacerbated when the sealed class is used as a parameter into a method. This is exactly what interfaces should be used for! A great example of this is the DAAB which uses abstract classes and interface parameters. This means it is making good use of abstraction and allowing for extension.

IMHO, I agree completely with some of the arguments put forth that, if sealed has its place (and I think it does) then the very least one should do is never force the use of the sealed class as a method parameter - rather use interfaces (or at least an open base clase).

Posted: Feb 07 2005, 10:08 AM by hiltong | with 1 comment(s)
Filed under:
Dinner Feedback
Angie had some nice things to say about the dinner, and she even wrote an awesome poem!
Posted: Feb 04 2005, 01:32 PM by hiltong | with no comments
Filed under:
Last Night's Nerd Dinner
Hey guys, thanks for a great evening last night. I posted feedback on the site but I had trouble with putting the images up there, so check the gallery here
Posted: Feb 04 2005, 09:44 AM by hiltong | with no comments
Filed under:
Conditional Compilation in VB.Net

So I'm browsing the MSDN library, like one does of an afternoon, and I see the section on #If...Then...#Else Directives. Apparently it existed in the vb6 days, too, but I somehow missed this one. It obviously functions similarly to a regular If .. Then .. Else in terms of conditional logic but the difference is that it is a compile-time directive. What this means is that you can actually compile different physical versions of your product based on different conditions (e.g. debug vs. release).

[update: Rocky Lhotka put up a nice post recently about A scary way to do conditional compilation - an interesting read]

Posted: Feb 03 2005, 03:49 PM by hiltong | with 1 comment(s)
Filed under:
Sharepoint Database Password Encryption
I'm looking at some of the Sharepoint configuration, specifically the configuration database at the moment, and I see that the Databases table contains a listing of all of the content databases. What is a bit concerning is that it stores the username and password that it uses to connect to the content databases in clear text. That strikes me as an nasty security hole?
Posted: Feb 03 2005, 09:55 AM by hiltong | with 2 comment(s)
Filed under:
Windows Sharepoint Services - Problem Searching Against the API

Ok, I've got an interesting one here. If anybody has any suggestions they would be greatly appreciated.

When I try an search for an item against the Sharepoint API (WSS, not SPS, by the way), I try something like:

Dim oResults As SPSearchResultCollection = oSPWeb.SearchListItems(strSearchTerm)

But I get 0 results. When I add a “dummy“ CAML search., like

Dim oListSearch As SPList = oSPWeb.Lists(1)

Dim oSPQuery As New SPQuery

oSPQuery.Query = "Dummy Search"

Dim iDummyResults As Integer = oListSearch.GetItems(oSPQuery).Count

 

Dim oResults As SPSearchResultCollection = oSPWeb.SearchListItems

 (strSearchTerm)

Then it works *-(. Also, it only seems to be a problem on some servers. Anyone got any idea what's going on here?

I tried emailing Patrick Tisseghem about this, and he put me on to someone on his team who has particular experience with this stuff, but they were stumped too :-(

update: removed unnecesary code.

Posted: Feb 02 2005, 11:23 AM by hiltong | with 2 comment(s)
Filed under: ,
New DVDs x2

Ok, so I have to brag again. These are like the last discs I will get for a while, but coincidentally the discs I ordered a while ago from another person who has going to the U.K. came through. I got ....

...

The Lord Of the Rings Trilogy Special Extended Edition (notice the lots of capital letters). Being the Extended Edition, its got the extra bits - 2 hours, to be exact. It is a 12 DISC SET!!! Man, if no one sees me for a few months you'll know why. I can't wait to check these out.

Posted: Feb 01 2005, 08:11 AM by hiltong | with no comments
Filed under: