Friday, October 23, 2009

Okay, maybe this is no revelation for some of you out there, but here’s a quick, down-and-dirty way of displaying an HTML-Encoded column in a GridView. By default, the GridView will display bound columns with the HTML encoding so if you want to see the HTML formatting you need to do an HTMLDecode operation.

In the GridView.RowDataBound() event add the following line of code…

e.Row.Cells(4).Text = Server.HtmlDecode(e.Row.Cells(4).Text)

Substitute the number (in this case 4) with the column that contains the HTML, unless of course the column IS 4! You could also do an HTMLDecode on each column using the following syntax.

For Each oCell As TableCell in e.Row.Cells

oCell.Text = Server.HtmlDecode(oCell.Text)

Next

You are better off however if you simply decode the required columns because of performance. Not every column in your GridView is likely to contain HTML.

That’s all folks!!

 

Friday, October 23, 2009 10:44:29 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Saturday, April 04, 2009

The latest tool offered for Public Housing Agencies is our Website Designer. This tool allows agencies to create their own websites with no website design or programming experience.

The PHAnetwork Website Designer (click here to visit the site) uses simple content editing and multiple selection to create a powerful, advanced and professional presence on the web. The user can choose from a variety of template designs and pick and choose what pages to include.

The available pages include links to Properties, Program information, Resident Services, Board of Commissioners, Staff, an FAQ page, a Contact page and a Documents page where users can upload documents and forms of value to their site visitors. The user can also setup up to 3 additional custom pages for other types of content. If that’s not enough, image galleries can be added to highlight resident activities, construction updates or just about any other pictorial information that needs to be conveyed.

Unlike other tools, the PHAnetwork Website Designer is targeted specifically to Public Housing Agencies. To see a sample site click here.

For more information click on the link above. To sign up go to PHAnetwork.com and click the Join link.

Saturday, April 04, 2009 2:23:27 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Saturday, January 24, 2009
This article outlines methods to successfully connect to SQL server through the Windows Firewall.
Saturday, January 24, 2009 6:40:08 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Thursday, June 26, 2008

When I started this this blog I decided that I would make at least 2 entries each month. There's nothing worse than a static blog. Needless to say, several months have passed with no blog entry. So I thought I would take this time to update the projects and activities that have been taking up my time.

PHAnetwork.com Update

There has been a lot of progress in the latest version of PHAnetwork.com. Originally, we had planned to release this in June but now it looks more like late July. A lot goes into completing and installing a software release and we want to make sure we hit the ground running with this one.

We've also added more features and reports to the new release which has delayed things a bit. In addition, the online help and training tutorials have taken more time than we anticipated. Suffice it to say however, when the new release is in our users will benefit greatly. Stay tuned for a release date and some release documentation.

ASP.NET 3.0

Since updating to Microsoft Visual Studio 2008, I have done very little .NET development. I've been firmly entrenched in the new release of PHAnetwork.com and haven't had an opportunity to spend much time there. Once the release is done (and vacations are over) I can focus on some projects that have been put on the back burner. I'm also awaiting the 3.0 update to Paul Sheriff's PDSA framework which will be the basis of many future applications.

Leisure Time

No, there hasn't been much leisure time lately, but with the warmer weather, one thing I do look forward to is Radio Controlled flying. I've been interested in building and flying models since I was a kid but I just got back into this last summer. This is a hobby that I share with my 10-year-old son. We're not talking about toys here either. The planes that we fly range in wingspan from 40" to 54" and we're planning to go bigger. I have also experimented with an onboard video camera that produces some amazing video. I may post a sample here in the future.

Okay, there's my blog entry for June. See you next month!!

Thursday, June 26, 2008 8:04:53 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Friday, March 21, 2008

