Tuesday, September 15, 2009

Powershell V2 training videos on Channel 9

If you are a Windows system administrator and are not familiar with Powershell yet, you should be! Even programmers should find a .NET based command shell useful in many situations where they want to test an assembly or use it in a simple script. I just found out that Channel 9 has a PSV2 tag for all of their Powershell V2 videos, which cover different aspects of Powershell in a short video format. These videos don't appear to have a lot of views or comments, but they are definitely good learning material and could use a bit more exposure. Check out this one on Variables, Types, and Operators:


Also if you are using Powershell, I highly recommend using the now free Powershell Analyzer for creating and editing your scripts. I think that it still runs V1 of Powershell, but it is the best IDE that I have worked with so far. The Powershell Plus that replaced it just doesn't fit my needs quite as well.

Sunday, September 13, 2009

Learn WPF on a Sunday Morning!

I have been working on a few projects that involve WPF and Silverlight these last few weeks, and I have to say that the learning curve is a bit steeper than I expected. I have worked with Windows Forms and ASP.NET Web Forms for a while and know most of the tricks regarding layout and data binding, but WPF brings a lot of new technology and features into the mix. I had tried to jump straight into Silverlight design using Expressions Blend, but I got lost and overwhelmed in the process. This weekend I took a step back and started with learning WPF, which is the way that applications are designed in Silverlight. There are a lot of great resources, but all I needed to get moving were a few videos from the www.WindowsClient.net website. Their series on WPF showed the basics for layout and design options in a simple WPF application. Here are some good videos to get you started:

1. Creating a simple WPF application (10:19)
2. Using XAML in WFP (10:34)
3. Overview of the different layout panels in WPF (14:05)
4. Simple WPF Data Grid Editing using ListView and GridView (31:03)
5. WPF Effects (11:41)
6. Host a WPF Control in a Win32 Application (19:59)

There is plenty more to learn about WPF (Animations, Styles, Video, etc), but this is a great way to get a start using WPF.


Wednesday, September 2, 2009

Simple Talk article about TSQL Select For XML clause

I had to do some work today creating a C# web service that would query a MS SQL database and return an XmlDocument with the results. After writing the query I tried loading the data into a DataTable and then using the WriteXML method to turn it into XML, but the layout wasn't exactly what I wanted and the use of a TableAdapter, StringWriter, XMLTextWriter, and XMLDocument seemed a bit excessive. I then remembered that MS SQL 2000, 2005, and 2008 support the For XML clause on Select statements. I had read an article from Simple Talk a few months ago about the different options and by adding "FOR XML RAW ('LogEntry'), ROOT ('LogEntries')" to the end of the query I was able to get the SQL server to format the data for me and then use the ExecuteXmlReader() method to create an XmlReader and load the data into an XmlDocument. The article is a great read for anyone that needs to work with XML data from an MS SQL server.


Blog.TheG2.Net - Your guide to life in the Internet age.