<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Derek Smyth's Software Development Blog</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>Merry Christmas (Happy Holidays) 2007-2008</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/12/20/merry-christmas-happy-holidays-2007-2008.aspx</link><pubDate>Thu, 20 Dec 2007 19:37:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:10827</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;It&amp;#39;s been a while. The reason was a) had&amp;nbsp;the MCPD&amp;nbsp;exam to prepare for (failed it again, thats a year) and b) a fairly important deadline that had to, and was, met. So basically it&amp;#39;s been full on and unfortunately the blog suffered. I&amp;#39;m just getting ready for a 2 week holiday over in China but though that I take the time to wish everyone a merry christmas and a happy new year (if you don&amp;#39;t celebrate then have a good holiday). Thanks also for taking the time for reading my blog and sorry for the lack of content lately but that should hopefully change next year.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;All the best folks.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=10827" width="1" height="1"&gt;</description></item><item><title>Getting around Jet Engine not installed error on 64 bit Vista</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/11/09/getting-around-jet-engine-not-installed-error-on-64-bit-vista.aspx</link><pubDate>Thu, 08 Nov 2007 22:27:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:4190</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;There is a problem with 64 bit Vista and that is the Jet Engine, used by ADO.NETs OleDb Data Provider, is not supported. It&amp;#39;s also no longer supported by Microsoft so a 64 bit version is not planned. If you develop with OleDb on 64 bit Vista you get an error saying something along the lines of the Jet Engine is not installed.&lt;/p&gt;
&lt;p&gt;The solution to the problem is fairly straightforward and that is any application you&amp;nbsp;write that&amp;nbsp;uses OleDb should target the x86 CPU architecture. This forces your application to run in 32 bit mode. The application still runs in 64 bit under WOW64 so there is no problem. You change this setting using the Configuration Manager in Visual Studio or by compiling your application with the /platform:x86 switch.&lt;/p&gt;
&lt;p&gt;This is fine for your own developments but what about applications you get that use OleDb and have been compiled with the AnyCPU option. With out source code your pretty much stuck, all OleDb calls will fail. However, after a bit of poking about in&amp;nbsp;the&amp;nbsp;invaluable MSDN&amp;nbsp;library I came across one little piece of information that allows you to get around the problem.&lt;/p&gt;
&lt;p&gt;On 64 bit Windows operating systems a DLL (read assembly) compiled with AnyCPU will execute on the same CLR as the process into which it is loaded. Interesting, because&amp;nbsp;since an&amp;nbsp;EXE file&amp;nbsp;is also an assemby that means if you can load and execute an EXE in a process targetting the 32 bit CLR then you can get an compiled application,&amp;nbsp;targeting&amp;nbsp;AnyCPU&amp;nbsp;and using OleDb, to run in 32 bit mode, meaning OleDb will work of 64 bit.&lt;/p&gt;
&lt;p&gt;The good thing is you can do this with only a couple of lines of code.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;

&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Reflection;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; ApplicationStarter
{
&lt;span class="kwrd"&gt;	class&lt;/span&gt; Program
	{
		[STAThreadAttribute()]
&lt;span class="kwrd"&gt;		static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)
		{
			AppDomain.CurrentDomain.ExecuteAssembly(&lt;span class="str"&gt;@&amp;quot;C:\Application.exe&amp;quot;&lt;/span&gt;);
		}
	}
}
&lt;/pre&gt;&lt;br /&gt;if you place the above into an console application and make that application ttarget the x86 architecture then the specified&amp;nbsp;application is executed in the 32 bit process and any OleDb calls that are made will work, no need to recompile. You need to use the STAThreadAttribute as you&amp;#39;ll get a runtime error if you don&amp;#39;t.&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=4190" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Development+Tools/default.aspx">Development Tools</category></item><item><title>VistaDb (100% Managed Database Engine)</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/11/08/vistadb-100-managed-database-engine.aspx</link><pubDate>Thu, 08 Nov 2007 00:53:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:4081</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Wow it&amp;#39;s been a while, sorry for the lack of updates. It is due to a combination of studying for the MCPD (second attempt is looming) and having a bit of a deadline to meet on a project. I&amp;#39;ve been spending most of my time helping folks out on the MSDN forums. Many people ask me questions through this blog, although I really appreciate you coming and reading my blog, your best bet is to post to the forum. Much more likely to get your questions answered there. &lt;/p&gt;
&lt;p&gt;Anyway found this&amp;nbsp;wonderful fully managed database engine by the name of VistaDB, here is the link... it does look pretty amazing even though I&amp;#39;ve only had a small look.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.vistadb.net/default.asp"&gt;http://www.vistadb.net/default.asp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a fully managed (written completely in C#) file based database engine that has less than a 1Mb foot print. It&amp;#39;s like Access without the Jet Engine and it&amp;#39;s like an SQL database without SQL Express. You create your database as a file, deploy it with your software along with a 1Mb DLL file (referenced by your project) and thats it, a fully functional database and engine. There isn&amp;#39;t much of a learning curve as it uses all the ADO.NET objects you&amp;#39;ll be familiar with, here a dummy example....&lt;/p&gt;&lt;pre class="csharpcode"&gt;VistaDBConnectionStringBuilder connString = &lt;span class="kwrd"&gt;new&lt;/span&gt; VistaDBConnectionStringBuilder();
connString.OpenMode = VistaDB.VistaDBDatabaseOpenMode.NonexclusiveReadWrite;
connString.DataSource = &lt;span class="str"&gt;&amp;quot;MyFirst.vdb3&amp;quot;&lt;/span&gt;;

