TOP

CustomPrincipal and Serialization

Recently, I’ve been working on a project that relies on a backend business object layer.  The business object (BO) layer, requires authentication in order to be used.  For most of the systems, this is okay, but my project is to be used by end users.  We don’t need to authenticate the users… we need to authenticate the system.

This is easy enough using the CustomPrincipal object in Rocky Lhotka’s CSLA framework (which is also being used).  We simply create the CustomPrincipal and add that to the ApplicationContext. (more…)

Read More
TOP

The best compliment

I got a phone call yesterday.  It was from a fairly highly placed individual in another location.  He is a CIO of an entire division.  He called me and paid me about the highest compliment I think I’ve ever gotten.

(more…)

Read More
TOP

Windows Scheduled Task

We run lots of batch processes overnight. We do this to send emails, to generate reports, etc… We do all this via Windows Scheduled Tasks. It works great.

Recently, I needed to add a new scheduled task.  I went through the process of adding the task but when I tried to run it, it failed.  The error message I got was “Could not start task

(more…)

Read More
TOP

Windows 7 is better, but…

I’m a Mac guy at home, but professionally, I’m a Windows guy.  I’ve been a .Net developer since 2000.  Windows XP was pretty good.  Vista stunk out loud.  Windows 7 is good.  Legitimately good.

Don’t be fooled though.   (more…)

Read More
TOP

Displaying Assembly Version Information

On a lot of my websites, I find it very useful to know exactly what version I’m working with.  Not only the version number, but also whether or not it’s running in RELEASE or DEBUG mode.

To accomplish this, it’s a fairly simple process.  Just put a Label control on your webform and then set the text property of it.  Here’s some sample code.

 (more...)
Read More
TOP

The case for ‘IN’

Recently I was doing a little SQL. Just straight SELECT * FROM… kind of SQL. I had a where clause that was working perfectly. It was:

WHERE field1='P' or field1='U'

I ran into a situation where I needed to get a particular row. I had the primary key value so I just threw that into the WHERE clause. Now, instead of getting a single row, I got 73! What?! Examining the WHERE clause shows the obvious problem.

WHERE field2=12345 AND field1='P' or field1='U'

Duh… Using the AND and OR together really screwed it up. It was an easy fix though. I could have solved the problem with some parentheses but decided to use an IN clause instead. It lends itself to be more readable and less confusing.

WHERE field2=12345 AND field1 IN ('P','U')

Read More
TOP

Technically correct vs. Realistic

How often do developers struggle with this question?  I hope I’m not alone in the regard.  There are lots of times when we have to make a decision about doing something technically or academically correct versus doing it the realistic way.  Lots of simple things such as hard coding values into source code or using string values instead of DateTimes.

Are there other times when we choose realistic vs. correct?  Sure… When presented with a choice of having a Twinkie or a stick of celery… well, you know which one will be there at the end.  :-)

Read More
TOP

I may have created a monster

I may have created a monster. It started off innocently enough. I wanted to teach my boy (who will be known as “The Ace”) a little about programming. He’s a tremendously creative kid. I thought he might get some enjoyment out of creating something like a website.

One of the great things about programming is the instant gratification you get. You write a little code and then get to try it out. That’s right up his alley.
So in the spirit of teaching him how to program, I picked up Alice. You can download it for free at http://www.alice.org. It’s a really wonderful system designed to teach object oriented programming to kids.
Well, the Ace used it for a bit and enjoyed it but it wasn’t what he wanted to do. He wanted to make a website. On a side note, his brother (The Deuce) LOVED playing with Alice. He had a lot of fun putting animals out and then controlling them with the mouse. Back to the Ace….
So to make a website, I first tried to have him use Fireworks from Adobe. That was going okay, but again, it’s not what he wanted. Plus, when he was using Fireworks, he was on MY computer! We can’t have that!! So instead, he is now on his own computer. It’s a Windows box and I have Visual Studio installed there.
Last night, we created an ASP.Net website. I taught him just enough Visual Basic so that he can click a button and get sent to another page. I also taught him how to write an IF/THEN block to check a password. It was 10:00 at night and he was still going strong. We had to pull him (literally crying) away to go to bed. When I woke him up this morning, his first words to me were “Can we work on my website after school?” Oh boy…
It’s a good thing I like teaching. :-)
Read More