Wednesday, December 5, 2007

SQL Compare for database change deployment

I recently tried out SQL Compare 6 for identifying differences between a production database and a development database that had a significant amount of changes. There were two things (of many) that stood out as valuable in my opinion. One was that the sychronization scripts used transactions which could be valuable when you are providing scripts for customer change deployment (especially when deploying to production servers). The other was the thoroughness of the comparison. It quickly identified indexes that the customer applied to the production database. It prevented me from creating redundant indexes when doing a performance optimization review. SQL Data Compare was handy as well. It saved time creating insert statements for a couple new lookup tables that were to be added to the production database.

SQL Compare is a must have tool for developers and dba's that regularly use SQL Server.

Thursday, November 8, 2007

Bankers Rounding confusion

The default behavior of Cint and Math.Round (not overloaded) in ASP.Net VB is rounding toward the even number "Bankers" rounding. Through normal life experience I thought rounding up was the common method. This threw me for a short loop while trying to calculate a value by adding and subtracting ratios of rounded numbers. I always check my work when dealing with calculations. In this case I was using Excel to check my work which apparently uses a different algorithm. I was not dealing with very many different combinations of rounded numbers so the discrepancy was difficult to find.

A facinating article detailing the different types of rounding is Wikipedia Bankers Rounding. I am a software developer/engineer which explains my use of the term "facinating" to describe an article about rounding numbers.

Tuesday, October 23, 2007

Vista ASP.Net Identity Impersonate="Not Likely"

I recently upgraded a project from .Net 1.1 to .Net 2.0 for a multitude of reasons. Possibly my favorite is so I can develop in VS2005 on my Vista development box without needing to use a Virtual PC image running XP and VS2003. That will make the backups of my development database much easier to manage.

Anyway, when I did that, I started getting GDI+ errors on all my pages containing Infragistics webcharts. With the help of David Negley (Infragistics) we identified that this was a permissions error on the folder the charts were rendered into. It did not initially look like a permissions error (UnauthorizedAccessException) because when I was actively debugging, the charts rendered fine. No errors. What?#@#! During testing I set Full control permissions to the following accounts: Network Service, ASPNET, Everyone, Users, NeighborsDogMilo, etc. Still no dice. The application was configured to Impersonate which to my surprise does not work as expected in Vista/IIS7. As soon as I set Identity Impersonate="False" everything worked great.

Thursday, October 18, 2007

IndyTechFest 2007

Last Saturday I attended the Indy TechFest event. The event was well organized and well orchestrated. The team that handled the logistics did a phenomenal job. The keynote was a pleasant surprise with the addition of a presentation by Buck Foley, Motivational Speaker, who did an effective job of waking up the early crowd of programmers and DBA's. He was hilarious! There was a wealth of sponsor giveaways including one of my personal favorites over 150 technical books. They had 5 tracks with 5 sessions each which is a tall order to fill with technical and interesting speakers. They definately pulled it off. There was even a very interesting Lunch and Learn covering getting published by Brad Jones which was well worth skipping the lunch naptime.

I attended:

  1. Troubleshooting SQL Server Performance by Brad McGehee
  2. Upgrading your DTS packages to SQL Server Integration Services by Tom Pizzato
  3. An Overview of Linq by Dave Bost
  4. Tips and tricks for a VB developer including VB9 by Bill Steele
  5. SQL Server Database Design and T-SQL Best Practices by Arie Jones

Saturday, August 18, 2007

Lean Software Development

Our most successful custom software projects are the ones that are developed "at the pull of the customer, and at the speed of engagement". What do I mean by "successful"? Successful to our customers (in its simplest definition) is software that supports their business processes in a manner which enables them to get the most work accomplished per unit of time with the least amount of effort. Successful to us is software that has gained such a wide acceptance by the users that they become evangelists of the software. They recognize so much value in the software and how effectively it enables them to continuously improve their business processes that they encourage others to use the software and they would actively lobby for the software if some outside force attempts to discontinue or replace it with something else.

How do we as a software development company ensure that our software will be successful as defined above?

  • We make sure that software (virtual environment) matches the real environment as much as possible. The software process must match the real world conditions as closely as possible. The software process should not just match an ideal workflow, it should match the actual workflow. This provides a clear path for improvement.
  • We work directly with the people that will use the software. The software users effectively become software designers. They are much more likely to support and use the software if they are involved in the design. It virtually guarantees success.
  • We either learn everything possible about the business process the software will support, or ideally, we participate in the design of the business process itself.
  • We keep the software as simple as possible, excluding all features that are not completely necessary.
  • We add features and functionality at the pull of the customer. By customer I am referring to the entire user base that will be using the software, not just a customer champion. It is very important that the majority of the users are ready and requesting new functionality to get the maximum benefit. Unnecessary features and functionality is wasteful. It takes valuable time (to the developer) to create, maintain, and test features that are not immediately useful. It adds unnecessary complication for the user when they are presented with more functionality than they need. It just slows the learning curve. Our typical customers use about 85-95% of the features that are present in our software. That is an exceptionally high percentage when compared to typical off-the-shelf software.