VistaDBConnection conn = &lt;span class="kwrd"&gt;new&lt;/span&gt; VistaDBConnection(connString.ConnectionString);

VistaDBCommand cmnd = &lt;span class="kwrd"&gt;new&lt;/span&gt; VistaDBCommand(&lt;span class="str"&gt;&amp;quot;SELECT * FROM [Employee]&amp;quot;&lt;/span&gt;, conn);
conn.Open();

VistaDBDataReader readr = cmnd.ExecuteReader();
&lt;span class="kwrd"&gt;while&lt;/span&gt; (readr.Read())
{ 
&lt;span class="rem"&gt;//and so on&lt;/span&gt;
}

conn.Close();&lt;/pre&gt;
&lt;p&gt;Fantastic, all you need to specify is the connection string which at its most basic is &amp;quot;Data Source = &amp;#39;C:\databaseFile.vdbc3&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;There are some limitations (although not that many) and the only one I can think of is there is no TSQL Stored Procedures, but there are CLR Stored Procedures. These are,&amp;nbsp;from the look of things,&amp;nbsp;method calls&amp;nbsp;from assemblies that are embedded into the database. Really thats about the only limitation I can really find and there is a question of performance but I can not comment on it as I haven&amp;#39;t ran any benchmarks.&lt;/p&gt;
&lt;p&gt;To be honest though it&amp;#39;s worth looking at and I know I&amp;#39;m going to be buying a copy. No need&amp;nbsp;for your users to&amp;nbsp;install anything, no SQL Express, no Jet Engine (which is not supported on 64 bit). Ideal.&amp;nbsp; It also has XML support in that you can build a database from a schema and import XML data in, and I&amp;#39;m guessing out. It has CLR Triggers, Referential Integrity, Views, and have I said... I&amp;#39;m getting a copy. Cheap as chips.&lt;font color="#a31515" size="1"&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=4081" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/XML+Related/default.aspx">XML Related</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/ADO.NET+v2.0/default.aspx">ADO.NET v2.0</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/.NET+Windows+Development/default.aspx">.NET Windows Development</category></item><item><title>Custom Error Provider (with Error count)</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/10/12/custom-error-provider.aspx</link><pubDate>Fri, 12 Oct 2007 12:22:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:2911</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>The Error Provider Component used on Windows Forms is a very useful way of displaying the errors on the form, however its missing one small piece of information; the number of errors that are currently on the form. This custom error provider fixes that problem and allows you, among other things, to check the number of errors on the form before performing some action. 

i.e.     If Me.ErrorProvider.HasErrors = False then

It&amp;#39;s proved very useful in a project I&amp;#39;m helping out on.

-------------------------------------------------------------------------------------------------------------------
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; ErrorProviderWithCount
&lt;span class="kwrd"&gt;Inherits&lt;/span&gt; System.Windows.Forms.ErrorProvider

&lt;span class="kwrd"&gt;Dim&lt;/span&gt; controlsWithErrors &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; List(Of Windows.Forms.Control)

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt;(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; components &lt;span class="kwrd"&gt;As&lt;/span&gt; System.ComponentModel.IContainer)
&lt;span class="kwrd"&gt;MyBase&lt;/span&gt;.&lt;span class="kwrd"&gt;New&lt;/span&gt;(components)
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Shadows&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SetError(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; control &lt;span class="kwrd"&gt;As&lt;/span&gt; Windows.Forms.Control, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; value &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;)
&lt;span class="kwrd"&gt;MyBase&lt;/span&gt;.SetError(control, value)
&lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;.IsNullOrEmpty(value) &lt;span class="kwrd"&gt;Then&lt;/span&gt;
&lt;span class="kwrd"&gt;If&lt;/span&gt; controlsWithErrors.Contains(control) = &lt;span class="kwrd"&gt;True&lt;/span&gt; &lt;span class="kwrd"&gt;Then&lt;/span&gt;
controlsWithErrors.Remove(control)
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
&lt;span class="kwrd"&gt;Else&lt;/span&gt;
&lt;span class="kwrd"&gt;If&lt;/span&gt; controlsWithErrors.Contains(control) = &lt;span class="kwrd"&gt;False&lt;/span&gt; &lt;span class="kwrd"&gt;Then&lt;/span&gt;
controlsWithErrors.Add(control)
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;ReadOnly&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt; Count() &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;
&lt;span class="kwrd"&gt;Get&lt;/span&gt;
&lt;span class="kwrd"&gt;Return&lt;/span&gt; controlsWithErrors.Count
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Get&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt;

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;ReadOnly&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt; HasErrors() &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;
&lt;span class="kwrd"&gt;Get&lt;/span&gt;
&lt;span class="kwrd"&gt;Return&lt;/span&gt; controlsWithErrors.Count &amp;gt; 0
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Get&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt;