While ASP.NET has been a boon to developers and web application projects alike, it stands to reason that several "classic" ASP applications are still out there needing support and updating. I can speak from experience. I have a very large application that will remain an ASP application for many years to come. The cost-benefit ratio just doesn't justify migrating this application to ASP.NET. That doesn't mean that you can't take some steps to spice up those applications and give them similar features to ASP.NET applications. Here are a few tips to do just that.

Use JavaScript for Form Validation

When the first ASP applications were launched, developers couldn't count on the availability of JavaScript to perform form-level validation, but today, almost every browser is perfectly capable of executing JavaScript code. I use JavaScript to validate dates as they are entered, to validate and reformat dollar figures and to enable or disable form controls based on selected options. This makes the user experience much better when working with data entry forms.

Try standardizing your validation functions to make them as portable as possible. For example, to create a generic date validation routine, pass the name of the control to the function as a parameter along with the error message you want to display (or you can just use a generic error message). Below is an example of what this function might look like.

 

jsvalidatedate

The RTrim() and isDate() functions are not standard JavaScript functions but rather functions that I have written, but you get the general idea. In the control's onChange event you call this function passing the name of the control, the error message you would like to display and the default value you would like to assign to the date control in the event that it is invalid. For example...

<input type="text" size="12" maxlength="10" name="txtDate" id="txtDate" onChange="return validateDate('txtDate', 'The date entered is not valid', '03/01/2008');">

Using JavaScript with your ASP applications can greatly enhance the user's experience. You can extend this technology to validate dollar amounts and reformat them for the user. While performing form validation using JavaScript is not nearly as simple as with ASP.NET, there's still no excuse for not introducing some level of control to your applications.

Use Include Files to Standardize Pages

In ASP.NET, developers have benefited tremendously from the introduction of Master pages. Master pages allow you to define one or more master, template pages that all pages in the application inherit from. When content is changed in the master page, all descendent pages reflect those changes.

This can be done to a lesser degree in classic ASP with include files. In my applications, I typically setup a standard banner at the top of the page that identifies the user logged in along with some standard links. I set this up in a separate ASP and include this below the opening <Body> tag in every page. For example...

<!-- #include file="pageHeading.asp" -->

In the "pageHeading.asp", make sure not to include any <HTML>, <HEAD> or <TITLE> tags since the sole purpose of this file is to be included in other pages that already contain these elements. Other than that, you can include any HTML you like and you can also reference external style sheets. You can also include ASP code that performs tasks such as looking up the user's name in a database or logging activity.

Although you may be saddled with the task of maintaining ASP applications, there's no reason you can't enhance these to improve the user experience and to make the management of the code simpler.

Friday, March 21, 2008 7:23:27 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Saturday, March 08, 2008

Cenozoic Period

In previous posts I described my historical computer background during the Paleozoic and Mesozoic periods. In this section, I present the Cenozoic period and bring you up to the current time.

Clipping Along

Shortly after leaving Genesis Business Systems, I went to work in the family construction business putting my accounting skills to work as the company comptroller. I also put my computer skills to work to automate the company. I started by putting in Accounting Software (early version of DAC Easy Accounting) and some job costing software. I also learned professional construction estimating and attended a school to learn the finer points. It was interesting work and I later put bids together for some large construction projects including schools and hotels.

While learning my estimating skills I realized that software would greatly improve the estimating process. I had been working with Ashton-Tate's dBase III while awaiting the release of dBase IV when I heard about a dBase III compiler called Clipper. I did some reading about Clipper on CompuServe (remember that!) and discovered that it might be worth the investment. I went to the nearest Egghead Software store (remember them also!) and purchased a copy of Nantucket Clipper '87.

clippers87

Clipper took dBase III code and compiled it into a standalone executable that could be distributed royalty free. More importantly, the resulting programs executed much faster than their interpreted dBase III counterparts. I worked through some of the examples and quickly started to make progress. With the help of a Clipper guide written by Art Fuller, I was able to put together pull-down menus, selection grids and reports. The end result of my efforts was Ideal Estimator. This application was an assembly-based estimating system for drywall and plastering contractors that would handle construction assemblies, take-offs, material lists, estimated labor reports and bid quotes. I tried briefly to market this but found out early on that there was genuine apprehension when it came to computers in the construction industry, particularly with subcontractors.

