<feed version="0.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://purl.org/atom/ns#" xml:lang="en-US"><title>David Truxall</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/default.aspx" /><tagline type="text/html">Adrift in .Net</tagline><id>http://www.dotnetjunkies.com/WebLog/davetrux/default.aspx</id><author><url>http://www.dotnetjunkies.com/WebLog/davetrux/default.aspx</url></author><generator url="http://communityserver.org" version="1.0.1.50214">Community Server</generator><modified>2007-10-08T09:28:00Z</modified><entry><title>Snipping Tool - A Vista Enhancement for Developers</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/08/07/497738.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:497738</id><created>2008-08-07T11:06:07Z</created><content type="text/html" mode="escaped">&lt;p&gt;Saw a great post about the Snipping tool in Vista: &lt;a href="http://blogs.technet.com/danwoodman/archive/2008/08/04/why-vista-volume-4-snipping-tool.aspx"&gt;The Blog at the End of the Universe : Why Vista? (Volume 4 -- Snipping Tool)&lt;/a&gt;. For an old-time Alt+Print Screen guy, this thing is great. But the first time I looked for it, it wasn't there (I'm using Vista Business). I guess by default it isn't always installed, but it is available, there is an &lt;a href="http://www.pcworld.com/article/137099/activate_vistas_snipping_tool.html#"&gt;article describing how to activate the Snipping Tool&lt;/a&gt; at &lt;a href="http://www.pcworld.com/"&gt;PCWorld&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=497738" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=497738</wfw:commentRss></entry><entry><title>A Cool IE HTML/CSS Trick - Conditional Comments</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/08/06/497219.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:497219</id><created>2008-08-06T15:50:27Z</created><content type="text/html" mode="escaped">&lt;p&gt;I am continually humbled by the amount of stuff I don't know in the areas where I generally feel good about my level of knowledge....&lt;/p&gt; &lt;p&gt;Today I learned about conditional comments. This is an IE specific trick, but in my case I'm trying to have different CSS for a certain class so it behaves properly in IE6 and standards compliant browsers. The problem is using .png files that have transparency. IE6 totally botches .png files. But it turns out there is an IE-specific filter (progid:DXImageTransform) that causes IE6 to render a .png properly. An &lt;a href="http://www.alistapart.com/articles/cssdrop2"&gt;older article&lt;/a&gt; at &lt;a href="http://www.alistapart.com/"&gt;A List Apart&lt;/a&gt; describes how to use it, along with conditional comments.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms537512.aspx"&gt;Conditional comments&lt;/a&gt; allow IE to display the content between the comments based on an expression. In this case, the expression is testing for the browser version:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;!--[if IE 6]&amp;gt;&lt;br&gt;&amp;lt;link  rel="stylesheet"
type="text/css"
  href="ie6.css"