&lt;span class="kwrd"&gt;End&lt;/span&gt; Class&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=2911" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category></item><item><title>XmlResolver doesn't authenticate with Proxy server</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/10/02/xmlresolver-doesn-t-authenticate-with-proxy.aspx</link><pubDate>Tue, 02 Oct 2007 11:04:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:2603</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Just had a problem in resolving a DTD, stored at a remote URI, while loading an XML file into a XmlDocument. Usually a XmlUrlResolver is used to resolve remote XSD or DTD defined in an XML document, however the XmlUrlResolver doesn&amp;#39;t perform Proxy authentication meaning that as soon as you try to load the document a WebException is raised saying &amp;quot;The remote server returned an error: (407) Proxy Authentication Required.&amp;quot;. The solution is to create your own XmlResolver that handles proxy authentication and here it is. &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; XmlProxyUrlResolver
&lt;span class="kwrd"&gt;Inherits&lt;/span&gt; XmlResolver

&lt;span class="kwrd"&gt;Private&lt;/span&gt; m_proxy &lt;span class="kwrd"&gt;As&lt;/span&gt; IWebProxy = WebProxy.GetDefaultProxy()
&lt;span class="kwrd"&gt;Private&lt;/span&gt; m_credentials &lt;span class="kwrd"&gt;As&lt;/span&gt; ICredentials

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Overrides&lt;/span&gt; &lt;span class="kwrd"&gt;WriteOnly&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt; Credentials() &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.ICredentials
&lt;span class="kwrd"&gt;Set&lt;/span&gt;(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; value &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.ICredentials)
m_credentials = value
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Set&lt;/span&gt;
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt;

&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Overrides&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; GetEntity(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; absoluteUri &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Uri, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; role &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, _
&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; ofObjectToReturn &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Type) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Object&lt;/span&gt;
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; request &lt;span class="kwrd"&gt;As&lt;/span&gt; WebRequest = WebRequest.Create(absoluteUri)
request.Proxy = m_proxy
request.Proxy.Credentials = m_credentials
request.Credentials = m_credentials
&lt;span class="kwrd"&gt;Return&lt;/span&gt; request.GetResponse().GetResponseStream()
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;

&lt;span class="kwrd"&gt;End&lt;/span&gt; Class&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;The XmlProxyUrlResolver resolves the DTD at http://www.w3.org with authenticating with the proxy server.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=2603" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/XML+Related/default.aspx">XML Related</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category></item><item><title>CSSVista (Edit CSS Live)</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/09/29/cssvista-edit-css-live.aspx</link><pubDate>Sat, 29 Sep 2007 16:03:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:2487</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>http://litmusapp.com/cssvista/

CSSVista is a free Windows application for web developers which lets you edit your CSS code live in both Internet Explorer and Firefox simultaneously. 
Vista only.&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=2487" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/ASP.NET+v2.0/default.aspx">ASP.NET v2.0</category></item><item><title>XSL-FO to PDF, MathML, Virtual PC, and MSIs</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/08/31/XSL_2D00_FO-to-PDF_2C00_-MathML_2C00_-Virtual-PC_2C00_-and-MSIs.aspx</link><pubDate>Fri, 31 Aug 2007 14:28:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1770</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;First off many thanks to Digvijay for his comment, it was well appreciated. I&amp;#39;m not to clever at replying to comments, only to happy to help. You may have noticed that there was a noticable gap in time between some posts, the reason for this was two fold... I&amp;#39;ve started back with&amp;nbsp;studying for the MCPD - Windows and my home computer died a death; I try not to post in my blog at work.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here are some links to some interesting things.... &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;XSL-FO to PDF:&lt;/em&gt;&lt;/strong&gt; This is a small tool (client and server .NET based api are available) that lets you create PDF&amp;#39;s from XSL-FO files. I&amp;#39;ve been trying to&amp;nbsp;convice my company to develop a web service that would allow anyone in the company to create PDF files, they liked the idea but the project was put on hold as there were no components that formatted XML to PDF, most were Office Documents or Printer drivers (not really suitable for a server).&amp;nbsp;This component handles XML to PDF via XSL-FO format and also handles the new XML format of Office. There is a free client based utility, which is rather handy.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.alt-soft.com/"&gt;http://www.alt-soft.com/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;MathML:&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;this is an XML language that lets you write mathematical formulas for display in web pages. For any mechanical or structural engineers out there MathCAD fully supports MathML&lt;/p&gt;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/MathML"&gt;http://en.wikipedia.org/wiki/MathML&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.integretechpub.com/zed/"&gt;http://www.integretechpub.com/zed/&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (free MathML editor and I.E. browser addin here)&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Virtual PC 2007:&lt;/strong&gt;&lt;/em&gt; So my computer died, RIP, and I&amp;#39;m needing to buy a new computer&amp;nbsp;and specifically one with 4Gb of RAM. Phoned the shop and talked through a spec and was annoyed to&amp;nbsp;find out&amp;nbsp;that 32bit operating systems only support 3Gb of RAM. 32bit Vista might say it supports 4Gb of RAM but it doesn&amp;#39;t really as some memory is lost in maintaining memory mapping. So in order to&amp;nbsp;get the&amp;nbsp;4Gb of&amp;nbsp;RAM (I&amp;#39;m actually wanting 8Gb)&amp;nbsp;I needed to go for a 64bit version of Vista which means all my 32bit applications won&amp;#39;t work; a-n-n-o-y-i-n-g.&lt;/p&gt;&lt;p&gt;Then I found out Microsoft are offering Virtual PC 2007 for free as one of a number of&amp;nbsp;work arounds to this problem and everything didn&amp;#39;t seem so bad now. With 64bit Vista&amp;nbsp;running as the main OS and a virtual PC running a host 32bit Windows XP Pro OS, taken from the deceased,&amp;nbsp;then&amp;nbsp;there will a&amp;nbsp;64bit and 32bit&amp;nbsp;OS&amp;nbsp;on one machine, I can develop using new and old&amp;nbsp;technology....&amp;nbsp;in theory it sounds great but&amp;nbsp;need to see how well it works out.... but at least I can go up to&amp;nbsp;the 8Gb of RAM!!! &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;d recommend you getting a copy of this, although you&amp;nbsp;will need a fairly decent&amp;nbsp;machine.&lt;/p&gt;&lt;p&gt;MSIs: Orca is a small tool that lets you view the internals of an MSI. Unfortunately in order to get it you need to download a 300Mb CD. This is, of course,&amp;nbsp;unless you visit the blog of Brent Norris.... cheers mate.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.brentnorris.net/blog/?p=319"&gt;http://www.brentnorris.net/blog/?p=319&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Thanks for reading folks... I appreciate it, and don&amp;#39;t be annoyed if you don&amp;#39;t get a reply to your comments. If your looking for my help in anyway then please check out the MSDN forums, I spend time there answering questions and if I don&amp;#39;t get around to it, someone else there will.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1770" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Development+Tools/default.aspx">Development Tools</category></item><item><title>TrueCrypt - Protecting USB Memory Sticks</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/08/24/TrueCrypt-_2D00_-Protecting-USB-Memory-Sticks.aspx</link><pubDate>Fri, 24 Aug 2007 16:00:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1752</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For the last year I&amp;#39;ve been using a 8Gb JetFlash USB memory stick to store all my ebooks and projects on. It&amp;#39;s&amp;nbsp;a fantastic little&amp;nbsp;memory stick because it comes with a piece of software&amp;nbsp;called uFormat which partitions&amp;nbsp;the&amp;nbsp;stick&amp;nbsp;into a unsafe and secure area. You need to login to the secure area. &lt;/p&gt;&lt;p&gt;I recently filled it, so I decided to go the next step and I upgraded to 16Gb (still a JetFlash).&lt;/p&gt;&lt;p&gt;Unfortunately&amp;nbsp;it&amp;nbsp;turned out uFormat&amp;nbsp;was not supported on the higher memory stick, which&amp;nbsp;was really annoying,&amp;nbsp;and instead another tool JetElite was it&amp;#39;s replacement. JetElite uses encryption instead to protect sensitive data and unfortunately it&amp;#39;s slower than a week in jail, which was also very annoying.&lt;/p&gt;&lt;p&gt;So my memory stick was basically&amp;nbsp;unusable because to make things safe required a slow encryption process. That was a problem, a big problem.... so I started searching.... and I found something wonderful.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TrueCrypt - &lt;/strong&gt;&lt;a href="http://www.truecrypt.org/"&gt;&lt;strong&gt;http://www.truecrypt.org/&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here is a list of it&amp;#39;s features.... &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Creates a &lt;strong&gt;virtual encrypted disk&lt;/strong&gt; within a file and mounts it as a real disk. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Encrypts an entire hard disk partition &lt;/strong&gt;or a &lt;strong&gt;storage device&lt;/strong&gt; such as USB flash drive.&lt;/li&gt;&lt;li&gt;Encryption is &lt;a href="http://www.truecrypt.org/docs/"&gt;&lt;font color="#006699"&gt;automatic, real-time (on-the-fly) and transparent&lt;/font&gt;&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.truecrypt.org/docs/?s=encryption-algorithms"&gt;&lt;font color="#006699"&gt;Encryption algorithms&lt;/font&gt;&lt;/a&gt;: &lt;a href="http://www.truecrypt.org/docs/?s=aes"&gt;&lt;font color="#006699"&gt;AES-256&lt;/font&gt;&lt;/a&gt;, &lt;a href="http://www.truecrypt.org/docs/?s=serpent"&gt;&lt;font color="#006699"&gt;Serpent&lt;/font&gt;&lt;/a&gt;, and &lt;a href="http://www.truecrypt.org/docs/?s=twofish"&gt;&lt;font color="#006699"&gt;Twofish&lt;/font&gt;&lt;/a&gt;. Mode of operation: &lt;a href="http://www.truecrypt.org/docs/?s=modes-of-operation"&gt;&lt;font color="#006699"&gt;LRW&lt;/font&gt;&lt;/a&gt;. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;It lets you create a single encrypted file that can be mounted as a real drive, a drive that you need to login to. It&amp;#39;s encryption choices are so good that you can create a combined algorithim&amp;nbsp;resulting in&amp;nbsp;a 768 bit key (several universes would pass before being able to brute force crack it) and it is so blindingly fast you have no idea encryption is taking place, even though the data might be getting stored on a memory stick with limited transfer rates... and get this....&lt;/p&gt;&lt;p&gt;&lt;strong&gt;....it&amp;#39;s free........ (everyone&amp;#39;s favorite price).&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;There is also a traveller mode which makes it perfect for memory stick use. Traveller mode means you can run TrueCrypt from the memory stick your protecting without needing to do an install on the machine (although they say you need admin rights on the machine)&lt;/p&gt;&lt;p&gt;Your limited to 3.9 Gb on FAT formatted drives / memory sticks but thats a limitation on the FAT&amp;nbsp;format and bsides it&amp;#39;s not that bad creating different virtual drives for different types of data you might store. For example I split the 16Gb drive into 4 areas, one unsafe, one for books, one for projects, and one for personnal data, and it&amp;#39;s better than before as each is protected differently; not so many eggs in one basket. &lt;/p&gt;&lt;p&gt;What a wonderful, wonderful,&amp;nbsp;piece of software.&amp;nbsp;A must have if&amp;nbsp;you own a&amp;nbsp;memory stick. &lt;/p&gt;&lt;p&gt;I&amp;#39;d even like to suggest a donation to the developers&amp;nbsp;if you do decide to use it. &lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1752" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Development+Tools/default.aspx">Development Tools</category></item><item><title>Microsoft Patterns and Practices April 2007 DVD </title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/28/Microsoft-Patterns-and-Practices-April-2007-DVD-.aspx</link><pubDate>Sat, 28 Jul 2007 09:04:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1658</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;span class="forumName" id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject"&gt;Microsoft Patterns and Practices April 2007 DVD&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6724E09B-CA2E-425A-8D71-8FEBAD3BA203&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=6724E09B-CA2E-425A-8D71-8FEBAD3BA203&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Full DVD download of all the articles, videos, libraries, and tools posted&amp;nbsp;by Microsofts Patterns and Practises team. Well worth the download wait. &lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1658" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Development+Tools/default.aspx">Development Tools</category></item><item><title>Open Packaging Convention (OPC)</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/21/Open-Packaging-Convention-_2800_OPC_2900_.aspx</link><pubDate>Sat, 21 Jul 2007 10:33:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1629</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Was reading MSDN Magazine through the week and there is an article in it on OPC. In short OPC is a new standard for saving complex data, perhaps stored in multiple files, to a single file (a package)&amp;nbsp;using a combination of two standard technologies zip and xml. &lt;/p&gt;&lt;p&gt;Here is the article...&lt;/p&gt;&lt;p&gt;OPC: A New Standard For Packaging Your Data&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/08/OPC/default.aspx"&gt;http://msdn.microsoft.com/msdnmag/issues/07/08/OPC/default.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The idea is simple you store your data files seperately and use xml to create relationships between them. All the seperate files are then combined into a single zip file. Office 2007&amp;nbsp;uses these new file formats, calling them Open XML Formats,&amp;nbsp;but there is nothing stopping you creating your own. &lt;/p&gt;&lt;p&gt;I&amp;#39;ll give you an example a Word document is made up of text, styles, maybe a macro and perhaps some images. With the new format instead of saving this in binary the following happens, the text is stored&amp;nbsp;as a&amp;nbsp;WordML file, the styles&amp;nbsp;are saved in an xml file, the macros are stored in a seperate binary file and each image is saved to a jpeg file. Relationships are then used to knit the document together and essentially describe how the document is&amp;nbsp;built from each of the seperate files. All the&amp;nbsp;files are then zipped into an single archive and the normal zip extenstion is changed to associate the single file package with Word.&lt;/p&gt;&lt;p&gt;Here is a noob friendly article that describes the file format, a good place to start&lt;/p&gt;&lt;p&gt;Ecma Office Open XML Formats architecture guide&lt;br /&gt;&lt;a href="http://office.microsoft.com/en-us/products/HA102057841033.aspx"&gt;http://office.microsoft.com/en-us/products/HA102057841033.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;and here is another thats not so noob....&amp;nbsp;but more complete&lt;/p&gt;&lt;p&gt;Introducing the Office (2007) Open XML File Formats&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms406049.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms406049.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You also don&amp;#39;t need to wait until your financially paranoid company decides to&amp;nbsp;upgrade&amp;nbsp;to Office 2007. There are both software development kits and Office 2003 Compatibility Packs to get you up and running (although I haven&amp;#39;t had time to give them a proper once over).&lt;/p&gt;&lt;p&gt;2007 Office System: Microsoft SDK for Open XML Formats&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=ad0b72fb-4a1d-4c52-bdb5-7dd7e816d046&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=ad0b72fb-4a1d-4c52-bdb5-7dd7e816d046&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;&lt;p&gt;If any of the links don&amp;#39;t work then do a search for the title and you&amp;#39;ll get the pages.&lt;/p&gt;&lt;p&gt;It has always been a nightmare trying to extract data from Office files and if&amp;nbsp;the company you work for is anything like the one I work for where the report is more important than the data held within the report, or you get many requests to extract data from Word or Excel, or even if your fed up telling people that&amp;nbsp;the 36Mb spreadsheet&amp;nbsp;that they cannot produce a report from should have been a database, then you&amp;#39;ll be happy, very happy, as sometime soon things are going to get easier. &lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1629" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/XML+Related/default.aspx">XML Related</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/Office/default.aspx">Office</category></item><item><title>Embedding images into Mp3's</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/14/Embedding-images-into-Mp3_2700_s.aspx</link><pubDate>Sat, 14 Jul 2007 18:56:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1610</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;m a huge fan of electronic music and being the type of frood&amp;nbsp;who knows where his towel is at I&amp;#39;ve got rather a nice selection of Mp3s and a lovely IRiver H340 to play them on. The H340 comes with it own built in firmware&amp;nbsp;which&amp;nbsp;although it&amp;#39;s very colourful it&amp;#39;s still crap. So some&amp;nbsp;sexy&amp;nbsp;developers have got together and produced Rockbox, a free alternative firmware&amp;nbsp;for certain Mp3 players. &lt;/p&gt;&lt;p&gt;One of the custom themes of RockBox, iCatcher, appears to extract from the Id3v2 tag of the mp3 the embedded image&amp;nbsp;stored as the album art (front cover, back cover, etc).&amp;nbsp;That got me looking into&amp;nbsp;software tools that&amp;nbsp;let you embed images into mp3s and what I&amp;nbsp;found wasn&amp;#39;t good enough,&amp;nbsp;so&amp;nbsp;I created my own; it&amp;#39;s great being a developer.&lt;/p&gt;&lt;p&gt;First off I had a look for some .NET libraries that let you get or create mp3 Id3v2 tags and low and behold.... &lt;/p&gt;&lt;p&gt;TagLib#... &lt;a href="http://www.taglib-sharp.com/Main_Page"&gt;http://www.taglib-sharp.com/Main_Page&lt;/a&gt;&lt;/p&gt;&lt;p&gt;An excellent API for altering mp3 (and many other formats) tags. So here is some code using this library that allows you to embed an image. This code only works if the image is correctly sized, 75 pixels by 75 pixels is suitable. &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;&amp;#39;get the mp3 file&lt;/span&gt;
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; mp3 &lt;span class="kwrd"&gt;As&lt;/span&gt; TagLib.File = TagLib.File.Create(&lt;span class="str"&gt;&amp;quot;D:\Towers Of Dub.mp3&amp;quot;&lt;/span&gt;)
&lt;span class="rem"&gt;&amp;#39;create the picture for the album cover&lt;/span&gt;
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; picture &lt;span class="kwrd"&gt;As&lt;/span&gt; TagLib.Picture = TagLib.Picture.CreateFromPath(&lt;span class="str"&gt;&amp;quot;D:\UfOrb.jpg&amp;quot;&lt;/span&gt;)
&lt;span class="rem"&gt;&amp;#39;create Id3v2 Picture Frame&lt;/span&gt;
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; albumCoverPictFrame &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; TagLib.Id3v2.AttachedPictureFrame(picture)
albumCoverPictFrame.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg
&lt;span class="rem"&gt;&amp;#39;set the type of picture (front cover)&lt;/span&gt;
albumCoverPictFrame.Type = TagLib.PictureType.FrontCover

&lt;span class="rem"&gt;&amp;#39;Id3v2 allows more than one type of image, just one needed&lt;/span&gt;
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; pictFrames() &lt;span class="kwrd"&gt;As&lt;/span&gt; TagLib.IPicture = {albumCoverPictFrame}
mp3.Tag.Pictures = pictFrames &lt;span class="rem"&gt;&amp;#39;set the pictures in the tag&lt;/span&gt;
mp3.Save()&lt;/pre&gt;&lt;p&gt;Unfortunately!!&lt;/p&gt;&lt;p&gt;Microsofts Media Player only supports Id3 v2.3, which has been superceded, so you have to use the following lines of code to tell the TibLib library to use v2.3,&amp;nbsp;otherwise it uses a default of v2.4.&lt;/p&gt;&lt;pre class="csharpcode"&gt;TagLib.Id3v2.Tag.DefaultVersion = 3
TagLib.Id3v2.Tag.ForceDefaultVersion = True&lt;/pre&gt;&lt;p&gt;If you have any need to work with mp3 tags TagLib# is the API to use!&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1610" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category></item><item><title>Looping over resources</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/14/Looping-over-resources.aspx</link><pubDate>Sat, 14 Jul 2007 14:39:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1609</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Here is a small code snippet that demonstrates looping over the resources stored in the My.Resources namespace. It was a response to a MSDN forum question where all the resources stored were images. If you want have more types of resources then you&amp;#39;ll want to refine this a bit. Treat the code below as a starter for 10 and take it from there...&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Dim&lt;/span&gt; res &lt;span class="kwrd"&gt;As&lt;/span&gt; Resources.ResourceManager = My.Resources.ResourceManager
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; resSet &lt;span class="kwrd"&gt;As&lt;/span&gt; Resources.ResourceSet = _
res.GetResourceSet(Globalization.CultureInfo.CurrentUICulture, &lt;span class="kwrd"&gt;True&lt;/span&gt;, 
&lt;span class="kwrd"&gt;True&lt;/span&gt;)
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; en &lt;span class="kwrd"&gt;As&lt;/span&gt; IDictionaryEnumerator = resSet.GetEnumerator()

