<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>VB.NET</title><link>http://www.michaelfalconer.co.uk/category/12.aspx</link><description>VB.NET</description><managingEditor>Michael Falconer</managingEditor><dc:language>en-GB</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Michael Falconer</dc:creator><title>Exception handling in .net applications</title><link>http://www.michaelfalconer.co.uk/archive/2004/08/28/196.aspx</link><pubDate>Sat, 28 Aug 2004 19:20:00 GMT</pubDate><guid>http://www.michaelfalconer.co.uk/archive/2004/08/28/196.aspx</guid><description>&lt;P&gt;One of the features of the .net CLR that I love the best is structured exception handling. Having worked largely on ASP / VBScript / VB applications prior to moving to C# / .net, the ability to catch and handle every type of error that can occur has proved invaluable.&lt;/P&gt;
&lt;P&gt;Most of the .net applications I've worked on so far have been relatively simple, with very few interface boundaries and therefore I've not had to worry too much about catching exceptions until they bubble to the UI. The current project I'm working on, however, involves properly stuctured DAL / BLL and UI layers, plus I've been implementing provider patterns for a variety of components. One of my sources of information&amp;nbsp;/ inspiration has been the source code for .Text, where I noticed a number of classes the used&amp;nbsp;a try...finally block without any catch. At first this looked a bit odd, until I came across &lt;A href="http://www.interact-sw.co.uk/iangblog/2004/08/16/whentocatch"&gt;this article&lt;/A&gt; on &lt;A href="http://www.interact-sw.co.uk/iangblog/"&gt;Ian Griffith's weblog&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;So, if his closing remark (If it's news to you that your &lt;CODE&gt;finally&lt;/CODE&gt; blocks should be outnumbering your &lt;CODE&gt;catch&lt;/CODE&gt; blocks by a significant margin, then you're probably doing something wrong) applies to you, check it out.&lt;/P&gt;&lt;img src ="http://www.michaelfalconer.co.uk/aggbug/196.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Michael D. Falconer</dc:creator><title>More freebies - get Visual Basic .NET 2003 Standard Edition for free</title><link>http://www.michaelfalconer.co.uk/archive/2004/05/27/161.aspx</link><pubDate>Thu, 27 May 2004 11:02:00 GMT</pubDate><guid>http://www.michaelfalconer.co.uk/archive/2004/05/27/161.aspx</guid><description>&lt;P&gt;Microsoft have just added a new item on &lt;A title="Microsoft Developer Network" href="http://msdn.microsoft.com" target=_blank&gt;MSDN&lt;/A&gt; that lets you get a free copy of Visual Basic .NET 2003 Standard Edition. All you need to do is watch 5 'movies', rate them, then apply for your redemption code. It's all &lt;A href="http://msdn.microsoft.com/vbasic/atthemovies/" target=_blank&gt;available here&lt;/A&gt;, and I'll be adding a review of some of the movies soon (I better wait til lunch before watching them!)...&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;[UPDATE]&lt;/FONT&gt; Of course, it's only after writing this&amp;nbsp;I realise that, as happens all too often, this offer is only good if you're a Yank. Go on Microsoft, give us Brits some free stuff too! It's not that I need the software (I use VS), but it's the principle of it...&lt;/P&gt;&lt;img src ="http://www.michaelfalconer.co.uk/aggbug/161.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Michael D. Falconer</dc:creator><title>Filtering a DataView based on the value of a child record</title><link>http://www.michaelfalconer.co.uk/archive/2004/05/20/156.aspx</link><pubDate>Thu, 20 May 2004 13:29:00 GMT</pubDate><guid>http://www.michaelfalconer.co.uk/archive/2004/05/20/156.aspx</guid><description>&lt;P&gt;I've been developing a Windows Form application&amp;nbsp;in VB.NET, and came across an interesting puzzle when trying to filter the contents of a ListBox based on a value in a child record.&lt;/P&gt;
&lt;P&gt;To explain a bit more, I have a DataSet that contains a table with records of courses and a&amp;nbsp;related table of qualifications. A course can have more than one qualification. I have a DataView based on the course table, and wanted to filter it based on a selected qualification. The RowFilter property of the DataView allows you to select a child row using Child.Row or Child(Relationship).Row in the expression. But to quote the documentation: 'because child relationships may return multiple rows, you must include the reference to the child column in an aggregate function.'. I hoped that I could therefore do something like:&lt;/P&gt;
&lt;P&gt;Count(Child.qualification='Masters')&amp;gt;0&lt;/P&gt;
&lt;P&gt;Sadly, no. This simlpy returns the following error:&lt;/P&gt;
&lt;P&gt;"Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier."&lt;/P&gt;
&lt;P&gt;So, it appeared that you can't apply a filter to a Child element in the filter expression. My solution to the problem was to add a new boolean column to the course DataTable, and then update the value of it depending on the selected value using an XPath query. It does mean that you have to reset the values of the column each tmie the filter value is changed, but for this application that approach appears to work fine, without any major performance penalties.&lt;/P&gt;
&lt;P&gt;Hopefully, though, this will be something that's looked at in a future version of .net...&lt;/P&gt;&lt;img src ="http://www.michaelfalconer.co.uk/aggbug/156.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>