Nevertheless, the family business continued to use the product up until a few years ago and it did build some very important job skills that would land me my next job.

Back to the Industry

After about 2 years in the family business I decided I needed re-enter the job market. I went to a placement specialist (aka head hunter) and got 2 interviews. The first was with a small startup company that was developing a product in dBase IV. After my first interview in years, I left totally convinced that I had the job. The interviewer was impressed with my background and with my software development experience. However, for some unknown reason, he went in a different direction and I was left looking for the next interview.

That interview came in the form of a Gas Utility Company in Boston. They were looking for a Clipper Programmer. During my first interview, I demonstrated Ideal Estimator and from that point on the company was sold. After 2 more interviews I was hired and started work for Algonquin Gas Transmission Company (AGT) in January of 1991.

AGT was a small fish in a big pond of Natural Gas Utility companies. They had been purchased twice in the previous 10 years. Nevertheless, they had an amazing amount of autonomy and the development environment there was rich. I started working on Purchasing Applications since Purchasing was a huge part of their business. I worked almost exclusively on Purchasing applications for the next 2 years and honed my skills in Clipper 87 and eventually Clipper 5.01 and Clipper 5.2. Through AGT, I attended 3 Clipper development conferences where I learned even more and was able to interact with Clipper Developers from all over the world. The Clipper community was dedicated to their toolset and to this day, they are proud to announce their heritage. It was during my Clipper days that I first met Paul Sheriff (PDSA, Inc.).

After 2 years at AGT, I started to see the writing on the wall. More and more control was gradually taken away from AGT from their parent company. The prospects of staying at AGT until retirement quickly eroded and I decided to make my break at the end of 1992. In January of 1993, I made the transition from employee to consultant. As is often the case, AGT hired me back as a consultant and paid me a much higher hourly rate. As fate would have it, the IT staff at AGT was quickly reduced until eventually, I was the only programmer working on AGT applications. This went on for about 8 years.

Public Housing Beckons

In 1993, my long-time friend (and brother-in-law) joined my consulting firm. We had the brilliant idea of developing a Real Estate application aimed at residential Real Estate firms. The application was designed as a combination of software and service where subscribing agencies would receive updated listings nightly and would then be able to present those to their clients each day. The software included a slide-show of the home's interior and exterior and the agency could print out a full-color report showing the specifications on the home as well as all of the images. It was fairly advanced for it's time (circa 1994) but we quickly found out that Real Estate agencies didn't like to work that way.

While the application seemed doomed, a friend of ours happened by our booth at a trade show. We gave him a quick demo and the wheels in his head started turning. He was an employee of a Housing Authority and it was his job to find software to manage their facilities. He was looking for a custom-built solution but his main requirement was that the software be easy to use. He brought an employee to our office to view the Real Estate application and within minutes the employee was at ease. He could use software like that.

We submitted a proposal to develop 3 modules for the Brockton Housing Authority. They accepted the proposal and from that point on our feet were firmly entrenched in the Public Housing Industry. The initial applications were developed in Visual Basic 3.0 and utilized a handheld computer with an integrated barcode scanner to facilitate the transfer of Inventory.

Three years later, we entered into an agreement with Brockton to develop a full-financial and tenant management application. The software was developed in Borland's Delphi, a Pascal-based 32-bit Windows development environment. Pascal was very easy for me to adapt to since it was the base language used at Bridgewater State College.

