Wednesday, May 10, 2006

I have the opportunity later on tonight (now that it's past midnight I can say that) of presenting at the Utah .NET User Group.  This presentation will be the third in a series focused on component development.  The preceding two talks have focused on control development, specifically Windows Forms Controls and ASP.NET controls.

This go-around, however, we'll be talking about Windows Services and the SCM.

If you're in the neighborhood, please come on by and enjoy free pizza and a fun presentation.  Hope to see you there!

Date: 05/11/2006
Time: 6:00 PM
Place: Neumont University, Suite 300 (10701 South River Front Parkway, South Jordan, Utah)

Wednesday, May 10, 2006 5:27:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

A Web Garden Box is something completely different.  Actually, this is manual labor - something I really enjoy - especially after sitting in front of a computer all day.  I took Monday and Tuesday off last week and got to projects around the house.  One of my projects was to build a box around the garden area.  Long have I wanted to to this, but I finally took it upon myself to actually get it done.

I went out and purchased a flat-bed trailer ('cause I sick and tired of leaning on my brothers to help me haul wood), hitched it up to my SUV (had to put a hitch on it first), and hauled home the redwood, cement, and stuff.  I then set out to assemble it.  Granted this was an extremely easy thing to design and build, but I revel in it, and had a great time doing it.

All in all I'm pleased with the result.  There're just a few more things to do.  I'm going to seal it this weekend and line the interior with some plastic or landscaping cloth.  Also, as you can see from the image that I subdivided the garden into three areas.  I'm going to run some PVC all the way across and T off of it in each box and run some perforated tubing through each section individually.  I'm also going to take the router and do a 1/2” round over on the lip that goes around the box just for esthetics.

Wednesday, May 10, 2006 7:56:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Monday, May 08, 2006

Microsoft released today the Visual Studio 2005 Web Application Projects for Visual Studio 2005 (obviously).  I've been running on the betas and RC1 of the product since it came out and I've just upgraded to the release.  If you like the VS 2003 / ASP 1.x programming model but would like to take advantage of the 2.0 Framework and the coolness of Master/Content pages and much more, check it out!

http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx
Monday, May 08, 2006 12:47:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

If you're like me and have both ASP.NET 1.1 and 2.0 on your machine (along with the associated Visual Studio 2003 and 2005 products because you can't help but write software in both environments) you may encounter this issue.  Upon running your website (via http://localhost/xxx or something like that), you may encounter the error page that reports:

Failed to access IIS metabase

If so, you may have installed IIS after installing the .NET framework.  If that's the case, try running to repair your ASP.NET installation and set up all of the appropriate ISAPI extension mappings.

aspnet_regiis -i

If, however, you're like me and had IIS already installed, and you installed VS 2003 and then VS 2005, and then set up a 1.1 virtual directory / website, simply check that the appropriate ASP.NET version is associated with it (Select VDIR --> Properties --> ASP.NET tab).

Monday, May 08, 2006 9:40:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [221]  |  Trackback
 Friday, May 05, 2006

I just had the opportunity to attend a webcast presented by Scott Hanselman entitled “MSDN Architecture Webcast: Introduction to Programming Hardware with the .NET Framework 2.0“.  What a cool presentation., Scott was up to his usual great form when it comes to presentations, despite a few sharing glitches which were easily ignored.

Scott touched on many things new to .NET 2.0 most notably interfacing with serial ports.  Additionally, he addressed using USB devices.  His demos (which are fully available online) included receiving information from a USB GPS device (the one included with Streets and Maps), pushing data to an LED (in this case, showing what Media Player is playing), using a USB Wireless Security FOB, using WIA (Windows Image Aquisition) to receive images from a WIA-enabled webcam, and more.

If you missed it, it should be available in a recorded form on Microsoft's site within 24 hrs.

Thanks, Scott!

Friday, May 05, 2006 5:20:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

Mark Russinovich, the brilliant co-mind behind of SysInternals and author of a vast array of extremely helpful utilities, just published a new utility that has already found a comfortable home among those utilities that I use on a daily basis.  This new one is called AccessChk.  This awesome tool will help you secure your system by allowing you to verify the kinds of access permissions that a user has (be they read or modify permissions) for files, directories, Registry keys, and Windows services.

I've been wanting a tool like this for some time, but never took the time to write anything.  Thanks, Mark, for yet another ultra-uber-helpful utility.

Speaking of helpful utilities, does anyone know of one that does the following?  I have long wanted an easy way to see a utility that I'll call PolicyChk which I could use to see which Group Policies a user/group has rights assigned (either directly or via group membership).  There have been times uncountable wherein I wanted to grant a user the same polciy rights as another user (such as ASPNET), but didn't know which rights to assign without laborious manual examination of the various policy settings looking for the account and it's various group memberships.

Friday, May 05, 2006 4:40:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, May 04, 2006

It's been a crazy week!  Hardly any time for blogging, unfortunately.  I've been setting up my new Dell Precision M90 laptop :-) as well as doing TONS around the house.  Not to mention that I took Monday and Tuesday off (something I haven't done for a long time, too long).

I took the time to enable HTTP Compression on my various websites, this blog among them.  Hopefully performance is better all around.  Let me know if there are any issues or if you experience any outages.  There are many great references out there for successfully enabling compression in IIS.  I found this one, and this one, oh, and this one to be pretty doggone helpful.

Thursday, May 04, 2006 7:01:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, April 27, 2006

I have been playing with SQL Server a lot lately, but not from the programmatic side but rather from the DBA side.  Don't get me wrong, I like the programming side a bunch more, but we had the need to to do some database maintenance and upgrades among other things.  We were running SQL Server 2000 SP4 + Reporting Services on a domain controller under much of the default installation settings.  For instance, the ReportServer service was running under the NETWORK SERVICE account.

Upon attempting to upgrade this server to SQL Server 2005 I was greeted with a message identifying that it could not be upgraded with the NETWORK SERVICE as the report service account on a domain controller.  Therefore, I had to set out to change the account associated with the Reporting Services service account.  Changing the account, however, is not as easy as simply changing the account.  If you simply change the user account, you will probably be greeted with a message akin to

The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content and then restart the service. Check the documentation for more information. (rsReportServerDisabled) Get Online Help
Bad Data.

In addition to the various rights and permissions needed for the new account, you need to make sure you backup your symmetric keys before changing the account.  If you changed the account already, you'll have to change it back to NT AUTHORITY\NETWORK SERVICE (see note below).  Once done, follow the steps below (as found in the support.microsoft.com website KB842421)

  1. Start the Report Server Windows service and Report Server Web service
  2. Backup your encryption keys via
    RSKeyMgmt -e -f filename -p strongPassword
  3. Remove the reference to the encryption key (locate the InstallationID in the “%ProgramFiles%\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\RSReportServer.config“ file
    RSKeyMgmt -r InstallationIDGuid
  4. Stop IIS
  5. Stop the Report Server Windows service
  6. Change the user account on the Report Server Windows service
  7. Start IIS
  8. Start the Report Server Windows service
  9. Apply the encryption key previously backed up
    RSKeyMgmt -a -f filename -p strongPassword

That fixed the issue for me - what a relief!

NOTE: Changing the account back to NT AUTHORITY\NETWORK SERVICE (something I had to do) isn't as obvious as I would have liked.  Rather than performing a lookup on the user and not finding it on the domain controller, you have to know of the account's existence.  Type it in directly on the 'Log On' tab.  You won't know (or probably won't know) the password.  Simply blank out the password and the confirmation field.  The system will automatically associate the appropriate credentials for you.  This wasn't apparent, but I'm glad to have figured it out.  There have been so many times where I wanted to lookup accounts from the BUILTIN or NT AUTHORITY security groups but they simply wouldn't show up in the 'Browse' dialog on a domain controller.  Now I know and feel much better about it. :)

Thursday, April 27, 2006 4:13:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Wednesday, April 26, 2006

This had me pulling my hair out today (and there's not too much left, believe me).  I was so frustrated, but finally hope smiled down on my endeavors.

I had a SQL Server database that I was trying to drop (either via Enterprise Manager or via the script DROP DATABASE 'xxx').  Each time I tried, it would fail with the error message:

Error 3724: Cannot drop the database 'xxx' because it is being used for replication

This was disconcerting because I no longer had replication enabled on the server.  I tried all of the recommendations that I could find online to remove any association of replication from the database, and they all failed for me though they had worked for others.  For instance, the most frequently recommended strategy that I found was this:

sp_replicationdboption 'xxx', 'publish', FALSE
GO
sp_replicationdboption 'xxx', 'merge publish', FALSE
GO

or

sp_removedbreplication 'xxx'
GO

Once again, I could not successfully delete the database following these actions.  I simply could not see a way to remove the database.  Then a coworker had a stroke of genius that I'd like to share.

He suggested the following and it worked like a charm:

  1. Create a dummy, temp database called 'Hope' (we called it that because we hoped it would work).
  2. Backup the database.
  3. Restore the backup over the database you can't delete (you'll have to rename the target file so as to not conflict with your original, dummy, temp database).
  4. Happily delete both databases

That got rid of it.  Boy what a hassle.

Can any of you DBA's out there think of something else that I haven't tried?  Does this approach make you cringe? I battled it for the better part of 2 hrs before resorting to this approach and simply couldn't get anything else to work.

Wednesday, April 26, 2006 12:02:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [12]  |  Trackback

I like to consider myself a knowledgeable user of Windows - there's aren't too many nooks and crannies that I haven't explored and/or tried.  Today, however, I was introduced to a feature that I can't believe I didn't know before.

When presented with a Message Box dialog, simply press CTRL+C to copy it's contents to the clipboard.  So easy...so elegant...so brainless...so non-intuitive.

Wednesday, April 26, 2006 5:27:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, April 21, 2006

This is probably float around out there a ton by now, but today Microsoft released SP1 for it's rockin' SQL Server 2005.  Get it.  Install it.  Enjoy it.

Link: http://www.microsoft.com/sql/sp1.mspx

Friday, April 21, 2006 4:21:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, April 19, 2006

I don't claim to be an XML/XPath expert, but I can definitely hold my own - at least so far.  I just wanted to share something I was doing today in the hopes that someone might also benefit.

By and large, developers (and by developers, I mean people, though they're not always synonymous) use XPath with positive assertions.  What I mean is that XPath is used to query Xml documents looking for information they know or expect to exist.

For instance, the following XPath query will return the child nodes beneath the family element that contains a lastname attribute value of 'Rogers'

/family[@lastname='Rogers']/*

Removing the trailing '/*' such that the query is /family[@lastname='Rogers'] will return the family nodes that have a lastname attribute of 'Rogers'

Suppose further that you wanted to retrieve all family elements that had a value other than Rogers, you'd simply change the equality operator

/family[@lastname!='Rogers']

Ok, no magic.  It's all rudimentary, simple XPath.

However, what if you wanted to perform a negative assertion?  That is, what if you wanted to get the family elements that didn't have a lastname?  I'm not talking about an empty lastname (i.e. <FAMILY lastname="" />), I'm talking about all of the family elements that are missing the lastname attribute entirely (i.e. <FAMILY />).

I don't know of a way to solve this by simply using straight element/attribute syntax (but then again, I don't pretend to know much of anything about it in the first place).  The solution is actually quite simple, but you have use a function.

/family[count(@lastname)=0]

[EDIT 04/20/2006: Corey Kaylor left a comment that I'd like to share]
I had tried many variations on this exact theme, but failed to try the not() function.  Thanks Corey!
A better solution is this:

/family[not(@lastname)]

That simple query allows you to find all nodes with the specified name that don't have the lastname attribute.  Pretty slick.  This is just tapping the surface, because there's a whole bunch more that you can do.  I simply wanted to record it so I wouldn't forget.  Simple.  Easy.  I like it.

Wednesday, April 19, 2006 2:29:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback