Microsoft/Windows Update Fails on Every Update

Occasionally, Windows Update (or Microsoft Update) will see all of the updates you need (and possibly even download them) but will immediately fail all of the updates when trying to install them.  Sometimes I have seen Windows Update error off after the green progress bar and before it can show me if there are any updates at all.

Every time this happens, I end up Googling the error code and finding the same fix every time (since I forget what the fix is each time).  The error code I get is 0x80004002.  If you are unable to find the error code through the UI, you can check the Windows Update log at %WINDIR%\WindowsUpdate.log (which in my case, %WINDIR% translated to C:\WINDOWS\); you can even just type %WINDIR%\WindowsUpdate.log right into the "Run..." dialog.  You can find the error code near the bottom of the log; just find the lines of text that have the same timestamp as when you unsuccessfully ran Windows Update.

Well, anyway, here's the fix; run the following commands in a Command Prompt window (type cmd in the "Run..." dialog):

net stop wuauserv
regsvr32 wups2.dll
net start wuauserv

That's all there is to it!  It has worked every time for me.  It may even be helpful to put these commands in a batch script (copy and paste the commands into Notepad and then save the text file with a .bat file extension) and keep the file in a place where you can easily find it again.

View Full Article

LINQ to SQL Debug Visualizer

If you are using LINQ-to-SQL, it is often helpful to see the SQL generated and the resultant query results.  You can do this, even while debugging, with the LINQ to SQL Debug Visualizer.  Debug Visualizers are the dialogs that pop up when you hover over a statement and click the little magnifying glass in the hovering menu.

I believe by default Visual Studio will show you the generated SQL when you over over a LINQ statement, but there is no way Debug Visualizer to help see the SQL in a more user-friendly view.  Scott Guthrie gave a blog post describing a simple download that can give you this enhanced view of the SQL, and even the ability to execute the query and see the raw data returned from your database:

http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx

Included in the post are instructions of how to extract the necessary DLL library, and where to place it in Visual Studio's file hierarchy.

A really simple enhancement for working with and debugging LINQ-to-SQL that is definitely worth the minimal effort to acquire it.

View Full Article

Irena Sendler's Story

Again, I promise I won't do this very often (since this is a programming blog), but the world needs to know...

Irena Sendler (http://en.wikipedia.org/wiki/Irena_Sendler), a Polish Catholic social worker, risked her very own life to save 2,500 Jewish children from certain death at the hands of the Nazi genocide.  She did it by smuggling the children out of the Warsaw ghettos and placing them in new homes with new identities.  Then when the Holocaust was over, she spent her life reuniting these children with loved ones and extended family members (because many of the children's parents had been executed).

An amazing woman, worthy of an amazing recognition.  The Nobel Peace Prize would be fitting, wouldn't you say?  It is awarded "to the person who shall have done the most or the best work for fraternity between nations, for the abolition or reduction of standing armies, and for the holding and promotion of peace congresses."

She was indeed nominated for the prize in 2007.  However, she lost...and guess who won instead?  A propagandist and environmental alarmist, who has placed himself in a position to benefit greatly (financially and politically) from the "Green Movement" (in truth, it is nothing more than a theory that greenhouse gases are the cause of Global Warming).  Al Gore won the Nobel Peace Prize for creating a slide show movie.  I think I would be less irritated if he had won for his invention of the Internet or something.

Here is a tribute to Irena Sendler that everyone should watch: 

The question I have to ask is how can Al Gore accept the Nobel Peace Prize, knowing that he was up against a real hero and freedom fighter?  She risked her life for peace and saved 2,500 Jewish children.  Al Gore has done nothing but shoot off his mouth.  How can he even think he deserved the prize more than her?  Why didn't he decline the prize and offer up the name of Irena instead?  Because it didn't quite fit into his political agenda.

On behalf of those that can appreciate true selfless and compassionate service to mankind, I have just four words for Irena Sendler:

Thank you so much.

View Full Article

Cannot Set a Value on Node Type 'Element'

You will receive an InvalidOperationException with this error message if you try to use the Value property of an XmlNode to set the node's value.  You need to set the value using the InnerText property instead.

Thank you to this blog post for documenting the issue and its fix:  http://www.neilpullinger.co.uk/2008/03/cannot-set-value-on-node-type-element.html

View Full Article