/&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; 
&lt;p&gt;So this code snipped would cause IE 6 to load this custom stylesheet. IE7 interprets the comment correctly and doesn't load the stylesheet. Other browsers interpret this as a comment and ignore it. Very nice.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=497219" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=497219</wfw:commentRss></entry><entry><title>Developer Productivity Part 1 - Soft Skills</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/07/30/ProductivityPartOne.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:493165</id><created>2008-07-30T10:13:48Z</created><content type="text/html" mode="escaped">&lt;p&gt;&lt;/p&gt; &lt;p&gt;As developers, we struggle daily to be the most productive in our craft. Sometimes interruptions and counter-productive days are unavoidable, but there are number of things we can control to become more productive. These include how we behave, what we do with our work environment, and how we use the tools available to us. This article focuses on the soft skills you can develop to become more productive.&lt;/p&gt; &lt;h2&gt;Behavior&lt;/h2&gt; &lt;h3&gt;Flow or “In the Zone”&lt;/h3&gt; &lt;p&gt;As developers, I am sure we have all experienced flow, or being “in the zone”. You really dig in to your task, time passes quickly, and you just knock out code left and right. &lt;a href="http://www.joelonsoftware.com/articles/fog0000000068.html"&gt;This effect&lt;/a&gt; is a pretty &lt;a href="http://www.devx.com/DevX/Article/11659"&gt;well documented&lt;/a&gt;, and as you probably experienced, it is sometimes hard to get the right momentum going. Often it takes about 15 minutes for a developer to get into the flow, but it only takes a short interruption to lose it. As a developer, you need to do your best to encourage flow. This means minimizing distractions. Be busy or away on your IM, don’t answer it. Turn off your Outlook notifications of incoming emails. Email is not a time-sensitive medium, treat it that way.  &lt;p&gt;One of the best ways to keep your flow effective is to take a break when the flow breaks. You can’t be totally effective and in the flow all the time. Take time to recharge. The flow can’t continue endlessly. When you are not being productive in the flow, take a break.  &lt;h4&gt;Focus on the Task: Task Lists and Goals&lt;/h4&gt; &lt;p&gt;Keeping focused on the task you are working on also encourages flow. Task switching is an &lt;a href="http://www.joelonsoftware.com/articles/fog0000000022.html"&gt;expensive activity; it interrupts the flow&lt;/a&gt;. Set aside time to respond to emails and IM’s.  &lt;p&gt;To help keep yourself on task, create task lists for the activities you need to accomplish each day. This is one of the productivity benefits of Agile/Scrum practices, it allows the team to set a daily goal, &lt;a href="http://weblogs.asp.net/erobillard/archive/2005/07/20/420022.aspx"&gt;minimizing task switching&lt;/a&gt;. Organize your time to work on those tasks. Being organized helps minimize task switching and last minute tasks that slipped through the cracks while you were busy keeping the flow going.  &lt;h3&gt;Learning&lt;/h3&gt; &lt;p&gt;Few things you can do to increase your productivity have more effect than learning. Knowing the right patterns and concepts up front directly impacts your coding productivity. An &lt;a href="http://scientificamerican.com/article.cfm?articleID=00010347-101C-14C1-8F9E83414B7F4945"&gt;article published in Scientific American&lt;/a&gt; postulates that experts are made, not born. The article determined that expertise allowed chess masters to easily recognize complex patterns, and find effective solutions in much shorter times than non-masters. This was not due to better analysis skills, but resulted from a larger store of structured knowledge. Experts simply get the job done more efficiently. Additionally, motivation was found to be more important than innate ability when developing expertise. Being better at what you do is simply a matter of putting in the required time to reach the level of expertise you need.&lt;/p&gt; &lt;p&gt;When I am interviewing potential new developers for my firm, one question I often ask is “Do you have a server in your home?” For me this is an indicator of someone who has the motivation to become an expert, they are exploring technology on their own. Obviously not everyone can be a giant in the industry, but the only person holding you back is reading this article. Become an expert, if even in a small space, and increase your productivity.&lt;/p&gt; &lt;h2&gt;Environment&lt;/h2&gt; &lt;p&gt;Obviously, environment affects your ability to get into the flow and stay there. For many of us, noise is a major flow killer. We usually have little control over our direct environment, such as having an office or a cube. But there are actions we can take to make our environment more effective at certain times.  &lt;h3&gt;Distraction and Noise &lt;/h3&gt; &lt;p&gt;If you have an office door, close it. This is one of the best ways to minimize distraction. If anyone is able to walk up to you and ask a question, they will. Obviously not all interruptions are bad or unnecessary. In order to encourage flow, time needs to be set aside specifically for flow-oriented tasks. Make it clear to others that you are busy, but also make it clear when you will be available again. Take the opportunity to ask to put off a request until you are free.  &lt;p&gt;Set your phone to forward to voice mail, set your cell phone to silent. Set aside time later in the day to answer messages.  &lt;p&gt;If you use an Instant Messenger (IM), make frequent use of the status feature. Others will notice that you do, and will understand that “busy” or “do not disturb” mean just that. Use your email client to schedule work time as appointments. This way you do not look “free” on your calendar or corporate IM.  &lt;p&gt;If you don’t have a door, take advantage of rooms that do have one. Schedule a conference room for yourself for a time when you need to be busy; take your laptop, close the door. This both reduces noise and minimizes distractions, since you are not at your normal location.  &lt;p&gt;Of course headphones are boon to those of us that don’t have a door. Typically, a cube or open environment has conversations going on around you. If you can’t hear them, you are less likely to get pulled into them.  &lt;h3&gt;Colleagues&lt;/h3&gt; &lt;p&gt;Choosing to work with a strong team will increase your productivity. A strong team environment promotes learning, which in turn improves your productivity. Colleagues or mentors who are more experienced can also enable your own learning and efficiency. Seek them out and learn from them. If you don't have them at work, find them somewhere else. Look at all the folks blogging, experts abound and they are obvious. Contact them, build a relationship if you can. User groups or developer events, like those put on by Microsoft, or Geek dinners, are another good place to find experts and colleagues.  &lt;p&gt;Next up Part 2: How you can use technology to help you be a more productive developer.  &lt;h2&gt;Resources&lt;/h2&gt; &lt;p&gt;&lt;a href="http://scientificamerican.com/article.cfm?articleID=00010347-101C-14C1-8F9E83414B7F4945"&gt;The Expert Mind&lt;/a&gt;  &lt;p&gt;&lt;a href="http://lifehacker.com/software/interruption-management/"&gt;Life Hacker: Interruptions&lt;/a&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/erobillard/archive/2005/07/20/420022.aspx"&gt;Task Switching&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=493165" width="1" height="1"&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=493165</wfw:commentRss></entry><entry><title>MCMS and TFS</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/07/07/484509.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:484509</id><created>2008-07-07T17:02:41Z</created><content type="text/html" mode="escaped">&lt;p&gt;Microsoft Content Management Server (MCMS) and Team Foundation Server (TFS) in Visual Studio 2005 don't play nice together. Since MCMS is a dead-end product, I don't expect there will be an actual fix.&lt;/p&gt; &lt;p&gt;&lt;a href="http://support.microsoft.com/default.aspx?id=919913"&gt;The KB Article fix&lt;/a&gt; (sort of).&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.technet.com/stefan_gossner/archive/2006/06/14/how-to-get-mcms-2002-sp2-vs-net-2005-and-team-foundation-server-working-together.aspx"&gt;Stefan's workaround&lt;/a&gt;. Essentially you need to use them separately, TFS with Visual Studio and a standalone version of the &lt;a href="http://www.codeplex.com/mcms2002tools"&gt;MCMS Template Explorer&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=484509" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=484509</wfw:commentRss></entry><entry><title>DataSets and Calculated Columns</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/06/10/475011.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:475011</id><created>2008-06-10T11:14:49Z</created><content type="text/html" mode="escaped">&lt;p&gt;Ran into a performance issue in a .Net remoting situation. A Winforms app is calling an application server asking for data. A relatively large DataSet (&amp;gt;10,000 rows, &amp;lt;6 columns) being passed over the wire was causing a performance problem. The database and application servers processed it quickly. Examining the transfer with &lt;a href="http://www.wireshark.org/"&gt;WireShark&lt;/a&gt; showed that the transfer wasn't so bad either. There was a flurry of data passed, and then a bunch of waiting on the client-side, with the client CPU usage around 50% the entire duration of the wait. Turns out there is a calculated column in one of the data tables. The column is not calculated on the application server-side, so as not to pass a bunch of data across the wire that would be unnecessary. The calc happens on the client. That was the source of the slowdown and CPU usage. In the end the solution to the problem was not using the calculated column, we found a different solution to fix the business problem. I suppose you could perform the calculation in the SQL statement that was ultimately filling the DataSet. That might take longer to transfer, but won't slow down the client app.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=475011" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=475011</wfw:commentRss></entry><entry><title>TFS Custom Work Items - Lessons Learned</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/06/05/473850.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:473850</id><created>2008-06-05T11:38:55Z</created><content type="text/html" mode="escaped">&lt;ol&gt; &lt;li&gt;Work on a dummy TFS project that you can delete. Delete the project before you deploy for production. &lt;li&gt;&lt;a href="http://msmvps.com/blogs/vstsblog/archive/2007/07/07/undocumented-attributes-for-controlling-the-work-item-form-layout.aspx"&gt;Not all the attributes for Work Item layout are documented&lt;/a&gt;.   &lt;li&gt;A Work Item Type defined in more than one project is sort of shared between the two. The definition can be different, but the name is shared. So anything you want to change or remove in one has to be done in the other. See item 1.  &lt;li&gt;Work items are not easy to delete. It can only be done through the database. See the &lt;a href="http://dwnz.spaces.live.com/Blog/cns!BCC0973FC7B19D91!393.entry"&gt;SQL statements for doing removing work items&lt;/a&gt;. I found a GUI tool for this, but ultimately it was executing the SQL statements.  &lt;li&gt;Work Item Type fields are not easy to modify. Essentially you have to &lt;a href="http://msdn.microsoft.com/en-us/library/ms404864(VS.80).aspx"&gt;delete it and re-add it&lt;/a&gt;. The basic steps are: &lt;/li&gt; &lt;ol&gt; &lt;li&gt;Remove the field(s) from the Work Item Type XML definition (both field and in the layout)  &lt;li&gt;Re-import the Work Item Type XML so the definition in use no longer contains the field(s)  &lt;li&gt;Delete the fields using the TFS command line tools. This also deletes any data you had stored for existing work items using your custom type.  &lt;li&gt;&lt;a href="http://www.topxml.com/rbnews/WS-web-services/re-93467_TFS-Warehouse-Cube-Processing.aspx"&gt;Re-process the cube using&lt;/a&gt; the TFS web service  &lt;li&gt;Update the Work Item XML with the updates you need &lt;li&gt;Re-import the Work Item Type XML&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Of course, after-the-fact I found a &lt;a href="http://www.slideshare.net/wbarthol/introduction-to-work-item-customisation/"&gt;good overview of the custom Work Item process&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=473850" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=473850</wfw:commentRss></entry><entry><title>ASP.NET 2.0 and Global.asax: What not to do</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/02/06/433008.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:433008</id><created>2008-02-06T08:57:42Z</created><content type="text/html" mode="escaped">&lt;p&gt;I deployed a site today that has some code in the Global.asax event handlers. I let Visual Studio 2008 add the file to my project when I created it, and it put the code directly in the file inside &amp;lt;script runat="server"&amp;gt; tags. I went with it. So when I deployed the file, none of the events fired. Ever. The lesson is: Don't put your code in the global.asax file. Apparently this problem is by design. There is a &lt;a href="http://support.microsoft.com/default.aspx/kb/937095"&gt;vague KB Article on this problem&lt;/a&gt;, but the solutions aren't all that helpful, I didn't want to pre-compile, and the first solution made no sense at all. A little searching and I found one good solution: put a class that inherits &lt;em&gt;HttpApplication&lt;/em&gt; in the App_Code folder as described &lt;a href="http://rossnelson.blogspot.com/2005/11/fixing-globalasax-in-aspnet-20.html"&gt;here&lt;/a&gt;. What I don't understand is why Visual Studio adds the file that way if it isn't going to work on an xcopy deployment. Microsoft seems to go out of their way to protect us from ourselves so often that I am surprised the IDE does something intentionally that won't work.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=433008" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=433008</wfw:commentRss></entry><entry><title>Technical Irony</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/01/25/426169.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:426169</id><created>2008-01-25T11:02:36Z</created><content type="text/html" mode="escaped">&lt;p&gt;While looking for a URL rewriting tool for a client I found a reference to a tool, clicked the link and got a 404 error. &lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=426169" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=426169</wfw:commentRss></entry><entry><title>Defining Project Success</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2008/01/14/418815.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:418815</id><created>2008-01-14T17:11:51Z</created><content type="text/html" mode="escaped">&lt;p&gt;There is an &lt;a href="http://www.ddj.com/article/printableArticle.jhtml?articleID=202800777&amp;amp;dept_url=/architect/"&gt;article in Dr. Dobbs&lt;/a&gt; that describes a &lt;a href="http://www.ambysoft.com/surveys/success2007.html"&gt;survey performed by the author&lt;/a&gt;. The survey was intended to query Project Managers, IT Managers, IT staff and business stakeholders on what defined the success of a project.&lt;/p&gt; &lt;p&gt;There were definitely some interesting findings:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The IT industry has a long way to go to achieve a 100% success rate for projects  &lt;li&gt;Agile projects were more successful than traditional waterfall projects  &lt;li&gt;Off-shored projects were most likely to fail  &lt;li&gt;Respondents rated quality as the most important issue, and rated the importance of following items this way when analyzed as a group:&lt;br&gt;&lt;br&gt;Quality &amp;gt; Scope &amp;gt; Staff Health &amp;gt; Time of Completion &amp;gt; Money&lt;br&gt; &lt;li&gt;Project managers differed significantly from all other groups in their perception of success, rating time and money over quality.  &lt;li&gt;Business stakeholders placed a higher value on ROI and and shipping when ready than the rest of the groups  &lt;li&gt;A majority of respondents in all groups worked on projects they knew would fail from the start, but canceling a troubled project was not viewed as a successful outcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I am not surprised by project managers having a different view, given that they are trained to value on-time and on-budget projects. Someone has to keep an eye on the bottom line, but I have experienced this gap when a project runs into trouble. I have been thinking about the differences between Agile and Waterfall-style projects and how they differ. I think there is some middle ground between the two that is yet to be identified that gives us the benefits of heavier requirements and design and the responsiveness to change.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=418815" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=418815</wfw:commentRss></entry><entry><title>Reporting Services - Page Breaks and PDF Files</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/11/07/356607.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:356607</id><created>2007-11-07T11:13:31Z</created><content type="text/html" mode="escaped">&lt;p&gt;In Reporting Services reports, page breaks occur when the size of the body exceeds the page size. The crux of the lesson I learned&amp;nbsp;is that the size of a sub-report cannot exceed the size of the parent containing it. Funny page breaks occur in the PDF output if this is the case.&lt;/p&gt; &lt;p&gt;Brian Welcker posted &lt;a href="http://blogs.msdn.com/bwelcker/archive/2005/08/19/Alien-Lanes-_2800_Logical-and-Physical-Pagination-Rules_2900_.aspx"&gt;some terrific details on how page breaks work&lt;/a&gt; in Reporting Services, this post is&amp;nbsp;essential if you are creating reports.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=356607" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=356607</wfw:commentRss></entry><entry><title>Building a Basic Excel Document with Open XML</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/11/06/355742.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:355742</id><created>2007-11-06T13:36:05Z</created><content type="text/html" mode="escaped">&lt;p&gt;I recently &lt;a href="http://dotnetjunkies.com/WebLog/davetrux/archive/2007/10/04/328897.aspx"&gt;gave a talk&lt;/a&gt; about &lt;a href="http://openxmldeveloper.org/"&gt;Open XML&lt;/a&gt;, and found that there were not many complete code samples out there which described how to build Office 2007 documents using .Net and SpreadsheetML. Most of the examples I ran into were snippets or functions, or just examples of the SpreadsheetML.&amp;nbsp;As one of my demos, I created a C# class which builds a&amp;nbsp;basic spreadsheet. This post describes that class.&lt;/p&gt;
&lt;p&gt;There are prerequisite installs required to run this code:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;.Net 3.0 Framework (System.IO.Packaging is part of WPF) &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb448854.aspx"&gt;SDK for Open XML Formats&lt;/a&gt;, which is currently a CTP, so the code is subject to change if the object model changes at all with the final release (so therefore does the code in this post). &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d46c01f-e3f6-4069-869d-90b8b096b556&amp;amp;displaylang=en"&gt;Code Snippets&lt;/a&gt; that are available for Open XML. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The class (called &lt;em&gt;Spreadsheet&lt;/em&gt;)&amp;nbsp;does two basic things:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Create a spreadsheet package &lt;/li&gt;
    &lt;li&gt;Insert data into a worksheet in the newly created package &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first step is creating the package, which consists of XML files for the SpreadsheetML and XML files which manage the relationships between those files. In an Open XML spreadsheet, the minimal spreadsheet package requires three documents containing SpreadsheetML:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;A workbook file &lt;/li&gt;
    &lt;li&gt;A worksheet file &lt;/li&gt;
    &lt;li&gt;A relationship file &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Additionally, SpreadsheetML uses a concept called &amp;quot;Shared Strings&amp;quot;. SpreadsheetML dictates storing&amp;nbsp;Shared Strings separately from the worksheet in their own document, so the document stores less data if&amp;nbsp;the document re-uses strings. Strings can also be added to the spreadsheet &amp;quot;in-line&amp;quot; and not used Shared Strings storage. For this example labels are stored as Shared Strings to demonstrate the concept, therefore the spreadsheet package also&amp;nbsp;requires&amp;nbsp;a Shared Strings document.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&amp;amp;displaylang=en"&gt;SDK for Open XML Formats&lt;/a&gt;&amp;nbsp;provides a new component, &lt;em&gt;Microsoft.Office.DocumentFormat.OpenXml.dll&lt;/em&gt;, that wraps some of the functionality of creating an Open XML document with System.IO.Packaging. Essentially it manages creating the files and the relationships between the files in the package. Once you have created the files and relationships, you still need to create code to insert actual data into the documents. This example uses two steps:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Create the basic XML document using a template of existing XML &lt;/li&gt;
    &lt;li&gt;Insert data into the existing XML. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following are the contents of three small&amp;nbsp;XML files created and added to a &lt;em&gt;Templates&lt;/em&gt; directory in the solution. These three files are the basis for the required parts of the package:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The workbook template&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;?&lt;/span&gt;&lt;span&gt;xml&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;1.0&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;encoding&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;UTF-8&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;standalone&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;yes&lt;/span&gt;&amp;quot;&lt;span&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;workbook&lt;/span&gt; &lt;span&gt;&lt;/span&gt;&lt;span&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;http://schemas.openxmlformats.org/spreadsheetml/2006/main&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;xmlns:r&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;http://schemas.openxmlformats.org/officeDocument/2006/relationships&lt;/span&gt;&amp;quot;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;sheets&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;sheet&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;name&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;{1}&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;sheetId&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;1&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;r:id&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;{0}&lt;/span&gt;&amp;quot;&lt;span&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span&gt;sheets&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;workbook&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Notice that the XML contains .Net placeholders. Later on we can replace these with actual values that can vary at run time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The worksheet template&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;?&lt;/span&gt;&lt;span&gt;xml&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;1.0&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;encoding&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;UTF-8&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;standalone&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;yes&lt;/span&gt;&amp;quot;&lt;span&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;worksheet&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;http://schemas.openxmlformats.org/spreadsheetml/2006/main&lt;/span&gt;&amp;quot;&lt;span&gt; &amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;sheetData&lt;/span&gt;&lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;worksheet&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;The shared strings template&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;?&lt;/span&gt;&lt;span&gt;xml&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;1.0&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;encoding&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;UTF-8&lt;/span&gt;&amp;quot;&lt;span&gt; &lt;/span&gt;&lt;span&gt;standalone&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;yes&lt;/span&gt;&amp;quot;&lt;span&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;sst&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&amp;quot;&lt;span&gt;http://schemas.openxmlformats.org/spreadsheetml/2006/main&lt;/span&gt;&amp;quot;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;sst&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;These XML templates make up the basic content of the package. The C# class contains a &lt;em&gt;CreateSpreadSheet&lt;/em&gt; procedure which will create the basic pieces of the package. The main thing to notice is that&amp;nbsp; by creating the part object (workbook, shared strings, worksheet), you are only creating the part file, not the content of that part file. The templates above become the content for the parts. There is no need to manage the relationship files directly, the API is doing that automatically.&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;public&lt;/span&gt; &lt;span&gt;void&lt;/span&gt; CreateSpreadsheet(&lt;span&gt;string&lt;/span&gt; path, &lt;span&gt;string&lt;/span&gt; firstSheetName)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;using&lt;/span&gt; (&lt;span&gt;SpreadsheetDocument&lt;/span&gt; doc = &lt;span&gt;SpreadsheetDocument&lt;/span&gt;.Create(path, &lt;span&gt;SpreadsheetDocumentType&lt;/span&gt;.Workbook))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;//Add the workbook&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;WorkbookPart&lt;/span&gt; workbook = doc.AddWorkbookPart();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;//Create the shared strings part&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;SharedStringTablePart&lt;/span&gt; stringTable = workbook.AddNewPart&amp;lt;&lt;span&gt;SharedStringTablePart&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;this&lt;/span&gt;.AddPartXml(stringTable, &lt;span&gt;this&lt;/span&gt;.ReadXML(&lt;span&gt;@&amp;quot;Templates\SharedStringTemplate.xml&amp;quot;&lt;/span&gt;));&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;//Create a worksheet&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;WorksheetPart&lt;/span&gt; sheet = workbook.AddNewPart&amp;lt;&lt;span&gt;WorksheetPart&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;//Get the relationship id so the workbook and worksheet can be related&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;string&lt;/span&gt; sheetId = workbook.GetIdOfPart(sheet);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;this&lt;/span&gt;.AddPartXml(workbook, &lt;span&gt;this&lt;/span&gt;.WorkbookXml(sheetId, firstSheetName));&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;this&lt;/span&gt;.AddPartXml(sheet, &lt;span&gt;this&lt;/span&gt;.ReadXML(&lt;span&gt;@&amp;quot;Templates\WorkSheetTemplate.xml&amp;quot;&lt;/span&gt;));&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; doc.Close();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The only interesting part is retrieving the ID of the worksheet part when building the workbook part. To create the content of each part the procedure opens an XML file and streams the content into the file. There are helper functions for this, which are really just standard ways of handling XML in .Net:&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;protected &lt;/span&gt;&lt;span&gt;void&lt;/span&gt; AddPartXml(&lt;span&gt;OpenXmlPart&lt;/span&gt; part, &lt;span&gt;string&lt;/span&gt; xml)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;using&lt;/span&gt; (&lt;span&gt;Stream&lt;/span&gt; stream = part.GetStream())&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;byte&lt;/span&gt;[] buffer = (&lt;span&gt;new&lt;/span&gt; &lt;span&gt;UTF8Encoding&lt;/span&gt;()).GetBytes(xml);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Write(buffer, 0, buffer.Length);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;protected &lt;/span&gt;&lt;span&gt;string&lt;/span&gt; ReadXML(&lt;span&gt;string&lt;/span&gt; fileName)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;StreamReader&lt;/span&gt; reader = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;StreamReader&lt;/span&gt;(&lt;span&gt;Environment&lt;/span&gt;.CurrentDirectory + &lt;span&gt;@&amp;quot;\&amp;quot;&lt;/span&gt; + fileName);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;string&lt;/span&gt; contents = reader.ReadToEnd();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;return&lt;/span&gt; contents;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span&gt;protected &lt;/span&gt;&lt;span&gt;string&lt;/span&gt; WorkbookXml(&lt;span&gt;string&lt;/span&gt; sheetId, &lt;span&gt;string&lt;/span&gt; sheetName)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;string&lt;/span&gt; contents = &lt;span&gt;this&lt;/span&gt;.ReadXML(&lt;span&gt;@&amp;quot;Templates\WorkbookTemplate.xml&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;return&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;.Format(contents, sheetId, sheetName);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Notice the &lt;em&gt;WorkbookXml&lt;/em&gt; procedure has a call to &lt;font color="#0000ff"&gt;string&lt;/font&gt;.Format to replace some placeholders with actual data: the ID of the worksheet part relationship and the name of the worksheet. The name of the worksheet&amp;nbsp;is important later, when we want to add data to the worksheet.&lt;/p&gt;