After several years working with Public Housing Agencies we began to look for alternative ways for smaller agencies to utilize information technology. That brought us to the Internet. PHAnetwork.com was born in 2002 as a tool to allow smaller Housing Agencies (with likewise smaller budgets) to manage their day-to-day operations. It was (and still is) written using Active Server Pages (ASP), JavaScript and a host of 32-bit Windows modules written in Visual Basic 6. The application has far exceeded our expectations at the outset and at this juncture in 2008 we are on the verge of unleashing it nationwide.

From All Fours to Standing Tall

The evolution is complete but there are still hurdles ahead. Today, I develop in ASP.NET using VB.Net. I use an application framework developed by Paul Sheriff and Associates (see Clipper days above) which provides a solid foundation for developing Web applications. If you are an independent ASP.NET programmer, I strongly recommend you check it out.

This has been an enjoyable exercise for me as I recall the times, tools and people from my computer programming past. Some areas I hadn't thought about in over a decade seem like just yesterday. I'm sure years from now, the memories of writing these articles will have the same effect.

Please feel free to comment on this series of articles. I can take it. As Dirty Harry said, "Go ahead, make my day!"

Saturday, March 08, 2008 7:22:19 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]
 Saturday, March 01, 2008

Mesozoic Period

In the first part of this series I discussed my introduction to the world of computers and computer programming. In this section, I continue with my college days and my early days developing business software.

The computer gets "Personal".

With the proliferation of the personal computer in the early 1980's, and on the recommendation of a friend, I purchased my first personal computer, the Commodore 64. The built-in language was Commodore Basic, and as a Computer Science major at Bridgewater State College we were told that "BASIC" was not a real programming language, so I kept my new purchase to myself.

commodore64

In no time I was writing and saving programs. One of my first projects was a program that tracked team statistics for my softball team. Coincidentally, I lead the team in RBI that season! (hmmm). My friend (and current business partner) was also cranking out programs on the Commodore. To his credit, he had a checkbook manager before Intuit hit the market with Quicken. His claim to fame was a program to select the winning dog at the dog track. Suffice it to say, the coin flip was just as effective.

With the purchase of a rinky-dink modem, I was connecting to the Bridgewater State College computer network from the friendly confounds of my bedroom. This was a huge benefit as computer time in the lab was limited and the hours of operation were fairly restricted. This gave me unlimited access and the ability to complete assignments when the lab was closed.

Time to Make a Living

As my senior year was winding down, it was time to start thinking about getting a real job programming computers. Fortunately, my long-time friend's brother was starting a new computer company (Genesis Business Systems) and he needed programmers. I did my Senior Intern with his company developing business software on the Qantel Minicomputer using (guess what) the BASIC programming language. Qantel was a California-based company that had it's own version of BASIC called QIC-Basic (QIC standing for Qantel Interactive Code). The software we developed was for the long-term care industry.

One of my additional duties during my Internship was volunteering for backup duties. The Qantel system was backed up each night on magnetic real-to-real tapes. The tape machine was about the size of a dishwasher and the write-speed was incredibly slow. The backup of the entire system spanned a little more than 2 tapes and took about 3 hours. Needless to say, I had plenty of time to complete school assignments while waiting for each tape to reach its end.

After graduation I stayed on at Genesis and slowly climbed the corporate ladder. The software wasn't very flashy but we could control screen positioning which meant we could layout screens and incorporate software standards. The users had plenty of choices too. They could choose either a green screen or an amber screen!

In early 1987, I purchased my first IBM-compatible computer (nobody actually bought in IBM PC did they?). It was from a startup computer maker from Texas called PC's Limited (shortly after they would change their name to simply Dell Computer). It had 8MB of memory and a whopping 20MB hard drive. The processor was an 80286 processor running at 8/12mHz. Let me tell  you, it was a screamer!

I started writing small applications in C and even created a small device driver that allowed personal computers to be used as terminals on Qantel Systems. (Thinking back, had I marketed that I may have made hundreds of dollars!). One of the nice features of this early Dell computer was that at any given time it could freeze-up at the drop of a hat. It was also very noisy, especially when writing to the fixed disk. The slurring sound of the 5-1/4" disk drive was soothing though!