Tuesday, May 22, 2007

To Vista or Not to Vista

This topic is from a .Net software developer's perspective. I also do some PHP/MySQL development, but I have not had the need to install the PHP engine or MySQL onto my Vista box yet, so it is outside the scope of this post.

There are both advantages and disadvantages to using a Vista box for .Net development, however as of this writing, in my opinion, the disadvantages outway the advantages. So what are some of the things to consider before jumping on the Vista bandwagon?
  • Are you doing .Net 1.1 development? If yes, I would caution against your tried and true XP environment. Why? Visual Studio 2003 is not "supported" in Vista. Yes I know there are lots of posts about workarounds, hacks, etc to run it in Vista, but really... just because you can doesn't mean you should. If you need to use VS 2003 to support customers or hosting companies that haven't made the jump to 2.0 Framework, you will probably find yourself running XP in a VPC. That doesn't sound so bad, you say. True, as a developer you are probably already familiar with VPC for some reason or another, but there are additional considerations for using a VPC image to do production software development. Among those include infrastructure concerns. Some of the concerns are listed below:
  1. Backup method (every day you work on anything in the image would flag the whole image for backup, Yikes that eats storage space quickly).

  2. Installation of common helper software like Visual Source Safe, SQL Server, Excel (for maintaining revision history data and/or local export to Excel testing) on both the VPC and the host. Sure you can have SQL Server set up on just the host, but that brings up additional more advanced VPC network configuration requirements. VPC 2007 provides new functionality to make that easier, but what if you are doing development on a laptop without a private network available? Now you have to configure loopback connections, etc.

  3. Configuration of the VPC for optimal performance. VPC 2007 appears to have significant performance improvement over 2004, but you are still truncating the available resources of the PC.

  4. It certainly complicates separating your data from your OS/applications.

  5. Windows updates on the VPC and the host (hate those pesky please restart now messages). Ever tried to debug an app you are developing that just doesn't seem to work right until after you realize Windows installed updates, but you decided to hold off on the restart until later? After the restart the problem vanished as if by magic.

  6. Need to do testing on IE 6 when your development VPC has IE 7? Now you need to transfer files from one VPC image to another to test IE 6. Hope you have a lot of Ram or time to transfer the files from the VPC to the host or a storage location, then close that instance and open the next VPC.

  7. Ever try to do a show and tell at the customer on the projecter using a VPC and the VPC would not go into full screen mode? Yuck.
  • Now you need to understand the configuration process for IIS 5, IIS 6, and IIS 7. You will have to anyway, but based on the above, you are probably already spending more time on workarounds than what pays the bills (development).

This sounds like a rant, but it is really intended to help you make a (more) informed decision, before making a transition that is not quickly or easily reversed.

Vista for use at home is a pretty easy decision in my opinion. If you have the hardware to support it and you checked to make sure the software you use runs on it (trust me, don't skip the Vista hardware and software compatibility checks), I would do it. Vista has lots of consumer features (read "looks cool") and parental controls if you have kids. Don't be too surprised if you have to go find and install the latest drivers for your video card if you or your kids play games like WOW or Warcraft III. And kids can be less patient than the CEO regarding unexpected downtime.

Thursday, April 12, 2007

Create Excel files on the fly with

Numerous articles have been written about this topic, but since all projects are different I will summarize my experience based on a recent project. This is not intended to be a tutorial as there is already a wealth of tutorials and instructions for how to accomplish each of the following methods.
Selection of the method can be difficult because you need to balance the versions of Office the users have available with the importance of specific Excel related formatting and features with performance.
Office XP/2003 users only XML/XSLT :
Using XSLT to create Excel spreadsheets (Office XP/2003 only) is a great simple method that provides a high level of formatting ability such as adding Conditional formatting, styling, etc very easily. Be cautioned that when creating spreasheets using XSLT with more than a couple hundred rows, performance degrades quickly and it can take upwards of several minutes to create the file. Sure the performance can be improved by optimizing the XSLT template, but rendering a couple thousand rows of data will still be frustrating to most users.
Office 97-Office 2007 Office XML:
You can use the new native Office XML format of the Office 2007 products to create the file, but since it is still a relatively new technology, there is not as much documentation available to make quick work of the project. Additionally your user's running Office versions earlier than 2007 will need to be able to download and install the Office 2007 compatibility kit.
Office 97-Office 2007 HTML:
You can create HTML files and output to the stream with a response.ContentType of application/ and Excel will open the HTML into Excel. This method provides a good balance of speed, and the ability to format the cells and even add formulas to the cells. This method can be a little confusing to the users when they change some data in the spreadsheet and try to save the file. This is even more advantageous if what you want to export is in the form of a datagrid that you can override the rendering method to output the Datagrid HTML directly to the response stream instead of manually building the HTML table.
Office 95-Office 2007 csv or tsv:
This is the most compatible method, but provides the least flexibility with formatting or other Excel specific functionality.