&lt;p&gt;The second step is to actually add data to the worksheet. The class uses two functions available as &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d46c01f-e3f6-4069-869d-90b8b096b556&amp;amp;displaylang=en"&gt;Code Snippets&lt;/a&gt; (&lt;em&gt;XLInsertStringIntoCell&lt;/em&gt;, and &lt;em&gt;XLInsertNumberIntoCell&lt;/em&gt;). I won't reproduce the code here as I don't own it, but essentially the functions open the proper parts and insert the data. These functions take in the file, the sheet name, cell reference and cell value as parameters.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://qguveq.bay.livefilestore.com/y1pfKAbXueSEEiSCYjvHnQwUlJgNJdbPUpmJ_G-4Tf5ksw9HLgKi7l2elFW7B_kboSZfhC9EwGenbU3swJ_aXpbTg/snippet.jpg" /&gt; &lt;/p&gt;
&lt;p&gt;Lastly, I wrote a console app to exercise the &lt;em&gt;Spreadsheet&lt;/em&gt;&amp;nbsp;class:&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;span&gt;class&lt;/span&gt; &lt;span&gt;Program&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;{&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;protected&lt;/span&gt; &lt;span&gt;static&lt;/span&gt; &lt;span&gt;readonly&lt;/span&gt; &lt;span&gt;string&lt;/span&gt; fileName = &lt;span&gt;&amp;quot;example.xlsx&amp;quot;&lt;/span&gt;;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;protected&lt;/span&gt; &lt;span&gt;static&lt;/span&gt; &lt;span&gt;readonly&lt;/span&gt; &lt;span&gt;string&lt;/span&gt; firstSheetName = &lt;span&gt;&amp;quot;Sheet1&amp;quot;&lt;/span&gt;;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;static&lt;/span&gt; &lt;span&gt;void&lt;/span&gt; Main(&lt;span&gt;string&lt;/span&gt;[] args)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;string&lt;/span&gt; path = &lt;span&gt;Environment&lt;/span&gt;.CurrentDirectory + &lt;span&gt;@&amp;quot;\&amp;quot;&lt;/span&gt; + fileName;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;Spreadsheet&lt;/span&gt; file = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;Spreadsheet&lt;/span&gt;();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.CreateSpreadsheet(path, firstSheetName);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertStringIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;Category&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertStringIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;B1&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;Value&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertStringIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;A2&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;Red&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertNumberIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;B2&amp;quot;&lt;/span&gt;, 30);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertStringIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;A3&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;Blue&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertNumberIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;B3&amp;quot;&lt;/span&gt;, 60);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertStringIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;A4&amp;quot;&lt;/span&gt;, &lt;span&gt;&amp;quot;Green&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; file.XLInsertNumberIntoCell(fileName, firstSheetName, &lt;span&gt;&amp;quot;B4&amp;quot;&lt;/span&gt;, 10);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;Console&lt;/span&gt;.WriteLine(&lt;span&gt;&amp;quot;Workbook created at &amp;quot;&lt;/span&gt; + path);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;Console&lt;/span&gt;.ReadKey();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Before the comments start to fly, I want to point out a couple things:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;This bit of code is not that efficient, I realize it opens and closes the package a bunch of times. This is really just to demonstrate what is possible and not what is necessarily the best practice. There are very few code samples available, and I am shooting for simplicity here. &lt;/li&gt;
    &lt;li&gt;I know &lt;a href="http://www.codeplex.com/ExcelPackage"&gt;ExcelPackage&lt;/a&gt; is&amp;nbsp;on CodePlex&amp;nbsp;and does a better job of wrapping the APIs involved and is much easier to write code with. Once you have a basic understanding of&amp;nbsp;these APIs you will appreciate for the work being done on that project. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://cid-91e00ea99b4ae024.skydrive.live.com/self.aspx/Public/SpreadsheetML.zip"&gt;Download the VS 2005 project&lt;/a&gt;. Don't forget to install all the prerequisites listed above before trying the project. I didn't include the two functions necessary from the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d46c01f-e3f6-4069-869d-90b8b096b556&amp;amp;displaylang=en"&gt;Code Snippets&lt;/a&gt; in the project either (since I didn't write that code), you will have to put those in yourself.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=355742" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=355742</wfw:commentRss></entry><entry><title>Why you should care about password length</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/10/25/346115.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:346115</id><created>2007-10-25T13:21:28Z</created><content type="text/html" mode="escaped">&lt;p&gt;Jeff Atwood shows us why &lt;a href="http://www.codinghorror.com/blog/archives/000986.html"&gt;we should consider better password policies&lt;/a&gt; when developing applications or setting company policy.&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;As we know, the biggest threat to security is not hackers, but the users themselves making it easy for someone to gain access to protected resources by having ridiculously easy to guess passwords.&amp;nbsp;As developers we are as much at fault for building applications that allow this behavior. &amp;nbsp;Jeff recommends &lt;a href="http://www.codinghorror.com/blog/archives/000360.html"&gt;using pass phrases&lt;/a&gt; instead of passwords. A phrase is longer (and thus more resistant to brute force) and easier to remember than a mixed up jumble of nonsensical characters. By adding an unusual word&amp;nbsp;or character pass phrases are very difficult to break with dictionary attacks as well.&amp;nbsp;&amp;nbsp;Pass phrases are controversial as well, see:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/technet/community/columns/secmgmt/sm1004.mspx"&gt;The Great Debates: Pass Phrases vs. Passwords. Part 1 of 3&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/technet/community/columns/secmgmt/sm1104.mspx"&gt;The Great Debates: Pass Phrases vs. Passwords. Part 2 of 3&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/technet/community/columns/secmgmt/sm1204.mspx"&gt;The Great Debates: Pass Phrases vs. Passwords. Part 3 of 3&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Personally, I think the hard part is convincing users and business owners of an application&amp;nbsp;that longer or more complicated&amp;nbsp;is better. From my own experience I understand users want the simplest password policy possible. Often the business owners of an app don't feel the information being protected is all that important to justify such an imposition for the users, or feel that it becomes a support expense because users can't manage their own data or password very well (a great argument for using something like &lt;a href="http://msdn2.microsoft.com/en-us/library/aa480189.aspx"&gt;Windows CardSpace&lt;/a&gt;). I think they forget that users re-use the same password everywhere possible: a free e-mail account, network access at work, bank web sites, a blog, a MySpace account, etc. I would not&amp;nbsp;want&amp;nbsp;to be responsible for&amp;nbsp;a malicious person to gain a password from my system and then use that password to systematically destroy someone else's life.&amp;nbsp;Be strong, insist on good password policy.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=346115" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=346115</wfw:commentRss></entry><entry><title>Day of .Net Presentation</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/10/22/343371.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:343371</id><created>2007-10-22T09:40:59Z</created><content type="text/html" mode="escaped">&lt;p&gt;I thoroughly enjoyed my presentation and the time at Day of .Net this past Saturday. Special thanks to those folks who attended my presentation.&lt;/p&gt; &lt;p&gt;Here is my &lt;a href="http://cid-91e00ea99b4ae024.skydrive.live.com/browse.aspx/Public"&gt;slide deck&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;This is a zip file of the &lt;a href="http://cid-91e00ea99b4ae024.skydrive.live.com/browse.aspx/Public"&gt;code from the presentation&lt;/a&gt;. Remember you need the .Net 3.0 framework and the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb448854.aspx"&gt;SDK for Open XML Formats CTP&lt;/a&gt;&amp;nbsp;in order to run the code.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=343371" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=343371</wfw:commentRss></entry><entry><title>Open XML References</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/10/19/340715.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:340715</id><created>2007-10-19T11:59:25Z</created><content type="text/html" mode="escaped">&lt;p&gt;Resources&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.ecma-international.org/publications/standards/Ecma-376.htm"&gt;ECMA-376&amp;nbsp; Standard Specification&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.codeplex.com/dbe"&gt;Word 2007 Content Control Toolkit&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d46c01f-e3f6-4069-869d-90b8b096b556&amp;amp;displaylang=en"&gt;Open XML Code Snippets for Visual Studio 2005&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://openxmldeveloper.org/"&gt;OpenXmlDeveloper.org&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://openxmldeveloper.org/articles/1970.aspx"&gt;Open XML e-book&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/office/Aa905545.aspx"&gt;XML in Office Developer Portal&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb448854.aspx"&gt;SDK for Open XML Formats CTP&lt;/a&gt;&amp;nbsp;(online)&lt;/p&gt; &lt;p&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1647&amp;amp;SiteID=1"&gt;MSDN Forum for Open XML SDK&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Software&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=PackageExplorer"&gt;Package Explorer&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.codeplex.com/ExcelPackage"&gt;ExcelPackage&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.codeplex.com/dbe"&gt;Word 2007 Content Control Tookit&amp;nbsp;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d46c01f-e3f6-4069-869d-90b8b096b556&amp;amp;displaylang=en"&gt;Open XML Code Snippets for Visual Studio 2005&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&amp;amp;displaylang=en"&gt;SDK for Open XML Formats CTP&lt;/a&gt; (download)&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=10cc340b-f857-4a14-83f5-25634c3bf043&amp;amp;displaylang=en"&gt;Microsoft .Net Framework 3.0&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Articles&lt;/p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa338205.aspx"&gt;Introducing the Office (2007) Open XML File Formats&lt;/a&gt;  &lt;p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb735940.aspx"&gt;Building Server-Side Document Generation Solutions Using the Open XML Object Model (Part 1 of 2)&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb735939.aspx"&gt;Building Server-Side Document Generation Solutions Using the Open XML Object Model (Part 2 of 2)&lt;/a&gt;&lt;/p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb739834.aspx"&gt;Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Object Model (Part 1 of 2)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb727373.aspx"&gt;Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Object Model (Part 2 of 2)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa662188(office.11).aspx"&gt;Dive Into SpreadsheetML (Part 1 of 2)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa662189(office.11).aspx"&gt;Dive Into SpreadsheetML (Part 2 of 2)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb656295.aspx"&gt;Manipulating Word 2007 Files with the Open XML Object Model (Part 1 of 3)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb739835.aspx"&gt;Manipulating Word 2007 Files with the Open XML Object Model (Part 2 of 3)&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb727374.aspx"&gt;Manipulating Word 2007 Files with the Open XML Object Model (Part 3 of 3)&lt;/a&gt;  &lt;p&gt;Blogs&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.infosupport.com/wouterv/"&gt;Wouter van Vugt&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/brian_jones/default.aspx"&gt;Brian Jones&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/kevinboske/"&gt;Kevin Boske&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=340715" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=340715</wfw:commentRss></entry><entry><title>ASP.NET Web Project Build Events</title><link rel="alternate" type="text/html" href="http://www.dotnetjunkies.com/WebLog/davetrux/archive/2007/10/08/333072.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:333072</id><created>2007-10-08T09:36:23Z</created><content type="text/html" mode="escaped">&lt;p&gt;I have a web project (the original 2005 web project type, not a web application project) and had a problem getting files copied to the &lt;em&gt;bin&lt;/em&gt; directory. Essentially, one of the library projects referenced by the web project has an XML file in the project output, but when the solution is built, the XML file in the bin directory of the library project is not pulled into to the bin directory of the web project. Of course, a post-build event seemed like the thing to do, but web projects don't have support for that.&lt;/p&gt; &lt;p&gt;A little digging and I found &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/08/21/423201.aspx"&gt;this post by Scott Guthrie&lt;/a&gt; that describes a "Build Helper Project". You simply add an empty class library project to your solution. You then use the build events in the empty project use to add build events to your web project. You just make sure the project build order is correct so the events get called when you need them.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=333072" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/davetrux/commentrss.aspx?PostID=333072</wfw:commentRss></entry></feed>