&lt;span class="kwrd"&gt;While&lt;/span&gt; en.MoveNext()
&lt;span class="rem"&gt;&amp;#39;en.Key - name of the resourse&lt;/span&gt;
&lt;span class="rem"&gt;&amp;#39;en.Value - the resource as an object&lt;/span&gt;
images.Add(en.Value)
&lt;span class="kwrd"&gt;End&lt;/span&gt; While&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1609" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/.NET+Windows+Development/default.aspx">.NET Windows Development</category></item><item><title>The ListView and its ListViewGroups.</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/13/ListViewGroups_2E002E002E00_-.aspx</link><pubDate>Fri, 13 Jul 2007 15:02:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1606</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The ListView control is maybe the most commonly used control used by&amp;nbsp;Windows. The reason being its used&amp;nbsp;by the&amp;nbsp;file&amp;nbsp;explorer to let you view your files in a variety of&amp;nbsp;ways, you can view&amp;nbsp;directories as&amp;nbsp;icons, you can view thumbnails, or you can view all the files details. One option of the file explorer that you might not make use of is the ability to group the icons. Here&amp;#39;s an example... &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img height="204" src="http://homepage.ntlworld.com/derek.smyth1/dotnetslackers/ListViewGroups.jpg" width="314" /&gt;&lt;/p&gt;&lt;p&gt;It&amp;#39;s not that useful in Windows to be honest, or at least I haven&amp;#39;t been in a position when I needed to use it. However..... It&amp;#39;s actually pretty good if you use it in your own applications to&amp;nbsp;group certain common options, for example, you have a place where the user can print reports, rather than&amp;nbsp;listing of all reports and letting the user scan through them you can instead group your reports into categories i.e.&amp;nbsp;financial or&amp;nbsp;informational. Another examle might be a list of products that the user can select from you can now list the products by category or price. It works really well and I&amp;#39;ve had some fairly positive feedback from users, which is surprising, users tend not to give feedback unless something doesn&amp;#39;t work.&lt;/p&gt;&lt;p&gt;So here&amp;#39;s how. I&amp;#39;ll cover how to do it through code, once you understand that adding groups and items though Visual Studio IDE will be straightforward. &lt;/p&gt;&lt;p&gt;The concept first, simple really, the listview can be made up of groups which contains a collection of items (sub items are not supported), any item not in a group is placed in a default group. So the first thing to do is you need to add the groups to the ListView, I&amp;#39;ll use the product example given above.... &lt;/p&gt;&lt;p&gt;Step 1: Create your groups and add them to the ListView&amp;#39;s Group property&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Dim&lt;/span&gt; audio &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; ListViewGroup(&lt;span class="str"&gt;&amp;quot;Audio CD&amp;quot;&lt;/span&gt;)
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; dvd &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; ListViewGroup(&lt;span class="str"&gt;&amp;quot;DVD&amp;quot;&lt;/span&gt;)
&lt;span class="kwrd"&gt;Dim&lt;/span&gt; vhs &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; ListViewGroup(&lt;span class="str"&gt;&amp;quot;VHS&amp;quot;&lt;/span&gt;)

