<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.9.2 (http://www.squarespace.com/) on Wed, 10 Mar 2010 00:13:37 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>Cork Chop's Journal</title><subtitle>Journal</subtitle><id>http://www.corkchop.com/journal/</id><link rel="alternate" type="application/xhtml+xml" href="http://www.corkchop.com/journal/"/><link rel="self" type="application/atom+xml" href="http://www.corkchop.com/journal/atom.xml"/><updated>2010-02-08T18:39:46Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.9.2 (http://www.squarespace.com/)">Squarespace</generator><entry><title>The iPhone is a Gateway Drug</title><category term="Apple"/><category term="Music"/><category term="iPhone"/><id>http://www.corkchop.com/journal/2008/9/12/the-iphone-is-a-gateway-drug.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2008/9/12/the-iphone-is-a-gateway-drug.html"/><author><name>CorkChop</name></author><published>2008-09-12T02:46:12Z</published><updated>2008-09-12T02:46:12Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>It started innocently actually, which is what every addict says at some point, when they realize they are addicted.</p><p>Everyone around me had iPods in all flavors, sizes, colors and storage capacities and I steadfastly held on to my Zune and Microsoft-centric products.  I actually like them, and I probably still would still be using them had it not been for the pesky little iPhone I bought my partner for Christmas, then, he dumped me.</p><p>I still have the card neatly gift wrapped from Apple.  It's a white little envelope with a bright red ribbon around it.  It's so cute and a constant reminder of something although at this point I am not sure what.  A lesson maybe, but I'm still not sure what kind.</p><p>The iPhone was under my elaborate Christmas tree no one ever sees because no one visits me and it didn't stay there long. I downloaded iTunes and activated it and thus began my obsession with Apple.  A lot of people thought it was bound to happen and long over due.</p><p>It's funny now how people with iPhones gravitate to people with iPhones.  All of my friends have one and I have made some new friends just because they have one. We shun others that have inferior phones, and pity those with Razr's.  We take them out when we are bored with our company as a subtle reminder to those around us that what is waiting for us on our iPhones is slightly more important than they are. </p><p>We prominently display them on restaurant tables and on the bars of clubs. </p><p>We TXT/SMS more than we call and it has become our primary method of communication.</p><p>;-/</p><p>Then came the iPhone accessories.  Cases, bluetooth headsets, Bose headphones, holsters, and applications from the AppStore.  Around the Spring I got the strangest impression that I was missing something when I connected my iPhone to my Dell laptop.  Luckily it died on me and I had to replace it with a MacBook Pro.  In my mind, I had no other alternative.<br></p><p>Just when I had satisfied my Apple appetite, <a href="http://en.wikipedia.org/wiki/Jonathan_Ive">Jonathan Ive</a> and Steve Jobs slaps me in the face with the 3G.  I had no choice to upgrade.  Black.  8gig.  All new accessories, of course.</p><p>My friend DramaCop talked me down from a iMac 24" ledge last Friday.  My thoughts were focused on my ancillary obsession of developing applications for the iPhone and iPod Touch platforms, and the need to have a larger screen for development.  If you are not a programmer, then you wouldn't understand.  Luckily, he kept me busy just long enough for BestBuy to close.</p><p>Now I have my eyes on an AppleTV and a Time Machine to protect all of those precious episodes of The West Wing I have downloaded from iTunes.  </p><p>I'm not so sure there is an end although I had a break though this week; Mr. Jobs announced a new line of iPods on Tuesday and I walked away from the podcast feeling dull and numb.  No breakthrough product.  No new <a href="http://en.wikipedia.org/wiki/Apple_Newton">Newton</a>.  Some may call it a first step.  I call it a lull.</p>]]></content></entry><entry><title>Displaying a Long List of Values from a Parameter in a Header or Footer</title><category term="MS SQL Server Reporting Services 2005"/><category term="Microsoft SQL Server 2005"/><category term="Programming"/><category term="Work"/><id>http://www.corkchop.com/journal/2008/6/10/displaying-a-long-list-of-values-from-a-parameter-in-a-heade.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2008/6/10/displaying-a-long-list-of-values-from-a-parameter-in-a-heade.html"/><author><name>CorkChop</name></author><published>2008-06-10T23:01:48Z</published><updated>2008-06-10T23:01:48Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Almost&nbsp;two years ago today, I posted a journal entry, <a href="http://www.corkchop.com/journal/2006/6/12/listing-all-values-from-a-mult-value-parameter-in-a-header-or-footer.html">Listing All Values from a Multi-value Parameter in a Header or Footer</a>, which detailed how to use the JOIN function to list out all of the items that a user had selected so that when the report was printed or exported,&nbsp;they would know which values had been selected.</p><p>I recently had a situation where the users of my application were selecting all of the items in the list, filling up and overflowing the footer section of the report, producing an on-screen error.</p><p>You can prevent this by creating a custom expression in the textbox that contains the list of values that the user has selected. </p><blockquote class="code"><p>=IIF(Parameters!EE.Count = Count(Fields!expEleCd.Value, &quot;All Expense Elements&quot;), &quot;All&quot;, IIF(Join(Parameters!EE.Value, &quot;, &quot;).Length &gt; 60, LEFT(Join(Parameters!EE.Value, &quot;, &quot;), 60) &amp; &quot;...&quot; , Join(Parameters!EE.Value, &quot;, &quot;)))</p></blockquote><p>The expression uses nested immediate IF&nbsp;functions (IIF)&nbsp;and the COUNT function to compare the number of available values to the number of values actually selected. </p><p>If the user selected all of the available values of the parameter, then &quot;All Expense Elements&quot; is returned. </p><p>If not, then the second immediate&nbsp;IF checks to see if the string of values created by the JOIN function is longer than sixty characters.&nbsp; If true, then the list is shortened and an ellipsis (&hellip;) is appended to the end of the string.&nbsp; If&nbsp;it isn't&nbsp;longer than sixty characters, it returns the values that the user selected separated by commas. </p>]]></content></entry><entry><title>The Apple iPhone Legitimized the Blackberry</title><category term="Apple"/><category term="Blackberry"/><category term="Work"/><category term="iPhone"/><id>http://www.corkchop.com/journal/2008/4/22/the-apple-iphone-legitimized-the-blackberry.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2008/4/22/the-apple-iphone-legitimized-the-blackberry.html"/><author><name>CorkChop</name></author><published>2008-04-22T17:57:30Z</published><updated>2008-04-22T17:57:30Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Apple announced weeks ago that the iPhone, a revolutionary new cellular phone platform, would be taking corporate users seriously and integrating the missing pieces into the upcoming release of the new operating system version 2.0.</p><p>While Exchange email/contacts/tasks/note synchronization, remote management and security is, in fact, a big deal and has made the Blackberry ubiquitous in the enterprise, the iPhone has a long way to go to become an enterprise tool in traditional corporate America. While cutting edge firms like technically savvy upstarts, media, marketing and places where only the hip survive it will thrive, the iPhone with its sleek design and obviously placed logo carries a stigma which attaches itself to the behavior of the owner.</p><p>I myself have experienced it. </p><p>I personally own an iPhone for personal use and a Blackberry for work; not really by choice. It doesn't matter who or where but use a Blackberry and everyone knows you are moving mountains, making deals, putting out fires and perhaps, firing someone. You shouldn't be disturbed because you are <em>working</em>. </p><p>Get in a meeting and play with your Blackberry and you are a mover and a shaker and the fact that you are not paying attention is condoned because &quot;he's on his Blackberry&quot;. Produce an iPhone and everyone immediately assumes you couldn't possibly be working on anything productive and &quot;he played through the meeting on his phone&quot;.</p><p>These comments used to be reserved for the Blackberry users but with the addition of the iPhone to the market, the Blackberry moved from an annoyance to a business tool.</p><p>The Crackberry addiction stigma transference occurred because, just like the Blackberry, they <em>are</em> addictive, but now the iPhone made the Blackberry legitimate.</p>]]></content></entry><entry><title>Error: 18456, Severity: 14, State: 16</title><category term="Microsoft SQL Server 2005"/><id>http://www.corkchop.com/journal/2007/3/28/error-18456-severity-14-state-16.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2007/3/28/error-18456-severity-14-state-16.html"/><author><name>CorkChop</name></author><published>2007-03-28T23:08:19Z</published><updated>2007-03-28T23:08:19Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Microsoft SQL Server 2005 has been reporting an error for about three weeks.&nbsp; I would have never noticed it but this afternoon Reporting Services failed and brought our production system to a halt.&nbsp; Of course now I realize that this was not the source of the problem but if you are like me, any reported failures in the event log should be resolved, at least, explained.</p><p>The Application Event Log reported this error:</p><blockquote class="code"><p>Source:&nbsp; MSSQLSERVER<br />Category:&nbsp; (4)<br />Event ID:&nbsp; 18456<br />Type: Failure Audit<br />User:&nbsp; domain\user</p><p>Description:&nbsp; Login failed for user 'domain\user'. [CLIENT: &lt;local machine&gt;]</p><p>0000: 18 48 00 00 0e 00 00 00&nbsp;&nbsp; .H......<br />0008: 07 00 00 00 42 00 4c 00&nbsp;&nbsp; ....B.L.<br />0010: 41 00 44 00 45 00 32 00&nbsp;&nbsp; A.D.E.2.<br />0018: 00 00 07 00 00 00 6d 00&nbsp;&nbsp; ......m.<br />0020: 61 00 73 00 74 00 65 00&nbsp;&nbsp; a.s.t.e.<br />0028: 72 00 00 00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r...&nbsp;&nbsp;&nbsp; <br /></p></blockquote><p>The data portion of the event properties reveals that the user account was attempting to use the <em>master</em> database.&nbsp; Using the Log File Viewer for SQL Server, I noticed the following entry:</p><blockquote class="code"><p>Date&nbsp;&nbsp;3/28/2007 5:28:00 PM<br />Log&nbsp;&nbsp;SQL Server (Current - 3/28/2007 6:01:00 PM)</p><p>Source&nbsp;&nbsp;Logon</p><p>Message<br />Error: 18456, Severity: 14, State: 16.</p></blockquote><p>I was stumped because 'domain\user', which is a domain service account has the sysadmin role for SQL Server.&nbsp; I searched on Google and could not find a solution.&nbsp; By accident, I clicked on the SQL Agent Log and found two entries:</p><blockquote class="code"><p>[298] SQLServer Error: 18456, Login failed for user 'domain\user'. [SQLSTATE 28000]</p><p>[298] SQLServer Error: 4060, Cannot open database &quot;ASPState&quot; requested by the login. The login failed. [SQLSTATE 42000]<br /></p></blockquote><p>Then it occurred to me that when I recently moved my ASP.net out-of-process state server from this server to a high-availability cluster server, I took the database offline to make sure that all references to it had been changed.&nbsp; Apparently SQL Agent is responsible for ASPState cleanup and the entries to perform the clean up reside in the <em>master</em> database.&nbsp; The Agent could not gain access to the database because it was offline so it&nbsp;reported the error.</p><p>For those of you that have installed an ASP.net application or state server in SQL Server, you will have to use the aspnet_regsql tool to remove it.&nbsp; Manually deleting the databases or taking them offline will produce these errors.</p>]]></content></entry><entry><title>The Choose Function</title><category term="MS SQL Server Reporting Services 2005"/><category term="Programming"/><id>http://www.corkchop.com/journal/2006/10/18/the-choose-function.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/10/18/the-choose-function.html"/><author><name>CorkChop</name></author><published>2006-10-18T22:06:32Z</published><updated>2006-10-18T22:06:32Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I recently hit a wall when I needed to display one of three fields in a textbox based on a parameter value.  Of course, I could write custom code and write a function to use the SELECT CASE function but it seemed over kill and unmanageable for my simple options.  What would seem trivial in the .net languages suddenly seemed difficult in reporting services.</p><p>Where the immediate IF function IIF allows a condition and two paths of execution, what if you needed the functionality of a SELECT CASE with<em> n</em> branches of execution?</p><p>The Choose() function allows multiple conditional statements.  In this scenario, I had a drop-down list of All, Labor and Non-labor.  When the user selected All, I wanted to use the AllExecution column in my table but if they selected Labor or Non-labor, then I wanted to use the LaborExecution and NonLaborExecution columns instead.</p><p>The syntax for these options was pretty straight forward:</p><blockquote class="code">=Choose(Index as Double, Choice as Object, ...) </blockquote><p>So the expression for my textbox in my table was:</p><blockquote class="code">=Choose(Parameters!LaborType.Value, Fields!Amt.Value, Fields!laborAmt.Value, Fields!nonLaborAmt.Value) </blockquote><h3>A word of caution</h3><p>The Choose() function is not zero-based (like every other index in the .net framework).  Therefore, my values for the drop-down list had to be 1, 2 and 3 instead of 0, 1 and 2.</p>]]></content></entry><entry><title>Assigning Multiple Query Parameters to One Report Parameter</title><category term="MS SQL Server Reporting Services 2005"/><category term="Programming"/><id>http://www.corkchop.com/journal/2006/6/29/assigning-multiple-query-parameters-to-one-report-parameter.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/6/29/assigning-multiple-query-parameters-to-one-report-parameter.html"/><author><name>CorkChop</name></author><published>2006-06-29T18:33:21Z</published><updated>2006-06-29T18:33:21Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>A fellow developer hit a wall today when creating a report based on a stored procedure that was being used in our previous version of our software.&nbsp; We are migrating all of our existing Crystal Reports to Microsoft SQL Server 2005 Reporting Services which means we can reutilize the stored procedures we created years ago.</p><p>The stored procedure calls for two, one character parameters, Function and Sub-function.&nbsp; The combination of these two parameters is what the user refers to as the Special Interest Code, but the database considers them two distinctly different fields.&nbsp; </p><p>The user would not know that for Utilities they would enter Function <em>U</em> and Sub-function <em>T</em>.&nbsp; They are expecting a field called Special Interest Code or <em>SIC</em> where they would enter <em>UT</em>.</p><p>The stored procedure might look like this:</p><blockquote class="code">ALTER PROCEDURE spName<br />&nbsp; @function char(1),<br />&nbsp; @subFunction char(1)<br />AS<br />&nbsp; SELECT columnX, columnY, columnZ<br />&nbsp; FROM table<br />&nbsp; WHERE function = @function AND subFunction = @subFunction </blockquote><p>We can not modify the stored procedure because it is currently in production.&nbsp; We could create a new stored procedure which concatenated the query parameters or we could remap the query parameters to report parameters.&nbsp; To keep the database as clean as possible, we chose the last option.</p><p>When you create a dataset in Report Designer and identify a stored procedure as the source of the dataset, the application automatically creates a report parameter for every query parameter.&nbsp; </p><blockquote class="mod">For example, the query parameter&nbsp;<em>@function</em> would have a report parameter '<em>=Parameters!function.Value</em>'. </blockquote><span class="thumbnail-image-float-right"><a href="http://www.corkchop.com/display/ShowImage?imageUrl=%2Fstorage%2Fjournal%2Fblog%2Fdatasetproperties.gif&imageTitle=236778-378801-thumbnail.jpg" onclick="window.open(this.href, '_blank', 'width=464,height=384,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no'); return false;"><img style="width: 150px; height: 124px" alt="236778-378801-thumbnail.jpg" src="http://www.corkchop.com/storage/thumbnails/236778-378801-thumbnail.jpg" /></a><br /><div style="text-align: right" align="right"><span class="thumbnail-caption" style="width: 150px"><p style="text-align: center" align="center">Dataset Properties (Click to Enlarge)</p></span></div></span>To edit these mappings between report parameters and query parameters, under the <em>Dataset</em> tab, select the '...' next to the dataset drop down list, then select the <em>Parameters</em> tab.&nbsp; In my example, I have created a new report parameter called <em>sic</em> and&nbsp;used the <em>Left</em> and <em>Right</em> functions to select the first&nbsp;character for <em>Function</em> and the second&nbsp;character for <em>Sub-function</em>. <p>&nbsp;</p><p>Of course the report still has <em>Function</em> and <em>Sub-function</em> as a parameter and doesn't really know what <em>sic</em> is.&nbsp; To complete the process&nbsp;open the <em>Report Parameters</em> dialog window and&nbsp;remove <em>Function</em> and <em>subFunction</em> from the parameter list, add sic and give it a <em>Prompt:</em> value of Special Interest Code.</p><p>Now, instead of the user getting prompted for two parameters, <em>Function</em> and <em>Sub-function</em>, they get prompted for something they understand, Special Interest Code.&nbsp;&nbsp;</p><p>And we didn't have to modify or create a new stored procedure.</p>]]></content></entry><entry><title>Visual Dialer for the PocketPC Phone</title><category term="PocketPC"/><category term="Programming"/><category term="Windows Mobile 5.0 Development"/><category term="XV6700"/><id>http://www.corkchop.com/journal/2006/6/27/visual-dialer-for-the-pocketpc-phone.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/6/27/visual-dialer-for-the-pocketpc-phone.html"/><author><name>CorkChop</name></author><published>2006-06-27T19:09:00Z</published><updated>2006-06-27T19:09:00Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>First, I should say that I love my new 6700.&nbsp; A buddy called a little while ago and asked if he should get a new Treo 700w again or the XV6700 because his 700w is currently having issues with the microphone, sometimes no one can hear him.&nbsp; Both phones have their pros and cons, I personally didn't like the keyboard or the smaller screen on the Treo 700w but he loved the speed dialing feature on the Today screen and actual buttons to dial a number.</p><p>This is of course my only complaint with the 6700,&nbsp;you can not dial a number without the pen or sliding out the keyboard.&nbsp; The toggle button doesn't work on the dialer so one&nbsp;thumb operation is impossible.&nbsp; Clicking Contacts then scrolling through the list would be straight forward <em>if</em> you could use the toggle to get to the alphabet groups at the top of the list, but you can't.&nbsp; I've since learned that this isn't a problem with the XV6700 but actually part of the Windows Mobile 5.0 implementation of <em>Contacts</em> and <em>Dialer</em>.&nbsp; Unless your OEM installs a dialer, you are in the same boat as the rest of us.</p><p>I may have&nbsp;four people I call routinely which means I have to turn the power on, scroll to the last name, click the person, and select a number to dial.&nbsp; These&nbsp;frequently dialed people have names in the&nbsp;middle of my contact list so&nbsp;either way I scroll, I am going through a long list.&nbsp; </p><p>I'm a visual person which means I identify with pictures better than text.&nbsp; One really nice feature on these new phones is the is image synchronization with Outlook.&nbsp; Drop a 120X160 image onto a contact (or take a picture of the contact with the phone camera)&nbsp;and when you synchronize with your phone, you see an image of the person you are calling.&nbsp; The picture even appears when they call you.</p><p><span class="thumbnail-image-float-right"><a href="http://www.corkchop.com/display/ShowImage?imageUrl=%2Fpicture%2Fvd_details_context.jpg%3FpictureId%3D397613&imageTitle=315100-397613-thumbnail.jpg" onclick="window.open(this.href, '_blank', 'width=320,height=240,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no'); return false;"><img style="width: 150px; height: 113px" alt="315100-397613-thumbnail.jpg" src="http://www.corkchop.com/storage/thumbnails/315100-397613-thumbnail.jpg" /></a><br /><span class="thumbnail-caption" style="width: 150px">Visual Dialer shown in Landscape mode. Tap and hold opens a context menu for easy dialing. </span></span>Visual Dialer is an application that I developed to utilize the contact pictures in Pocket Outlook.&nbsp; The application searches through the your phone contacts by last name and shows the image of each contact along with their first name.&nbsp; Selecting the contact with the toggle button or stylus shows a context menu with phone number options.&nbsp; You can also select a contact using the toggle button then clicking the Call hot key to dial.</p><p><a href="http://www.corkchop.com/display/ShowGallery?moduleId=315100&galleryId=32305">Image Gallery</a></p><p>Just like <a href="http://www.corkchop.com/journal/2006/6/21/weathercork.html">WeatherCork</a>, my weather forecast program, this application is free and offered as is.&nbsp; It was developed for any Windows Mobile 5.0 device but has been specifically developed and tested on the Verizon XV6700.&nbsp; </p><p>To run Visual Dialer on your PocketPC Phone, follow these steps:</p><ol><li><div><a href="http://www.corkchop.com/storage/applications/visualdialer/visualdialer.zip">download the zip</a> file to your computer</div></li><li><div>extract <em>VisualDialer.CAB</em> to a folder</div></li><li><div>cradle your device</div></li><li><div>double click&nbsp;your device from <em>My Computer</em> and copy <em>VisualDialer.CAB</em> to your device</div></li><li><div>on your device, locate <em>VisualDialer.CAB</em> in <em>My Documents</em> and select it</div></li><li><div>follow the instructions for installing the application</div></li></ol><p>If you do not already have the Microsoft Compact Framework 2.0&nbsp;installed on your device, you will need to <a class="offsite-link-inline" href="http://www.microsoft.com/downloads/details.aspx?familyid=9655156B-356B-4A2C-857C-E62F50AE9A55&displaylang=en" target="new">download and install it</a> for Visual Dialer to run.</p><p>Feedback, comments and questions&nbsp;are welcome!</p>]]></content></entry><entry><title>Displaying Images from a URL in a Windows Mobile 5.0 Control</title><category term="PocketPC"/><category term="Programming"/><category term="Windows Mobile 5.0 Development"/><id>http://www.corkchop.com/journal/2006/6/23/displaying-images-from-a-url-in-a-windows-mobile-50-control.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/6/23/displaying-images-from-a-url-in-a-windows-mobile-50-control.html"/><author><name>CorkChop</name></author><published>2006-06-23T22:14:16Z</published><updated>2006-06-23T22:14:16Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I've been getting some feedback from developers on the WeatherCork application.&nbsp; Specifically, how the application&nbsp;displays the images without saving them to the file system, which someone took time to scour&nbsp;through the file system on his device looking for them.</p><p>When&nbsp;I first started developing&nbsp;the application, my instinct was to get the image from the URL, save it to the file system, then load the&nbsp;PictureBox controls with the corresponding image.&nbsp; Sort of like the Temporary Internet Files for Internet Explorer, the application would check to see if the file already existed and if not, would download the file to the application directory.</p><p>The application itself only takes up 27kb of space but after a week of testing the application on my device, I noticed that the cache I had developed in the application folder contained over 140kb of JPG images!&nbsp; Of course, I could provide a way for the user to delete the cached files, but after a couple of days, the varied images would return taking up precious RAM.</p><p>Beta Two of WeatherCork utilized a method for deleting the files when the application closed while Beta Three deleted the files when the application started but considering users may go for months without resetting or closing the application, the problem still existed.</p><p>One of the reasons I chose the cache image method was speed.&nbsp; In a desktop application, such as Internet Explorer, the benefits&nbsp;would be&nbsp;noticeable.&nbsp; A check is made to see if the file exists and if it has not been changed since the last time saved, then there is no need for a browser to reload it.&nbsp; This speeds up the experience and on a dial-up connection, this could be significant.</p><p>With mobile devices however, memory is more precious than speed.&nbsp; I wouldn't think twice about having an Internet cache on my desktop that contained a gigabyte of files but on my mobile device with limited RAM I would.</p><p>With the final release of WeatherCork, I chose to abandon the file cache and dynamically load the images into an ImageList control.&nbsp; Although the load is a little slower, the application at runtime only occupies approximately 50kb of space.</p><p>To load the images, I wrote a custom function that retrieved the image from a URL then created a bitmap suitable for a control like an ImageList or a PictureBox.</p><blockquote class="code">&nbsp;&nbsp;&nbsp; Function GetDailyImage(ByVal ImageUrl As String) As Bitmap<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Try<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Request As HttpWebRequest = CType(WebRequest.Create(ImageUrl), HttpWebRequest)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Request.Method = &quot;GET&quot; <p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim ResponseStream As Stream = Response.GetResponseStream()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Writer As MemoryStream = New MemoryStream<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Buffer() As Byte = New Byte(4096) {}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim BytesRead As Integer = ResponseStream.Read(Buffer, 0, Buffer.Length)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; While BytesRead &gt; 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writer.Write(Buffer, 0, BytesRead)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BytesRead = ResponseStream.Read(Buffer, 0, Buffer.Length)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End While</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim DailyImage As New Bitmap(Writer)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResponseStream.Close()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writer.Close()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return DailyImage<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Catch ex As Exception<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return (New Bitmap(55, 58))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Try<br />&nbsp;&nbsp;&nbsp; End Function </p></blockquote><p>Once the bitmap was generated in memory, it is&nbsp;added it to the ImageList.</p><blockquote class="code">ImageList1.Images.Add(GetDailyImage(Daily(i).WeatherImage)) <br />ForecastItem.ImageIndex = i </blockquote><p>Testing showed that the file cache versions averaged a two second&nbsp;benefit in speed.&nbsp; Although the release version is slower to load, the application, device and user benefits from a smaller footprint and does not require additional code to clean up the cache files.</p><p>Since publishing the source code to WeatherCork, I have realized that additional memory could be conserved.&nbsp; Instead of loading all seven images, one for each day, I could&nbsp;point the ListView.ImageIndex property to different images.&nbsp; </p><p>For instance, it is possible in some&nbsp;areas like San Diego to have clear, sunny skies all week.&nbsp; The&nbsp;reference to the seven&nbsp;forecast images would all be the same so only one image would have to be loaded into the ImageList control.&nbsp; Each forecast in the ListView control would have an ImageIndex&nbsp;pointing to that one image.&nbsp;</p>]]></content></entry><entry><title>WeatherCork</title><category term="PocketPC"/><category term="Programming"/><category term="Windows Mobile 5.0 Development"/><category term="XV6700"/><id>http://www.corkchop.com/journal/2006/6/21/weathercork.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/6/21/weathercork.html"/><author><name>CorkChop</name></author><published>2006-06-21T20:22:32Z</published><updated>2006-06-21T20:22:32Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p><span class="thumbnail-image-float-right"><a href="http://www.corkchop.com/display/ShowImage?imageUrl=%2Fstorage%2Fweathercork_list.jpg&imageTitle=236778-371103-thumbnail.jpg" onclick="window.open(this.href, '_blank', 'width=240,height=320,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no'); return false;"><img style="width: 160px; height: 213px" alt="236778-371103-thumbnail.jpg" src="http://www.corkchop.com/storage/thumbnails/236778-371103-thumbnail.jpg" /></a><br /><span class="thumbnail-caption" style="width: 160px">WeatherCork Details View in Portrait Mode</span></span>I recently&nbsp;completed development of&nbsp;a simple Windows Mobile 5.0 application targeted for the PocketPC Phone that will display a weekly weather forecast by&nbsp;zip code.&nbsp; The application uses a free, publicly accessible web service to produce daily high and low temperatures as well as displaying an image of the current/expected&nbsp;weather conditions.</p><p>A user enters in a valid five-digit zip code and clicks or selects the <em>Refresh</em> (left) hot key.&nbsp; A connection is made to the web service and displays the forecast in a details view.&nbsp; Selecting the&nbsp;right hot key will change the view to List/Details mode.</p><p><a href="http://www.corkchop.com/display/ShowGallery?moduleId=315100&galleryId=31828">Image Gallery</a></p><p>The application should work on any&nbsp;Windows Mobile 5.0 PocketPC device&nbsp;but&nbsp;has been specifically tested for the <a class="offsite-link-inline" href="http://www.utstar.com/pcd/view_phone_details.aspx?mcode=PPC6700&bID=30&sAct=0" target="new">UTStarcom 6700 PocketPC Phone</a> (Verizon XV6700, Sprint PPC-6700) and supports both&nbsp;portrait and landscape modes.</p><p>The application is free for download <em>and is offered as is</em>.&nbsp; To run the application on your PocketPC device:</p><ol><li><div><a href="http://www.corkchop.com/storage/applications/weathercork/weathercork%20installation.zip">download the ZIP file</a>&nbsp;(13kb)&nbsp;and unzip&nbsp;it to a local folder on your desktop computer</div></li><li><div>connect your device to your desktop using ActiveSync</div></li><li><div>copy the&nbsp;unzipped file (<em>WeatherCork.CAB</em>) to a folder on your device using Explorer</div></li><li><div>using File Explorer on your device, navigate and select <em>WeatherCork.CAB</em> to install</div></li><li><div>after installation is complete, delete <em>WeatherCork.CAB</em> from your device</div></li></ol><p>WeatherCork requires the Compact Framework 2.0.&nbsp; If you do not already have the framework installed, you can <a class="offsite-link-inline" href="http://www.microsoft.com/downloads/details.aspx?familyid=9655156B-356B-4A2C-857C-E62F50AE9A55&displaylang=en" target="new">download and install</a> it, free from Microsoft.</p><p>Developers&nbsp;who would like to extend or&nbsp;modify the application can <a href="http://www.corkchop.com/storage/applications/weathercork/weathercork%20source%20code.zip">download the project files</a> (184kb).</p><p>Feedback and comments are welcome.&nbsp; Enjoy!</p>]]></content></entry><entry><title>Passing Multi-value Parameters in a Drill-Through Report</title><category term="MS SQL Server Reporting Services 2005"/><id>http://www.corkchop.com/journal/2006/6/12/passing-multi-value-parameters-in-a-drill-through-report.html</id><link rel="alternate" type="text/html" href="http://www.corkchop.com/journal/2006/6/12/passing-multi-value-parameters-in-a-drill-through-report.html"/><author><name>CorkChop</name></author><published>2006-06-12T21:41:48Z</published><updated>2006-06-12T21:41:48Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p><strong>Question from a reader:</strong></p><p>When I create a drill-through report in Reporting Services that contains a multi-value parameter, only the first value selected gets passed to the next report.&nbsp; How can I get all of the values selected in a multi-value parameter passed to the next report?</p><p><strong><span class="thumbnail-image-float-right"><a href="http://www.corkchop.com/display/ShowImage?imageUrl=%2Fstorage%2Fjournal%2Fblog%2Fparameter1.gif&imageTitle=236778-362518-thumbnail.jpg" onclick="window.open(this.href, '_blank', 'width=424,height=320,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no'); return false;"><img style="width: 150px; height: 113px" alt="236778-362518-thumbnail.jpg" src="http://www.corkchop.com/storage/thumbnails/236778-362518-thumbnail.jpg" /></a><br /><span class="thumbnail-caption" style="width: 150px">Fig. 1</span></span>Answer:</strong></p><p>In the <em>Parameters</em> dialog of the <em>Textbox Properties/Navigation</em> tab, the default action for Visual Studio is to reference the first value of a one-dimensional array (Fig. 1).&nbsp; When selecting a parameter under the <em>Parameter Value</em> column, make sure you remove the reference to the index of the array by removing the <em>(0)</em> at the end of the expression.</p><blockquote class="code">=Parameters!apnSym.Value(0) </blockquote><p>Should be edited to remove the reference to an index:</p><blockquote class="code">=Parameters!apnSym.Value </blockquote>]]></content></entry></feed>