Tuesday, June 01, 2004

Employee benefits

Getting married to a foreigner really opens your eyes on some things that you generally take for granted. Take for example, vacation time and healthcare benefits here in the USA. Standard seems to be that you shell out some bucks for a family plan and you get ~ 10 days vacation per year at the lower/middle experience levels.

Come to find out that in Sweden where my wife is from, you get 5 weeks of vacation and everyone gets healthcare.

Then again they pay a crapload more in taxes...

It got me to thinking though... am I more productive for having worked more during the year? I think the answer is no! When I really analyze my work week, my effectiveness as a coder really starts to drop off after about 6 hours a day. Makes me wonder if other coders have this problem. I personally can only stare at a screen for so long before my mind starts to wonder...

Friday, May 28, 2004



I don't have a very warm track record with third party tools. In general, I have found most of them to be pretty complex to use and time consuming to learn to the point where it isn't worth me pursuing them.

So I downloaded the developer trial of dotnetcharting's component with pretty low expectations...


I had this tool installed and a simple sample chart up and running correctly in less than 20 minutes. Very impressive.

I am definately going to purchase this for my web application business once I um... find a customer and get the site up.

Wednesday, May 26, 2004

Getting excited

I'm getting really close to launching my ISV project! I actually registered a domain to hold my product offerings. The website is www.easywebapps.com. I doodled a little bit with the template tool that my host 1and1.com provided and put in some sample text.

Note that this isn't the final site by any means, I just felt like playing.

My experience with 1 and 1 as a hoster has been mixed. Their MS Developer package at $19.95 a month is pretty reasonable. Domain registration etc is a snap and their admin tools for email etc are pretty easy to use.

Their SQL Server tool needs work though. I found that it only takes imports/conversions via MS-Access, and I haven't seen a listing for stored procedures in the admin tool at all. I ran a create script in an attempt to push one into the background, but it didn't seem to work. This is pretty annoying since I favor webforms calling classes calling stored procs. I'll probably end up moving the sql into the classes.

On the bright side, I think Easy Assets .NET will be ready for demo by the end of the holiday weekend. I have a google ad-word campaign set up and ready to fire as soon as my website is completed.

For the first time now I can see the finish line!

Monday, May 24, 2004

Single application, multiple users with their own databases?

For no special reason I've been kicking around thoughts about the best way to manage connection string in an ASP .NET application where users each have their own database.

IE we have user A whose database is database A.
user B is in database B.

One solution is to have them log in with a domain user name, then parse the domain to a configuration key to snag their connection string on data access pages.

This seems kind of clunky to me though, any better ideas?

Monday, May 17, 2004

ASP .NET impersonation and LDAP

So we're working on getting a user's full name out of Active Directory services for headers in our webpages. Basically we just want to say "Welcome |your name|" somewhere in the header.

We built and tested a class that seemed to work fine, here's the code snippet:

public class User
string loginName;
string fullName;

public User(string LoginName)
loginName = LoginName;
fullName = GetDirectoryServiceProperty(loginName, "Name");

static string GetDirectoryServiceProperty(string ObjectName, string PropertyName)
DirectoryEntry de = new DirectoryEntry("LDAP://yourcompany.com");
DirectorySearcher aSearcher = new DirectorySearcher(de);
StringBuilder filter = new StringBuilder();

filter.AppendFormat("(anr={0})", ObjectName);
aSearcher.Filter = filter.ToString();
SearchResult sr = aSearcher.FindOne();

if (sr == null)
throw new NullReferenceException("No such directory entry exists");

DirectoryEntry directoryObject = sr.GetDirectoryEntry();

return (string)directoryObject.Properties[PropertyName].Value;

public string LoginName { get { return loginName;} }
public string FullName { get { return fullName; } }

So we go ahead and deploy this to our web application, which is using windows authentication... and it gives us a null exception.

We poke around a bit and discover even though we were using windows authentication and the Context.User.Identity.Name property was returning a user name, the ASPNET account was the one trying to run the LDAP service which apparently is illegal by default.

Long story short, we added identity impersonate="true" to our web.config and everything started working fine.

Welcome to my world

Yeah, I've decided to start doing this blogging thing. Mostly this is going to be developer stuff that I've used at work for my own convenience.

I'm currently working in Visual FoxPro and C# .NET at the office and in C# at home where I'm working on starting a hosted application business.