&lt;span class="kwrd"&gt;Dim&lt;/span&gt; groups &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; List(Of ListViewGroup)
groups.Add(audio)
groups.Add(dvd)
groups.Add(vhs)

&lt;span class="kwrd"&gt;Me&lt;/span&gt;.ListView1.Groups.AddRange(groups.ToArray())&lt;/pre&gt;&lt;p&gt;This is done by creating instances of ListViewGroup objects, it&amp;#39;s easier to create instance rather than to add the groups directly as when it comes to adding items you need to use the group instances as your about to see.&lt;/p&gt;&lt;p&gt;Step 2: Add the items to the ListView and specify&amp;nbsp;the&amp;nbsp;group it&amp;#39;s to appear in. It&amp;#39;s important to note that there is a one to many relationship between groups and items. One group can have many items but one item can only belong to one group. Here&amp;#39;s some example code.... &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Dim&lt;/span&gt; viewItem &lt;span class="kwrd"&gt;As&lt;/span&gt; ListViewItem
viewItem = &lt;span class="kwrd"&gt;Me&lt;/span&gt;.ListView1.Items.Add(&lt;span class="str"&gt;&amp;quot;Biosphere - Substrata&amp;quot;&lt;/span&gt;)
viewItem.Group = audio

viewItem = &lt;span class="kwrd"&gt;Me&lt;/span&gt;.ListView1.Items.Add(&lt;span class="str"&gt;&amp;quot;Night of the Living Dead&amp;quot;&lt;/span&gt;)
viewItem.Group = dvd