The following year, Dell started shipping more powerful computers and I convinced my company to become one of the first Value Added Resellers (VAR) for Dell Computer. Some of the key players from Dell came out to our offices to give us the run-down on the Dell VAR program and invited us to visit their headquarters and to meet Michael Dell (who was still a virtual unknown). Along with some of the first 80386 computers we received was a software application from Microsoft called Windows. After a cursory glance at the box, I came to the conclusion that it was insignificant and tossed it onto a shelf where it continued to collect dust. (To my defense, Windows never became a really useful tool until version 3.0 and even at that, it was an MS-DOS shell).

Around that same time, Genesis got involved in the retail automation business. I started working with a handheld data collection device that used an acoustic modem to transmit data to a Qantel system. In order to transmit the data, the device had to be strapped to the mouthpiece of a standard phone. Then, the number was dialed and the transmission went through. Unfortunately, the phones in our own office did not work with the modem in the device so in order to do my testing, I had to drive to the nearest strip-mall and use a pay-phone to send a data transmission. My first test each time was usually interrupted by the receptionist answering the data line ("Good Morning, Genesis Business Systems") at which point I'd have to shout over the acoustic coupler "Hang up and don't answer next time").

Quite an Impact

I would be remiss if I didn't mention the fun we had with the wide-carriage impact printers of the 1980's. The printers were slow and noisy and they required great precision to get the paper aligned so that it would feed properly through the carriage. My favorite office printer was a Manessman-Tally printer that was very fast for it's day. It was also liked to eat and shred green-bar paper. When the printer was at full-speed it did a sort of horizontal dance similar to an out-of-control washing machine.

To make things really interesting, we had the pleasure of dealing with multi-part forms. I remember one such occasion printing W2 forms for a client. It took 2 of us to complete the job for this client (with over 100 employees). One had to watch the forms to make sure they didn't come off-line from the pins and the other had to be ready to toggle the "on-line" button so the printer would stop. Then we'd have to adjust the forms back in place to the precise location where it went out of align and hit the on-line button to resume the printing. This occurred about once every 10 forms.

Departure

After a little over 2 years with Genesis, I started to get itchy feet. I needed a change and so I wrote my first-ever letter of resignation. I had learned a lot in those years with Genesis but in retrospect I still had a lot more to learn.

In the next article I discuss my introduction to the Clipper programming language and my first attempts at Windows Applications.

Saturday, March 01, 2008 7:59:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
 Wednesday, February 27, 2008

Paleozoic Period

I am a Dinosaur! Like Dirty Harry was a Dinosaur to his law enforcement peers, I am a Dinosaur to my computer programming peers. I discovered this the other day when talking with another (cough) younger programmer who was amazed to find out that I actually went to college to learn computer programming. I didn't have the stomach to admit to him that in college my assignments were turned in on wide, green-bar paper!


I have been writing computer programs professionally for 22 years now. To put this archeological period in perspective, if I were a piece of mail, at the outset I would have been delivered by the Pony Express whereas today I am delivered but Jets and hybrid vehicles (albeit to the wrong address)!


I find that a little self-perspective is helpful so at this juncture in my long career I felt it beneficial to review my humble beginnings. My first exposure to computers was my sophomore year in high school (circa 1978) when we were asked to type in basic programs on a teletype machine. If you've ever seen an old movie (Dr. Strangelove comes to mind) and a government official is awaiting news, a noisy typewriter starts to rattle and shake as it spits out a continuous feed of rolled paper with barely decipherable print. That is the teletype machine.


Basically, you would type in a line of program code and then press a key and the characters that you typed would be repeated on the page. If you mistyped you would have to completely retype the line. This was done repeatedly until you had stored your basic program in the computer's memory.  Then you would process the job (run the program in today's parlance) and hope that everything executed properly and you got the desired results, again in the form of type-written output.

