Monday, October 31, 2005

First SQLExpress and now Oracle Express?

Free Oracle Database Takes On MySQL, SQL Server Express story by CRN.

"Oracle Database 10g Express Edition, or XE, targets hobbyists, new database developers and others who might want to try out the technology, said Andy Mendelsohn, senior vice president of database server technologies for the Redwood Shores, Calif., company."

Original post

Sunday, October 30, 2005

VS 2005 RTM Initial Impressions

Here are my initial impressions on the released version of VS2005. I attended PDC 03 and played with both Longhorn and Whidbey but as time went on I found it hard to keep up with the releases and all the nuances of the near "black magic" it seemed it took to get the CTPs, betas, and release candidates installed correctly and working. Being on a full-time project with deadlines and trying to develop a software product on the side meant I had to be careful about my focus.


Having worked with SQL since 6.5 and all versions of .NET and Visual Studio, I knew I wanted to install SQL 2005 first. My test environment was a Windows XP SP1a Virtual PC image I had saved off as a baseline (hadn't gotten around to making an SP2 one). First thing I did was install SP2 and reboot to ensure a clean foundation. I tried installing SQL and received an error 193 while trying to install .NET Framework 2.0. Since it was Thursday evening, there was little to find online for help with either Google or MSDN searching (still too soon?). I then found that the .NET Framework 2.0 Redistributable was now available so I installed that and tried SQL 2005 again. Same error. At this point, I gave up on SQL 2005 since I was initially interested in VS 2005. The VS2005 install went smoothly including SQL Express.

First Surprises

I confess that I hadn't had time to pay much attention to SQL 2005 so when I went looking around for an Enterprise Manager type of application I was surprised to find nothing. Also, I had stepped back from the beta stuff before the express editions came out so I hadn't tried or followed anything with them. A little hunting around lead me to the VS Express Editions page where I learned there's something called "XM" for Express Manager (a 'lite' version of Enterprise Manager) but it wasn't ready yet. Since I had an existing VS 2003 application with a database I first needed to figure out how to get it brought over.

Setting Up A Database

I found out you can use a new command window utility called 'sqlcmd' which gives you a command line interface. Having worked with Oracle's Server Manager for years as well as DB2, I wasn't too worried. Interesting side note, Oracle finally removed SvrMgr in version 8 forcing people to use the newer Java-based graphical UI which some complained about. Now we find Microsoft which has always had Enterprise Manager since 6.5 (earlier?) is now introducing a command environment. Since we use a database project, I tried to update the connection but couldn't get it to work. I finally resorted to using sqlcmd to create an empty database. With a little poking around I found the default instance is referenced via '.\SQLExpress' so you launch it with 'sqlcmd -S .\SQLExpress'. Note that the -S is case sensitive so if you use a lowercase -s it'll hang for a long while before it finally returns an error. Upon successful connection, you'll receive a cryptic '1>' prompt so if this is your first time, don't be alarmed. Just start issuing T-SQL commands. Here's one I used to create an empty database:

USE [master]
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ComposerDb.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ComposerDb.ldf' )

After that, I deleted the connection in the database project, created a new one using the "new" server name in place of (local) and was able to run our scripts to create the tables, views, and stored procedures without a hitch. Skipping ahead, when I tried to run the web service project, I received a security error - unable to connect. Not a problem, I forgot to grant the ASPNET account (for XP w/ IIS 5.1) permission. Back to the sqlcmd window for a CREATE LOGIN using the example in the online help. However, at this point I became stuck. I couldn't seem to get a CREATE USER to work so I couldn't get the ASPNET user into the new database. After a lot of hunting on MSDN newsgroups, and Google searches, I finally gave up and tried installing just the client tools for SQL 2005. It went without a hitch although it took a long time to run. When it was finished, I could launch the new Enterprise Manager (it recognized the SQLExpress instance) and was able to add the ASPNET user to the database. Finally the web service test page came up and I was off and running.

Project Conversions

In between the above SQL bumps, I opened my existing VS2003 solution and the conversion wizards worked great. When all was done I had the following projects converted: a data access layer, a business model layer, two business model factories (direct connection and web service interface), a web service layer, and an admin UI. We were using NUnit for our tests and I needed to install it. I had dated 8/8/2004 and when I ran the MSI it complained that it needed .NET Framework version 2.0.40607. Since it didn't like the RTM version, I opted to simply copy my existing implementation from my VS 2003 machine and followed the instructions for manual registering.


The VS2005 installation and conversions of the existing projects went extremely smoothly and I'm very pleased with the quality and the experience. The SQL 2005 (Express and Standard) I think is due to just being early. If I had invested time with the betas and CTPs it no doubt would've been a no-brainer. I'm sure that as weeks go by, more and more information will be published and answers to any questions will be easy to come by. Having a graphical admin tool such as Express Manager will go a long way to curing any hiccups.

Original post

Wednesday, October 26, 2005

Been there, seen that - Big Blue's got a black eye

Tristan Yates has posted a scathing report of IBM's actions at "one of the biggest defense contractors in the world". I found it via Dave Oliver who said that he didn't find it hard to believe. I've witnessed similar actions at "a major insurance company on the west coast". :)

I was a senior architect in the consulting group of a software vendor selling e-business type applications that ran on J2EE. The two primary platforms at the time were Weblogic/Oracle and Websphere/DB2. The sales folks brought me in for an afternoon presentation and q&a on our architecture. On the way to the meeting came the "oh, by the way IBM is going to be there too". There were four of us from my company - myself, a business analyst, a project manager and the sales person. There was about a dozen managers from the prospect as a recall. Everybody was business casual and relaxed. IBM had packed the room with about a dozen "experts" from various technology groups (MQ Series, DB2, WebSphere, etc.) - all wearing suits and wingtips. Now, this was "our show" - each software vendor met the customer panel, gave their pitch and answered questions. At the time in 2000 our technology was ahead of the curve and we had way more "boxes checked" than the competitors.

IBM managed to speak first and show pretty Powerpoint slides with all their various technologies and hardware tied together and working nicely. The thing is, they had taken our materials and overlaid them with all their technology in and around it - however unnecessary it was. That annoyed me, as I said, because it was our time to talk about our product. So I showed a few slides and began interacting with the customer audience - using the whiteboards to draw simpler diagrams of what was needed and how our things fit together. As time went on and they probed deeper, it became apparent that all the IBM stuff was fluff. No, you didn't need to buy/install MQSeries as we built our product over JMS so any messaging would work. No, you technically didn't need WebSphere as our stuff was J2EE compliant and ran on several Java application servers. In fact, our developers preferred to use WebLogic as it was easier, lighter and had more features (little dig). Etc., etc., etc.

In the end the customer bought licenses and, under IBM's direction, implemented everything themselves - with lots of IBM consultants writing unnecessary code to tie in IBM solutions. Folks who had never seen much less been trained on our application. Over two years later, after I had left the company, my partner and I were contacted to rush out and help troubleshoot problems. They were just trying to go live and there were major issues that needed deep technical skills to unravel and stabilize. We said, "no thanks" ;)

Original post

The Sloppy Quickbooks Security Saga Continues

As the title says, it doesn't get better with 2006. I went through my first round of non-admin security issues with QuickBooks 2004 for my own company. Later, I had to implement Susan's recommendations for QuickBooks 2005 when my wife needed help setting up a computer for doing our church's books. Now, according to Susan it still needs these hacks for the 2006 version. Here's the link to the posting how to fix it up.

Original post

Tuesday, October 25, 2005

Using the built-in searching features of the DataSet

Mohammad Azam posted Searching in the DataSet to save a Database trip showing a simple technique for searching a DataSet. As he said "Then I asked myself why not search the DataSet instead of going to the Database." however the technique he showed was a hand-crafted, walk the rows approach that compared the column value in each row and, if they matched, he copied the row into a new DataTable instance. In the end he'd have a DataTable containing the matching rows. He may not be aware that DataTables are searchable already via the DataTable.Select Method. Here's a snippet from the MSDN docs showing how it would work...

string strExpr;
string strSort;
strExpr = "id > 5";
// Sort descending by column named
CompanyName. strSort = "name DESC";
// Use the Select method to find all rows matching the filter.
DataRow[] foundRows = customerTable.Select( strExpr, strSort, DataViewRowState.Added );

Obviously, his example and my response both lack context of the problem being solved. If his goal was to return a DataTable then the array of DataRows isn't exactly what he needs. However, the search (filtering) technique is still valid for consideration even without context.

Original post

Sunday, October 23, 2005

Robert Frost’s West Running Brook

We live less than a mile from Robert Frost's farm. At this time of the year when the leaves begin to change you can see where things like yellow wood were inspired. Just into the woods behind our house is “West Running Brook“ seen below. I managed to catch my wife walking the dog, a miniature schnauzer.

yellowwoodsbrook3  kirefritz

Original post

Friday, October 14, 2005

Saving web pages for offline viewing

Gina Trapani posted a nice how-to for Slogger which is a Firefox extension. I figured I'd pop a little comment in for PC Magazine's Web Historian but apparently you have to be *invited* by someone before you're granted the privilege of posting comments! Nah! Not interested in registering for one more web thing. I wonder how much of my undelivered mail is sitting in Beverly Hills CA 90210? :)

Save your personal Web with Slogger by Gina Trapani Web pages change. They disappear. They move to new URLs. They get lost or they're password-protected or they're only available on private intranets. Firefox extension Slogger... [Lifehacker]

Original post

Monday, October 3, 2005

Detecting end of a list in XSLT using position()

Apparently Mohammad Azam has recently discovered using XSLT for code generation. One of the issues he's learned is that when using XSLT to generate code you have to be aware of where you are in the list of nodes that's currently being traversed. The particular problem he's got is that looping through a list of fields and tacking on a comma afterwards leaves one stray comma on the end of the list.

The way I solved this problem was a combination of a “switch” statement and using the built-in position() and last() functions to know where you are:

<xsl:when test=”position() = 1”>emit code here for first node in list</xsl:when>
<xsl:when test=”position() = last()>emit code here for last node in list</xsl:when>
<xsl:otherwise>emit code here for all other nodes in list</xsl:otherwise>

I have been successful in building various templates for code generation over the years using XSLT. However, as the complexity of the generated code increases (think multi-tiered, layered application) then it becomes harder to manage (you can go crazy from staring at XSL for many hours!). Kathleen Dollard does a good job of pulling together various technologies (XSL, Code Dom, Db Info Schema, XSD) in her book Code Generation in Microsoft .NET. Unfortunately, it came out a few months too late for me! Why? Because I had already hit my head many times and worked through most all the issues she does in her book by the time it was published.

Instead, I had already decided to give CodeSmith a try and haven't looked back since. Not only is the familiar ASP/ASP.NET style more “natural“ for developers, but the built-in support for database schemas as well as Xml-based schemas/input and copious samples makes getting off the ground much, much easier.

Original post