viewItem = &lt;span class="kwrd"&gt;Me&lt;/span&gt;.ListView1.Items.Add(&lt;span class="str"&gt;&amp;quot;Chopper Chicks in Zombie Town&amp;quot;&lt;/span&gt;)
viewItem.Group = vhs
&lt;/pre&gt;&lt;p&gt;When the ListViewItem is added to the ListView control you need to set it&amp;#39;s Group property to an instance of a ListViewGroup object.&lt;/p&gt;&lt;p&gt;Step 3: When you use the ListView in this way the layout doesn&amp;#39;t follow the usual grid like approach so you have to sort the layout of the items, which you do using a couple of properties. This will completely depend on what your control should look like and how it should act. Just make sure ListView.ShowGroups = True&lt;/p&gt;&lt;p&gt;You may also notice that the labels of your items aren&amp;#39;t quite right. If you find this happening set ListView.View = Title and set ListView.LabelWrap = False and hopefully that will fix any problems you have.&lt;/p&gt;&lt;p&gt;Click &lt;a href="http://homepage.ntlworld.com/derek.smyth1/dotnetslackers/ListViewGroups.zip"&gt;here&lt;/a&gt;&amp;nbsp;to download&amp;nbsp;the code example... it&amp;#39;s simple but demonstrates the idea.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1606" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/.NET+Windows+Development/default.aspx">.NET Windows Development</category></item><item><title>Changing the display name and sorting properties of the Property Grid</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/07/Changing-the-display-name-and-sorting-properties-in-the-Property-Grid.aspx</link><pubDate>Sat, 07 Jul 2007 14:05:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1593</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This post assumes a bit of background knowledge on how to use and control the property grid when displaying the properties of an object.&lt;/p&gt;&lt;p&gt;The property grid is a great control, I like it a lot, but it does have some problems. One of these is the use of attributes to specify and control categories, display names and descriptions of each property it displays. The attributes, which are specified at design time, allow only string literals to be set. These are compiled into assembies metadata and because of this they cannot be changed at runtime. So, for example, you cannot look up the name or description of a property from a database, or a file, or even change it depending on a condition. &lt;/p&gt;&lt;p&gt;Another problem is there are no attributes to specify in which order the property grid should displays the object properties, so even though in code the properties of your object are defined in the order you want, the property grid won&amp;#39;t display them in that order. &lt;/p&gt;&lt;p&gt;There are two classes that control how the property grid displays an objects properties that help fix these two problems, one class is used to look up the display name, category and description of a property while the other class indentifies which properties of the object, and more importantly in what order, these properties should be displayed.&lt;/p&gt;&lt;p&gt;The class System.ComponentModel.PropertyDescriptor is a class that tells the property grid how to describe a property. There are many methods and properties that need to be overriden but the three most useful are the read only DisplayName, Category and the Description properties. This descriptor class could be thought of as a class that describes how a single property is displayed in the property grid.&lt;/p&gt;&lt;p&gt;The second class allows you to select and sort the properties displayed on the property grid. The System.Component.CustomTypeDescriptor class allows to control how the properties of a type are displayed. It&amp;#39;s main task is to build a collection of PropertyDescriptors. &lt;/p&gt;&lt;p&gt;If the PropertyDescriptor describes how each individual property of a type is displayed then the CustomTypeDescriptor completes the picture by allowing a type to describe how it&amp;#39;s properties are displayed. As you can imagine the CustomTypeDescriptor creates instances of the PropertyDescriptor. Generally the object whos properties you want to display is inherited from the CustomTypeDescriptor and this allows the object to describe itself to the property grid.&lt;/p&gt;&lt;p&gt;Granted this description, without code samples, isn&amp;#39;t particularly intuitive so here is a small sample application that demonstrates how to use the above two classes. The example displays a simple Employee class in the property grid. The employee class has no attributes describing how each of it&amp;#39;s properties are displayed, that information is extracted from a comma delimited file by a EmployeePropertyDescriptor class, which doesn&amp;#39;t do a very efficient job of the lookup, but it is only a demo. The employee class also inherits from the CustomTypeDescriptor and in the GetProperties() method specifies the order of the properties and using that order builds a collection of EmployeePropertyDescriptor objects which is used by the property grid. Very simple example.&lt;/p&gt;&lt;p&gt;&lt;a href="http://homepage.ntlworld.com/derek.smyth1/dotnetslackers/DisplayNameAndSortingPropertyGrid.zip"&gt;DisplayName And Sorting PropertyGrid.zip&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Very sorry !! Missed out a very small but important detail! You have to set the Property Grids PropertySort property (eh?) to Categorized. Otherwise you&amp;#39;ll still get the list in alphabetic order. Sorry for missing that.&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1593" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/dsmyth/archive/tags/General+.NET+v2.0/default.aspx">General .NET v2.0</category></item><item><title>Catching up....</title><link>http://dotnetslackers.com/Community/blogs/dsmyth/archive/2007/07/05/Catching-up_2E002E002E002E00_.aspx</link><pubDate>Thu, 05 Jul 2007 22:05:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1585</guid><dc:creator>dsmyth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;After a fairly intense period of full on study I finally sat the MCPD Windows Developer upgrade exam (70-552)&amp;nbsp;and was&amp;nbsp;pretty shocked to see that I failed. wtf? can I say wtf on the Internet? of course I can because I failed the exam, wtf? To be honest I don&amp;#39;t like the new format they have introduced in the upgrade exams. &lt;/p&gt;&lt;p&gt;Basically you sit three one hour exams (70-526, 70-536, and 70-548), which in itself is fine but if you finish&amp;nbsp;two exams in 30 minutes, then the hour isn&amp;#39;t transferred into the last exam, which is a bit unfair. Basically&amp;nbsp;I passed the two code based TS exams (70-526, and 70-536) taking about 30 minutes for each and messed up on the (70-548) questions to do with&amp;nbsp;debugging performance and troubleshooting network problems, which you really need experience of, not something you can read in a book, if infact you can find a book on it. What was so annoying was the outstanding hour wasn&amp;#39;t transferred and with 30 questions in 1 hour, 2 minutes a question, thats a bit harsh Microsoft.&lt;/p&gt;&lt;p&gt;So anyway I have been neglecting my blog and to a greater extent DotNetSlackers and everyone here, and for that I appologise. I have so much to write about as well. Lots of nice little juicy code snippets but just not getting around to posting them for some reason. Need to start posting from work more I think&amp;nbsp;and recent changes in my position might make that more of a possibility. I&amp;#39;ll make it happen.&lt;/p&gt;&lt;p&gt;Need to write an article as well, I haven&amp;#39;t written one this year and that&amp;#39;s rubbish. Think I&amp;#39;ll write&amp;nbsp;an article on&amp;nbsp;the internals of the DES and 3DES encryption algorthims, which is a subject I&amp;#39;ve been reading up on, not DES specifically just crytography and security in general. I believe that, with the way the industry is going,&amp;nbsp;the two most important subjects for a developer to know is security and threading.&lt;/p&gt;&lt;p&gt;But I do need to contribute more!!&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1585" width="1" height="1"&gt;</description></item></channel></rss>