Most of the code written involved simple math problems or problem solving but we also developed games and everyone's favorite, "banners". One task was to write a program that would print out your last name in block letters formed by a series of repeated X's. I felt bad for my friend John Poulioupolis but he was up for the task!

The glamour of all of this inspired me to declare Computer Science my college major. I enrolled at Bridgewater State College in (coincidently) Bridgewater, Massachusetts. During freshman orientation we were taken to the computer lab for instructions on logging into the campus computer network. The room was filled with Decwriters (the successor to the teletype which I was familiar with) and a few small television screens, which I only assumed was for keeping up with the latest on daytime television drama. These devices couldn't possibly be used for computer access. I slid comfortably into familiar territory at the console of a Decwriter and began testing my login.

I continued to use the Decwriter for the first few weeks until one day they were all in use and the only terminal available in the lab was one of those strange computer screens. Feeling somewhat like Indiana Jones, I sat in front of the machine and stared at the peculiar green blinking light (now known as a cursor). Apparently, this wasn't a television but a Cathode Ray Tube (CRT) terminal. I started typing on the attached keyboard and was able to logon. Suddenly the text appeared before me just as it had on my faithful Decwriter. Well, now I was hooked! Imagine, interacting with something other than a typewriter console. Now this was progress!

During my sophomore year I had the distinct pleasure of experiencing the COBOL programming language for the first time. In addition to learning this fascinating, English-based language, I had the opportunity to work with IBM punched cards. Imagine my delight when I was asked to type an entire COBOL program on punched cards including the data source. If you didn't know (and how can you since COBOL is now in the Smithsonian Institute) COBOL programs have a tendency of being very large. What would have been an hour on a CRT took nearly four on the IBM machine. After this long exercise, I had to enclose the large deck of cards in a piece of paper donning my name and student ID. It was then deposited in a box where it would await processing. This was typically a 24-hour process so if there was a single error in my program I wouldn't know until the next day. Then I would have to correct the card or cards in error and resubmit the job.

My favorite professor at Bridgewater State College was Dr. Zon I. Chang. He was also the most difficult. I remember his speech (in broken English) to us as freshman when he warned us not to copy another student's program.

"You copy program from friend, you better get job with friend, else you don't know what you are doing!"

He was also a stickler for accuracy. Every program that we turned in had to be documented a certain way. We would lose points on our assignments if comments were not accurate and consistent. He did instill in me some very good programming habits which I carry to this day.

The Computer Science program at BSC was difficult and thorough. For my freshman orientation I sat in a room with about 150 other students. When I received my diploma, I was accompanied by about 25. I take pride in having endured and fought through the difficulties and challenges.

The environment for the BSC Computer Science program was largely scientific and focused very little on providing business solutions. Ironically, since graduation I have specialized in the development of business systems. Our senior projects focused on building compilers, assemblers and operating systems. We studied complex algorithms, data structures and examined probability and statistics. It was a different world in the early 1980's and the tools we used to solve problems seem like the hand axe to a modern carpenter.

So here we are back in 2008. I'm working on my blog, subscribing to RSS feeds and reading and sending email on my cell phone. We develop applications that run entirely on the Internet and work with handheld communications devices that allow users to update information real-time wherever they are. Yes, I am a Dinosaur. A Dinosaur who has evolved and escaped the tar pits. As I take the reigns of my keyboard today, I stare my daily challenges square in the eye and say...

"I know what you're thinking. Did I fire up 6 procedures or only 5. To tell you the truth, in all the confusion, I forgot myself. But being as though this is Microsoft Visual Studio, the most powerful software development tool in the world and will blow your mind completely away, you have to ask yourself one question. Do you feel lucky?"

Well do you?

In part II, I'll discuss my early experiences in the business world developing software for the "doomed" mini-computer!

Wednesday, February 27, 2008 9:04:43 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]