<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-11292315</id><updated>2012-01-23T04:08:32.899-08:00</updated><category term='vss'/><category term='Crystal Reports'/><category term='Visual Studio'/><category term='Team Foundation Server'/><category term='MVC'/><category term='decrypt'/><category term='workflow'/><category term='debugging'/><category term='ORA-00911'/><category term='BDC'/><category term='master page'/><category term='Regular Expressions'/><category term='moss 2007'/><category term='.Net'/><category term='Oracle 10g'/><category term='api'/><category term='Web Forms'/><category term='10g'/><category term='SetParent failed for Database'/><category term='Visual Studio 2010'/><category term='mssql'/><category term='SSMS'/><category term='t-sql'/><category term='visual source safe'/><category term='WF'/><category term='applications'/><category term='sharepoint'/><category term='Visual Studio 2008'/><category term='encrypt'/><category term='Backup'/><category term='comparison'/><category term='Data Guard'/><category term='sharepoint server'/><category term='Standby'/><category term='definition editor'/><category term='developer'/><category term='myspace'/><category term='Tab-delimited'/><category term='vs.net 2005'/><category term='Android'/><category term='intellisense'/><category term='differences'/><category term='aspx'/><category term='Workflow Foundation'/><category term='facebook'/><category term='jQuery'/><category term='SQL Server 2008'/><category term='SetParameters'/><category term='TF31002'/><category term='ORA-02156'/><category term='TFS'/><category term='VS.NET 2008'/><category term='SQL Server 2005'/><category term='parameters'/><category term='2010'/><category term='ReportViewer'/><category term='2007'/><category term='Java'/><category term='Search'/><category term='mirroring'/><category term='Activity Monitor'/><category term='sql server'/><category term='2005'/><category term='oracle'/><category term='Failover'/><category term='sql'/><category term='Database Configuration Assistant'/><category term='Web Controls'/><category term='Eclipse'/><category term='asp.net'/><category term='sharepoint server 2007'/><category term='content type'/><category term='JavaScript'/><category term='error'/><category term='moss'/><title type='text'>MTG C# Guy's Layer</title><subtitle type='html'>I'm a .Net developer with an emphasis on the C# language, but I also keep myself busy with HTML, JavaScript (and, yes, jQuery!), Adobe Flash, Google Android, Oracle, MySQL, and SQL Server development. If there's code involved, I am game... the more code, the merrier!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11292315.post-314439372915437726</id><published>2011-11-12T11:44:00.001-08:00</published><updated>2011-11-13T13:13:32.877-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Creating your First Android Application</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;i&gt;From a .Net Developer's Perspective&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I will be showing you how to create the same application that was shown in the tutorial titled&amp;nbsp;&lt;/span&gt;&lt;a href="http://mtgcsharpguy.blogspot.com/2011/11/creating-your-first-mono-for-android.html" style="font-family: Arial, Helvetica, sans-serif;"&gt;'Creating your First Mono for Android Application'&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;. Over time, I will create more advanced Android application development tutorials using both the Mono for Android (using C#) and Eclipse Android Plugin (using Java) frameworks.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting Up the Development Environment&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Download and install the Java SE Development Kit (JDK):&lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;&amp;nbsp;I've installed JDK version 6 Update 27 (1.6.0.270).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Download and install Eclipse IDE for Java EE Developers:&amp;nbsp;&lt;a href="http://www.eclipse.org/downloads/"&gt;http://www.eclipse.org/downloads/&lt;/a&gt;&amp;nbsp;I've installed version Indigo Service Release 1, build 20110916-0149.&lt;/span&gt;&lt;/li&gt;
&lt;ol type="a"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Extract the Eclipse files from the 'eclipse' folder into a folder on your PC. I've installed mine in &lt;i&gt;C:\Eclipse&lt;/i&gt;. &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Install the Android SDK from&amp;nbsp;&lt;a href="http://developer.android.com/sdk/index.html"&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;. I installed Android SDK revision 15.&lt;/span&gt;&lt;/li&gt;
&lt;ol type="a"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Do not use any spaces in the installation path. I used&amp;nbsp;&lt;i&gt;C:\AndroidSDK&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Leave the 'Start SDK Manager' checkbox checked.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Ensure that the 'Android SDK Tools' and ''Android SDK Platform-tools' are fully installed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I also installed 'Android 2.2 (API 8)' and 'Android 2.3.3 (API 10)'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Install N packages...' when ready.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Check the 'Accept all' radio button, then click on 'Install'. It will download and then install the packages. Please note that this download &amp;amp; installation process takes a long time to complete. Don't worry if the log shows an "'adb kill-server' failed -- run manually if necessary." error message. This is simply the package manager's attempt to stop the Android Debug Bridge's server process, which is not yet/already running.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click 'Yes' to restart ADB.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close the SDK manager.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Configure the Android Simulator:&lt;/span&gt;&lt;/li&gt;
&lt;ol type="a"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the Android SDK AVD Manager.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'New...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter&amp;nbsp;&lt;i&gt;MonoDroid&lt;/i&gt;&amp;nbsp;in the 'Name' field.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Target' drop-down, select 'Android 2.2 - API Level 8'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Choose&amp;nbsp;&lt;i&gt;512&lt;/i&gt;MB for the 'SD Card' 'Size'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select 'HVGA' as the 'Built-in' 'Skin'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Hardware' section, click on the 'New ...' button.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select the 'Device ram size' property from the drop-down list.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter&amp;nbsp;&lt;i&gt;512&lt;/i&gt;&amp;nbsp;for the 'Device ram size' property.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Create AVD'. It will take about a minute to complete.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close out of all Android SDK windows.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Install the&amp;nbsp;Android Development Tools (ADT) Plugin for Eclipse:&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;ol type="a"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Launch the 'eclipse.exe' file from the Eclipse folder. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Specify your &lt;i&gt;Workspace&lt;/i&gt;&amp;nbsp;location. This is the folder in which Eclipse stores your Eclipse projects. I've set mine to&amp;nbsp;&lt;i&gt;C:\Documents and Settings\Mike\My Documents\Eclipse&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Help' menu, then click on 'Install New Software...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter the following URL in the 'Work with:' text box:&amp;nbsp;&lt;a href="http://dl-ssl.google.com/android/eclipse"&gt;http://dl-ssl.google.com/android/eclipse&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Add...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Name the repository. I've called mine &lt;i&gt;Android Plugin for Eclipse&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK'. &amp;nbsp;Wait until you see the 'Developer Tools' checkbox in the list.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Check&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;the 'Developer Tools' checkbox.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Check the license terms radio checkbox.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Finish'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK' when and if you see a 'Security Warning' dialog box regarding installing unsigned software.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Restart Now' to restart Eclipse.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Welcome to Android Development' / 'Configure SDK' dialog box, check the radio checkbox labeled 'Use existing SDKs'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Browse to and select the location of the Android SDK installed previously. I've set my 'Existing Location' to&amp;nbsp;&lt;i&gt;C:\AndroidSDK&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I've opted not to send usage statistics to Google.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Finish'.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Creating the First, Hello World Android Application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;If it's not already open, launch the 'eclipse.exe' application.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'File' menu, then go to 'New' and click on 'Project'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Android' folder and select 'Android Project'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Project Name' text box, enter&amp;nbsp;&lt;i&gt;HelloWorld&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select the 'Android 2.2' SDK target.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Package Name' text box, change the name to&amp;nbsp;&lt;i&gt;net.DotNetFun.HelloWorld&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Create Activity' text box, change the activity to&amp;nbsp;&lt;i&gt;MainActivity&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Finish'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close the 'Welcome' tab in the upper-right corner.&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-LcpMPw2aV8k/Tr8AMLr-mTI/AAAAAAAAAHI/mZulDBJWHiw/s1600/Eclipse+Remove+Welcome+Tab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-LcpMPw2aV8k/Tr8AMLr-mTI/AAAAAAAAAHI/mZulDBJWHiw/s1600/Eclipse+Remove+Welcome+Tab.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Rearrange the workspace so the panes are more appropriate spaced. This is what mine looks like:&lt;br /&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-W-IlXm_MdzQ/Tr8W0Fcrd3I/AAAAAAAAAHQ/bItPByRaGek/s1600/Eclipse+Workspace.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-W-IlXm_MdzQ/Tr8W0Fcrd3I/AAAAAAAAAHQ/bItPByRaGek/s1600/Eclipse+Workspace.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Package Explorer', expand the 'HelloWorld', then expand the 'res' and 'layout' folders.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Double-click on the 'main.xml' file to open it. This file is equivalent to the &lt;i&gt;Main.axml&lt;/i&gt;&amp;nbsp;XML file used in the various &lt;i&gt;Mono for Android&lt;/i&gt; Visual Studio project templates. It defines, declaratively, the layout for one or more activities. For more info about declaring XML layouts, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/ui/declaring-layout.html"&gt;http://developer.android.com/guide/topics/ui/declaring-layout.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'main.xml' tab.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Use the following XML as the 'main.xml' contents:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &amp;gt;
&amp;lt;Button  
    android:id="@+id/MyButton"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/Hello"
    /&amp;gt;
&amp;lt;Button
      android:id="@+id/DialogButton"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Dialog Button"
    /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/pre&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-N0flDw0SEWg/TsAy8ru7VPI/AAAAAAAAAIE/SeDoggZFQvY/s1600/Eclipse+main.xml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-N0flDw0SEWg/TsAy8ru7VPI/AAAAAAAAAIE/SeDoggZFQvY/s1600/Eclipse+main.xml.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
For more info about Android XML layouts, visit this URL:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://developer.android.com/guide/topics/resources/layout-resource.html" style="text-align: left;"&gt;http://developer.android.com/guide/topics/resources/layout-resource.html&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Package Explorer', expand the 'values' folder.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Double-click on the 'strings.xml' file to open it. This is equivalent to the the 'Strings.xml' file&amp;nbsp;used in the various&amp;nbsp;&lt;i&gt;Mono for Android&lt;/i&gt;&amp;nbsp;Visual Studio project templates. It defines, declaratively, string resources. One difference you'll notice, however, is the 'app_name' resource. The Eclipse project requires, by default, this resource exist. For more info about declaring string resources, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/resources/string-resource.html"&gt;http://developer.android.com/guide/topics/resources/string-resource.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Use the following XML as the 'strings.xml' contents:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;resources&amp;gt;
    &amp;lt;string name="Hello"&amp;gt;Hello World, Click Me!&amp;lt;/string&amp;gt;
    &amp;lt;string name="app_name"&amp;gt;DotNetFun.Android.HelloWorld&amp;lt;/string&amp;gt;
    &amp;lt;string name="HelloButtonText"&amp;gt;Button Text via Strings.xml&amp;lt;/string&amp;gt;
&amp;lt;/resources&amp;gt;

&lt;/pre&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-GttIKrjPtwY/Tr8dWzE2yqI/AAAAAAAAAHo/P2TahDNT_Gg/s1600/Eclipse+strings.xml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-GttIKrjPtwY/Tr8dWzE2yqI/AAAAAAAAAHo/P2TahDNT_Gg/s1600/Eclipse+strings.xml.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;For more info about Android string resources, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/resources/string-resource.html" style="text-align: left;"&gt;http://developer.android.com/guide/topics/resources/string-resource.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Package Explorer', expand the 'src', and 'net.DotNetFun.HelloWorld' folders.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Double-click on the 'MainActivity.java' file to open it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Ensure that the java code in this file has exactly what you see here:&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;package net.DotNetFun.HelloWorld;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.*;
import android.view.*;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener {
 
 private int count;
 
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        this.count = 0;
        
        Button button = (Button) findViewById(R.id.MyButton);
        
        button.setOnClickListener(this);
        
        Resources res = this.getResources();
        button.setText(res.getString(R.string.HelloButtonText));
        
        Button dialogButton = (Button) findViewById(R.id.DialogButton);
        dialogButton.setText("Dialog Button");
        
        dialogButton.setOnClickListener(this);
    }
    
    public void onClick(View v) {
     
     Button button = (Button) v;
     
  if (button.getId() == R.id.MyButton)
  {
   this.count++;
   button.setText(String.format("%s clicks!", this.count));
  }
  else if (button.getId() == R.id.DialogButton)
  {
   AlertDialog.Builder builder = new AlertDialog.Builder(this);
   builder.setMessage("Hello, World!");
   builder.setCancelable(false);
   builder.setPositiveButton("OK", null);
   AlertDialog dialog = builder.create();
   dialog.show();
  }
 }
}

&lt;/pre&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Run' menu, then click on 'Debug Configurations...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Target' tab.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Select a preferred Android Virtual Device for deployment' list, select/check the 'MonoDroid' emulator created earlier.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Apply', then click on 'Close'.&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-snLTElNJhoE/TsAax5hmEUI/AAAAAAAAAH0/ntqbD0eDZZk/s1600/Eclipse%2BDebug%2BConfig.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-snLTElNJhoE/TsAax5hmEUI/AAAAAAAAAH0/ntqbD0eDZZk/s1600/Eclipse%2BDebug%2BConfig.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F11 to debug and start the Android application. If you get a dialog box stating it's waiting for the debugger to attach, and it doesn't go away after a while, you'll need to restart Eclipse, re-check your debug configuration, and press F11 again.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Slide over the button to get to the Android desktop, then click on the applications icon/button.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'DotNetFun.Android.HelloWorld' application.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Button Text via Strings.xml' button. A dialog box stating ''Hello, World!' should appear. Close it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Hello World, Click me!' button several times. With each click, the button's text/caption changes to the number of times it has been clicked.&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-B9dNLcBtY2k/TsAn25QcbzI/AAAAAAAAAH8/pJRx4Ze4Zrw/s1600/Eclipse+App.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-B9dNLcBtY2k/TsAn25QcbzI/AAAAAAAAAH8/pJRx4Ze4Zrw/s1600/Eclipse+App.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-314439372915437726?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/314439372915437726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=314439372915437726&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/314439372915437726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/314439372915437726'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/11/creating-your-first-android-application.html' title='Creating your First Android Application'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-LcpMPw2aV8k/Tr8AMLr-mTI/AAAAAAAAAHI/mZulDBJWHiw/s72-c/Eclipse+Remove+Welcome+Tab.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-9042037264651002451</id><published>2011-11-11T08:46:00.001-08:00</published><updated>2011-11-11T08:52:47.558-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><title type='text'>Debugging a VS.NET 2010 ASP Development Server Hosted Application Running via All Browsers</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In Visual Studio 2010, set your breakpoints.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Debug' menu.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Attach to Process...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Find the 'ASP.NET Development Server - Port #' process hosting the ASP.NET application you'd like to debug.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Attach'.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;You're all set. You can now debug your ASP.NET application from any web browser pointed at that server's URL.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-9042037264651002451?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/9042037264651002451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=9042037264651002451&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/9042037264651002451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/9042037264651002451'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/11/debugging-vsnet-2010-asp-development.html' title='Debugging a VS.NET 2010 ASP Development Server Hosted Application Running via All Browsers'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6240463937208465065</id><published>2011-11-09T15:45:00.000-08:00</published><updated>2011-11-11T08:52:05.988-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='WF'/><title type='text'>Creating your First Windows Workflow v4 Application</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
The following WF console application (written in C#) will 1) pause for 5 seconds, 2) write the line "Hello," 3) pause another 5 seconds, and then 4) write the line "World!" I know, not terribly&amp;nbsp;practical, but it will get you familiar with creating WF v4 applications for the first time, assuming you'r new to this, that is.&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Open up Visual Studio 2010.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-N to create a new project.&lt;/li&gt;
&lt;li&gt;In the 'Installed Templates' pane, select 'Workflow'.&lt;/li&gt;
&lt;li&gt;Select the 'Workflow Console Application' template.&lt;/li&gt;
&lt;li&gt;Name the project &lt;i&gt;DotNetFun.Workflow.HelloWorld&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Ensure that the 'Workflow1.xaml' file is open.&lt;/li&gt;
&lt;li&gt;Drag a 'Sequence' from the toolbox's 'Control Flow' section onto the area of the designer labeled 'Drop activity here'.&lt;/li&gt;
&lt;li&gt;Click on the sequence to select it.&lt;/li&gt;
&lt;li&gt;At the bottom of the designer, click on the 'Variable' tab button.&lt;/li&gt;
&lt;li&gt;Click on where it says 'Create Variable'.&lt;/li&gt;
&lt;li&gt;Type &lt;i&gt;pauseWaitTime&lt;/i&gt;. This will be the variable that stores how long each pause will be.&lt;/li&gt;
&lt;li&gt;In the 'Variable type' column, select 'Browse for Types...', then in 'Type Name:' text box, type &lt;i&gt;System.TimeSpan&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Click on 'OK'.&lt;/li&gt;
&lt;li&gt;In the 'Default' column, type the following code expression:&amp;nbsp;&lt;i&gt;new TimeSpan(0,0,5)&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-style: normal;"&gt;The&amp;nbsp;'&lt;/span&gt;pauseWaitTime'&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;variable will now be available within the 'Sequence' scope, available to the sequence &amp;nbsp;and all of its child elements.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;In the 'Primitives' section of the toolbox, drag a 'Delay' activity into the 'Sequence' sequence.&lt;/li&gt;
&lt;li&gt;In the properties explorer for the &lt;i&gt;Delay&lt;/i&gt;&amp;nbsp;activity, enter &lt;i&gt;pauseWaitTime&lt;/i&gt; in the 'Duration' text box.&lt;/li&gt;
&lt;li&gt;In the properties explorer for the&amp;nbsp;&lt;i&gt;Delay&lt;/i&gt;&amp;nbsp;activity,&amp;nbsp;change the name to &lt;i&gt;Delay1&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;In the 'Primitives' section of the toolbox, drag a&amp;nbsp;'WriteLine' activity directly beneath the 'Delay1' activity.&lt;/li&gt;
&lt;li&gt;Click on the 'Enter a VB expression' text box and enter &lt;i&gt;"Hello,"&lt;/i&gt;&amp;nbsp;(with double quotes, as this is a string literal expression).&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;In the properties explorer for the&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;WriteLine&lt;/i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;activity,&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;change the name to&amp;nbsp;&lt;/span&gt;&lt;i&gt;WriteLine1&lt;/i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;In the 'Primitives' section of the toolbox, drag a 'Delay' directly beneath the 'WriteLine1' activity.&lt;/li&gt;
&lt;li&gt;In the properties explorer for the&amp;nbsp;&lt;i&gt;Delay&lt;/i&gt;&amp;nbsp;activity, enter&amp;nbsp;&lt;i&gt;pauseWaitTime&lt;/i&gt;&amp;nbsp;in the 'Duration' text box.&lt;/li&gt;
&lt;li&gt;In the properties explorer for the&amp;nbsp;&lt;i&gt;Delay&lt;/i&gt;&amp;nbsp;activity,&amp;nbsp;change the name to&amp;nbsp;&lt;i&gt;Delay2&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;In the 'Primitives' section of the toolbox, drag a&amp;nbsp;'WriteLine' activity directly beneath the 'Delay2' activity.&lt;/li&gt;
&lt;li&gt;Click on the 'Enter a VB expression' text box and enter&amp;nbsp;&lt;i&gt;"World!"&lt;/i&gt;&amp;nbsp;(with double quotes, as this is a string literal expression).&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;In the properties explorer for the&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;WriteLine&lt;/i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;activity,&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;change the name to&amp;nbsp;&lt;/span&gt;&lt;i&gt;WriteLine2&lt;/i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;. The workflow designer should now look like the following:&lt;br /&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/--c7aC4baRtc/Trwc0_eHnVI/AAAAAAAAAHA/qGUpksbad1I/s1600/WFSequence.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/--c7aC4baRtc/Trwc0_eHnVI/AAAAAAAAAHA/qGUpksbad1I/s1600/WFSequence.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Open the Program.cs class file. &lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Add the following code after the &lt;/span&gt;&lt;span class="Apple-style-span"&gt;WorkflowInvoker.Invoke&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt; method call:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;    Console.WriteLine("Press any key to exit...");
    Console.ReadKey();

&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Press F5 to run and test the workflow application.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
That does it for this very simple introduction to WF v4 workflows. Be on the lookout for more!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6240463937208465065?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6240463937208465065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6240463937208465065&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6240463937208465065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6240463937208465065'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/11/creating-your-first-windows-workflow-v4.html' title='Creating your First Windows Workflow v4 Application'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/--c7aC4baRtc/Trwc0_eHnVI/AAAAAAAAAHA/qGUpksbad1I/s72-c/WFSequence.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-9071573345756431356</id><published>2011-11-08T19:28:00.000-08:00</published><updated>2011-11-12T11:43:30.561-08:00</updated><title type='text'>Testing Mono for Android Applications on an Android Device</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;i style="font-family: Arial, Helvetica, sans-serif;"&gt;Please note that the following steps were performed on an HTC smartphone running Android version 2.1.&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting Up the Android Device&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Ensure the Android device is not yet plugged into the PC.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Go the the desktop/home of the Android device.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Go to &lt;i&gt;Settings&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Applications'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Development'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Check the following checkboxes: &amp;nbsp;'USB debugging', 'Stay awake', and 'Allow mock locations'.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting Up the Android SDK&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Visit the following URL to download and install the appropriate USB driver for ADB for the device:&amp;nbsp;&lt;/span&gt;&lt;a href="http://developer.android.com/sdk/oem-usb.html"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;http://developer.android.com/sdk/oem-usb.html&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting Up the Visual Studio Mono for Android Application&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up Visual Studio 2010.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open the Mono for Android application.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'AndroidManifest.xml' file.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Add the following XML attribute to the 'application' element:&lt;br /&gt;&lt;br /&gt;android:debuggable="true"&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to debug and deploy the application.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select the Android device from the 'Running devices' list.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on OK.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-9071573345756431356?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/9071573345756431356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=9071573345756431356&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/9071573345756431356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/9071573345756431356'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/11/testing-mono-for-android-applications.html' title='Testing Mono for Android Applications on an Android Device'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3549484185178226365</id><published>2011-11-06T09:20:00.000-08:00</published><updated>2011-11-14T11:05:42.782-08:00</updated><title type='text'>Creating your First Mono for Android Application</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;From a .Net Developer's Perspective&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I will be showing you how to create the same application that was shown in the tutorial titled&amp;nbsp;&lt;/span&gt;&lt;a href="http://mtgcsharpguy.blogspot.com/2011/11/creating-your-first-android-application.html" style="font-family: Arial, Helvetica, sans-serif;"&gt;'Creating your First Android Application'&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;. Over time, I will create more advanced Android application development tutorials using both the Mono for Android (using C#) and Eclipse Android Plugin (using Java) frameworks.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Getting the Environment Setup&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Install&amp;nbsp;the Java 1.6 JDK.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Install the Android SDK from&amp;nbsp;&lt;a href="http://developer.android.com/sdk/index.html"&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;. I installed Android SDK revision 15.&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Do not use any spaces in the installation path. I used&amp;nbsp;&lt;i&gt;C:\AndroidSDK&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Leave the 'Start SDK Manager' checkbox checked.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Ensure that the 'Android SDK Tools' and ''Android SDK Platform-tools' are fully installed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I also installed 'Android 2.2 (API 8)' and 'Android 2.3.3 (API 10)'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Install N packages...' when ready.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Check the 'Accept all' radio button, then click on 'Install'. It will download and then install the packages. Please note that this download &amp;amp; installation process takes a long time to complete. Don't worry if the log shows an "'adb kill-server' failed -- run manually if necessary." error message. This is simply the package manager's attempt to stop the Android Debug Bridge's server process, which is not yet/already running.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click 'Yes' to restart ADB.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close the SDK manager.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Configure the Android Simulator:&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the Android SDK AVD Manager.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'New...'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter&amp;nbsp;&lt;i&gt;MonoDroid&lt;/i&gt;&amp;nbsp;in the 'Name' field.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Target' drop-down, select 'Android 2.2 - API Level 8'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Choose&amp;nbsp;&lt;i&gt;512&lt;/i&gt;MB for the 'SD Card' 'Size'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select 'HVGA' as the 'Built-in' 'Skin'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Hardware' section, click on the 'New ...' button.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select the 'Device ram size' property from the drop-down list.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter &lt;i&gt;512&lt;/i&gt; for the 'Device ram size' property.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Create AVD'. It will take about a minute to complete.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close out of all Android SDK windows.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;Install the 'Mono for Android for Windows' SDK from&amp;nbsp;&lt;a href="http://xamarin.com/trial"&gt;http://xamarin.com/trial&lt;/a&gt;.&amp;nbsp;I've installed the Mono for Android SDK v1.2.&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;If you get a message saying that Android SDK 14 is required, don't worry about it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'Next'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close the installer.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Creating the First, Hello World Android Application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up Visual Studio 2010.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Choose the option to create a new project.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Visual C#' tree, select 'Mono for Android Application'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Name the project &lt;i&gt;DotNetFun.Android.HelloWorld&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on OK.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Rigkt-click on the 'DotNetFun.Android.HelloWorld' project, then click on 'Properties'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Android Manifest' tab.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the link to add an 'AndroidManifest.xml' file.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Name the 'Application' &lt;i&gt;Hello World&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Name the 'Package'&amp;nbsp;&lt;i&gt;DotNetFun.Android.HelloWorld&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter &lt;i&gt;1&lt;/i&gt; for the 'Version number'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enter &lt;i&gt;v1&lt;/i&gt; for the 'Version name'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select 'API Level 8 - Android 2.2' in the 'Minimum Android version' drop-down.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Save the project.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Dissecting the&amp;nbsp;'Mono for Android Application' Application&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The &lt;i&gt;Mono for Android&lt;/i&gt; folks have done a great job of recreating the look and feel of a typical Java and Eclipse based Android application in Visual Studio with their various templates, so kudos to them for a job well done.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The following is a summary description of the various aspects of a typical &lt;i&gt;Android&lt;/i&gt; and &lt;i&gt;Mono for Android&lt;/i&gt; Visual Studio application:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Android Activities&lt;/b&gt;&lt;br /&gt;
Android &lt;i&gt;Activities&lt;/i&gt; are akin to ASP.NET Web Form pages, ASP.NET MVC views, and Windows Forms forms. They are the screen areas where UI elements are rendered and interaction between the user and the application typically take place. Just like web forms and Windows forms raise events and have life-cycles, so, too, do Android Activities. The default &lt;i&gt;Activity1.cs&lt;/i&gt; class file that's created when creating a new 'Mono for Android Application' application derives from the&amp;nbsp;&lt;i&gt;Android.Views.Activity&lt;/i&gt; class to provide base activity functionality, much like web forms pages typically derive from &lt;i&gt;System.Web.UI.Page&lt;/i&gt; and Windows forms derive from&amp;nbsp;&lt;i&gt;System.Windows.Forms.Form&lt;/i&gt;. And much like web forms and Windows forms raise events and call event handlers, such as &lt;i&gt;Init&lt;/i&gt;&amp;nbsp;and &lt;i&gt;PreRender&lt;/i&gt;, so, too, do &lt;i&gt;Mono for Android Activities&lt;/i&gt;, such as the overridable &lt;i&gt;OnCreate&lt;/i&gt; and &lt;i&gt;OnStart&lt;/i&gt; methods respectively. For more about activities as used in Mono for Android, read Xamarin's 'Mono for Android Activity Lifecycle' documentation here:&amp;nbsp;&lt;a href="https://docs.google.com/open?id=1nTEo_ZLGWG4oTb6aUtZspVpPYRQzskyONr6g5iUPwKFqIG7Lpcuka-a1Y7FH"&gt;https://docs.google.com/open?id=1nTEo_ZLGWG4oTb6aUtZspVpPYRQzskyONr6g5iUPwKFqIG7Lpcuka-a1Y7FH&lt;/a&gt;&amp;nbsp;For more about Android activities, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;http://developer.android.com/reference/android/app/Activity.html&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Android Layouts&lt;/b&gt;&lt;br /&gt;
Android layouts define how visual elements in an Activity are displayed. Layouts are &lt;i&gt;Views&lt;/i&gt; per se (read below). Android supports the following layouts: &lt;i&gt;FrameLayout, LinearLayout, TableLayout, and RelativeLayout&lt;/i&gt;. Layouts can be created either&amp;nbsp;decoratively, using XML, or via code, using layout classes. The default 'Mono for Android Application' uses the declarative model, uses the &lt;i&gt;LinearLayout&lt;/i&gt;, and is defined in the 'Main.axml' file, inside of the project's 'Resources\Layout' folder. For more about Android layouts, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/ui/declaring-layout.html"&gt;http://developer.android.com/guide/topics/ui/declaring-layout.html&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Android Views&lt;/b&gt;&lt;br /&gt;
Android views are basic UI controls that represent visual elements in activities that render content, handle UI interaction events, etc. They are akin to the typical.Net controls, such as buttons, text labels, checkboxes, etc. Some examples of Android views are the &lt;i&gt;Button, CalendarView, CheckBox, DatePicker, EditText, GridView, LinearLayout, and TableLayout&lt;/i&gt;. The&lt;i&gt;ViewGroup&lt;/i&gt; is a view that only holds other views. It's analogous to the .Net &lt;i&gt;Panel&lt;/i&gt; control. The default 'Mono for Android Application' template comes with a &lt;i&gt;Button&lt;/i&gt; view. Views can be included in the application either declaratively or via objects in code. For more about Android views, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/view/View.html"&gt;http://developer.android.com/reference/android/view/View.html&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Resources&lt;/b&gt;&lt;br /&gt;
Android and the Mono for Android framework support storing information in XML resource files. The Mono for Android framework generates designer class files that reflect these resources. Each type of resource is located in the project's 'Resources' folder. The&amp;nbsp;'Mono for Android Application' template does a good job of providing these resources via the Resource.Designer.cs&amp;nbsp;designer-generated class file. Rather than reading an explanation about how resources work, take a look at figures #1 - #4 below for a more visual explanation. For more information about leveraging XML based resources, visit this URL:&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/resources/index.html"&gt;http://developer.android.com/guide/topics/resources/index.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Activity1.cs&lt;/b&gt;&lt;br /&gt;
This activity class is created by default when adding a new 'Mono for Android Application'. In its 'OnCreate' method, you'll see code that sets the content to be rendered in the Android Activity as well as an event handler to handle a button click. Each time this button is clicked, the button's caption is updated to the number of times it's been clicked.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Fig. 1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-a_Sv42gjJy8/TrcIqQyS5NI/AAAAAAAAAFQ/pWN2nkn4j_U/s1600/Mono+for+Android+Files.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-a_Sv42gjJy8/TrcIqQyS5NI/AAAAAAAAAFQ/pWN2nkn4j_U/s1600/Mono+for+Android+Files.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; margin-left: 1em; margin-right: 1em;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Fig. 2&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-yEdvhVbxQ40/TrbBfSVNxOI/AAAAAAAAAEY/FH8pqzBrfLU/s1600/Mono+for+Android+Resources.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-yEdvhVbxQ40/TrbBfSVNxOI/AAAAAAAAAEY/FH8pqzBrfLU/s1600/Mono+for+Android+Resources.png" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Fig. 3&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-o_SpdhMXMK4/TrbIs6rvnII/AAAAAAAAAEg/4fNYZo75A_c/s1600/Mono+for+Android+Activity+Resources.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-7F9QPKvmhGY/Trbkt2svcLI/AAAAAAAAAFI/G5Mb414ExgE/s1600/Mono+for+Android+Activity+Resources.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-7F9QPKvmhGY/Trbkt2svcLI/AAAAAAAAAFI/G5Mb414ExgE/s1600/Mono+for+Android+Activity+Resources.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Fig. 4&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-cgy8ftjm-SM/TrlXwiG_4uI/AAAAAAAAAFY/SEbiqC6ogCg/s1600/Mono+Android+String+Resources.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-cgy8ftjm-SM/TrlXwiG_4uI/AAAAAAAAAFY/SEbiqC6ogCg/s1600/Mono+Android+String+Resources.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="" style="clear: both; text-align: left;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Deploying &amp;amp; Testing the Mono for Android Application&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press the F5 key to debug and deploy the application to the Android simulator created earlier.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;In the 'Select Device' dialog box, click on the 'Start emulator image' link.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Do NOT choose any of the simulators created by the Android SDK.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Select the '&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;MonoDroid'&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;simulator created earlier.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on 'OK'. Wait for the 'Select Device' dialog box to show the emulator in the list. During this time, it will seem as is nothing's happening. Don't worry, something is.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The emulator will be setup on port, so the next screen you will see is the same 'Select Device' dialog box, except, you'll now see an emulator listed that's titled something like &lt;i&gt;emulator-5554&lt;/i&gt;. Click on the OK to select the emulator and get the application deployed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The first time the emulator is deployed, the Mono for Android framework takes some time to package the application for use with the simulator, install the Mono runtime and platform framework, etc, so please be patient. During this phase, it might seem like nothing's going on, but take a look at the Visual Studio status bar. It will show 'Deploy started...'. While this is the status, let the process proceed, even though you see the actual emulator in another window. This process can take up to 10 minutes to complete. Each time the project changes, the framework will detect this and re-package and deploy the application, so prepare for some ample wait times accordingly.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Eventually, the application is deployed (if no errors were encountered, that is). Drag the unlock button in the emulator to the right to unlock the Android.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-zTMQBnBRqdY/TrlmGZKjsHI/AAAAAAAAAFo/m1fRvmfk_Wo/s1600/Mono+Android+Unlock.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-zTMQBnBRqdY/TrlmGZKjsHI/AAAAAAAAAFo/m1fRvmfk_Wo/s1600/Mono+Android+Unlock.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the application button. &lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-qd3bUhTjXB0/TrlmdkYJjPI/AAAAAAAAAFw/wguEyrl8G7s/s1600/Mono+Android+App+Button.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-qd3bUhTjXB0/TrlmdkYJjPI/AAAAAAAAAFw/wguEyrl8G7s/s1600/Mono+Android+App+Button.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the application to launch it. It will take a few seconds for the application to load. It's ready when you can see the 'Hello World, Click Me!' button.&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-7Gb6NGwg1UE/Trlm8n5s-EI/AAAAAAAAAF4/EImYEbzT4xc/s1600/Mono+Android+Launch+App.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-7Gb6NGwg1UE/Trlm8n5s-EI/AAAAAAAAAF4/EImYEbzT4xc/s1600/Mono+Android+Launch+App.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the button to test the application. &lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-6vBtgGx6JKA/Trlp2uJx89I/AAAAAAAAAGA/00fLBL_tYvU/s1600/Mono+Android+App+Test.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-6vBtgGx6JKA/Trlp2uJx89I/AAAAAAAAAGA/00fLBL_tYvU/s1600/Mono+Android+App+Test.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Close the emulator window.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Let's Change Some Things&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The application's name isn't very unintuitive, so let's change it. There are several ways to set the application's name: via 1) the Visual Studio property pages, 2) editing the 'AndroidManifest.xml' file, and 3) the main class' &lt;i&gt;Activity&lt;/i&gt; attribute's &lt;i&gt;Label&lt;/i&gt; property.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting the Application Name via the Main Class' &lt;i&gt;Activity&lt;/i&gt; Attribute&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Activity1.cs' class file.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Change the Activity attribute's Label property to "App Name via Label Property".&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test the new name.&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-afLdsezX_Sw/Trlv23bejUI/AAAAAAAAAGI/h5SJ4aANuIE/s1600/Mono+Android+App+Name+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-afLdsezX_Sw/Trlv23bejUI/AAAAAAAAAGI/h5SJ4aANuIE/s1600/Mono+Android+App+Name+1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting the Application Name via the Visual Studio project's Property Pages&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;When the main class' Activity attribute's Label property is set, that label will override whatever the application's name is set to in other areas.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Remove the main class' &lt;i&gt;Activity&lt;/i&gt; attribute's &lt;i&gt;Label&lt;/i&gt; property, entirely.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Right-click on the project, then click on 'Properties'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Click on the 'Android Manifest' tab.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Change the 'Application name:' to &lt;i&gt;App Name via Prop Pages&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test the new name.&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-EnWfhTLP3ss/TrlxeFL_nmI/AAAAAAAAAGQ/egDkybtkJxE/s1600/Mono+Android+App+Name+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-EnWfhTLP3ss/TrlxeFL_nmI/AAAAAAAAAGQ/egDkybtkJxE/s1600/Mono+Android+App+Name+2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Setting the Application Name via the AndroidManifest.xml File&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Setting the application name via the VS property pages simply results in the 'AndroidManifest.xml' file's application element being changed.&lt;/span&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'AndroidManifest.xml' file in the 'Properties' folder in Visual Studio.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Locate and the 'application' element and change the 'android:label's string to &lt;i&gt;App Name via AndroidManifest.xml&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test the new name.&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-S1CSUGBJxrI/TrlyzZa4n4I/AAAAAAAAAGY/fqUz6cQGZDU/s1600/Mono+Android+App+Name+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-S1CSUGBJxrI/TrlyzZa4n4I/AAAAAAAAAGY/fqUz6cQGZDU/s1600/Mono+Android+App+Name+3.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Saving Strings in the Strings.xml Resource File&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;You can save strings in the 'Strings.xml' resource file and retrieve them at runtime via code. Let's create a new string resource for the Hello &lt;i&gt;Button&lt;/i&gt;'s &lt;i&gt;Text&lt;/i&gt; property.&lt;/span&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Strings.xml' file in the 'Resources\Values' folder.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Add the following XML element within the 'resources' element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;string name="HelloButtonText"&amp;gt;Button Text via Strings.xml&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F6 to compile the application. This will result in the 'Resource.Designer.cs' class being updated to reflect the new string resource.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Activity1.cs' class file.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Add the following line to the end of the 'OnCreate' method:&lt;br /&gt;
&lt;br /&gt;
button.Text = this.GetString(Resource.String.HelloButtonText);&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-j4ZMJHd6yvU/Trl4updYLuI/AAAAAAAAAGg/fX30gGUqHx4/s1600/Mono+Android+Strings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-j4ZMJHd6yvU/Trl4updYLuI/AAAAAAAAAGg/fX30gGUqHx4/s1600/Mono+Android+Strings.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test the changes. &lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-TeqkKXDtXJU/Trl5nRqbqsI/AAAAAAAAAGo/dfcmNGBKM1Q/s1600/Mono+Android+Strings+Test.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-TeqkKXDtXJU/Trl5nRqbqsI/AAAAAAAAAGo/dfcmNGBKM1Q/s1600/Mono+Android+Strings+Test.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Adding UI Elements Declaratively&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Main.axml' layout resource file in 'Resources\Layout'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Add the following element inside of the 'LinearLayout' element:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;Button
      android:id="@+id/DialogButton"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Dialog Button"
    /&amp;gt;

&lt;/pre&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F6 to compile the project in order for 'Resource.Designer.cs' to get updated. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Activity1.cs file'.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Add the following code to the end of the 'OnCreate' method:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;var dialogButton = FindViewById&amp;lt;Button&amp;gt;(Resource.Id.DialogButton);
dialogButton.Click += delegate 
{
                var builder = new AlertDialog.Builder(this);
                builder.SetMessage("Hello, World!");
                builder.SetCancelable(false);
                builder.SetPositiveButton("OK", delegate {  });
                var dialog = builder.Create();
                dialog.Show();
};

&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test your changes.&lt;br /&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-41dbpMRBpOk/TrmLWe6G3bI/AAAAAAAAAG4/AMzN6WZcRwI/s1600/Mono+Android+Dialog+Button.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-41dbpMRBpOk/TrmLWe6G3bI/AAAAAAAAAG4/AMzN6WZcRwI/s1600/Mono+Android+Dialog+Button.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Adding UI Elements Using Code&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Remove the &lt;i&gt;Button&lt;/i&gt; element you added to the 'Main.axml' file earlier.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Open up the 'Activity1.cs' class file.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Remove the &lt;i&gt;dialogButton&lt;/i&gt; line of code added earlier and replace it with the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;var dialogButton = new Button(this);
            dialogButton.Text = "Dialog Button";

&lt;/pre&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Press F5 to test your changes. The results should be exactly the same. Instead of using the XML based &lt;i&gt;Button&lt;/i&gt;, however, we created the button via the runtime code.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;That about does it for this tutorial. Be on the lookout for more!&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3549484185178226365?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3549484185178226365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3549484185178226365&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3549484185178226365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3549484185178226365'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/11/creating-your-first-mono-for-android.html' title='Creating your First Mono for Android Application'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-a_Sv42gjJy8/TrcIqQyS5NI/AAAAAAAAAFQ/pWN2nkn4j_U/s72-c/Mono+for+Android+Files.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-4149226738447657944</id><published>2011-09-01T09:55:00.000-07:00</published><updated>2011-09-13T14:59:57.207-07:00</updated><title type='text'>What to do when VS 2010's Website 'Copy Website' tool does not work.</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I had this annoying problem: every time I'd open up VS.NET 2010, open up a website project, and use the 'Copy Website' feature, I would have to re-setup my connection. It never saved my settings, copied files, etc. I ended up doing the following to resolve the problem.&lt;br /&gt;
&lt;br /&gt;
In Windows XP, delete everything in your &lt;i&gt;%HOMEDRIVE%\%HOMEPATH%\Local Settings\Application Data\Microsoft\WebsiteCache&lt;/i&gt; directory.&lt;br /&gt;
&lt;br /&gt;
That did it for me!&lt;br /&gt;
&lt;br /&gt;
However, the problem can recur if VS.NET creates a project folder in that directory that conflicts with another. For example, in my case, I typically call my website projects &lt;i&gt;WebUI&lt;/i&gt;. Using the copy tool will sometimes overwrite those folders, creating a problem. This is why I now edit the &lt;i&gt;Websites.xml&lt;/i&gt; file to ensure that each &lt;i&gt;CacheFolder&lt;/i&gt; is unique and does not clash with other website projects containing the same name (e.g., from &lt;i&gt;WebUI&lt;/i&gt; to &lt;i&gt;MyProject1WebUI&lt;/i&gt;).&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-4149226738447657944?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/4149226738447657944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=4149226738447657944&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4149226738447657944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4149226738447657944'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2011/09/what-to-do-when-vs-2010s-website-copy.html' title='What to do when VS 2010&apos;s Website &apos;Copy Website&apos; tool does not work.'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3905056300938334089</id><published>2010-09-01T16:11:00.000-07:00</published><updated>2010-09-05T09:06:20.113-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parameters'/><category scheme='http://www.blogger.com/atom/ns#' term='2010'/><category scheme='http://www.blogger.com/atom/ns#' term='ReportViewer'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='SetParameters'/><title type='text'>Infinite "Loading" Loop Message When Setting Parameters of an MS Report in ASP.NET 4.0 / 2010</title><content type='html'>&lt;p&gt;I encountered a problem when setting the parameters of a Microsoft Report object (i.e., an RDLC file created in VS.NET 2010) and rendering it via a ReportViewer control in an ASP.NET 4.0 web application: When loading the report, it infinitely displayed the 'Loading' box, never actually rendering the actual report. This occurs because the parameters set are posted back to the web server, to the &lt;em&gt;Reserved.ReportViewerWebControl.axd&lt;/em&gt; web resource, and if this is done on every page load event, the parameters are set infinitely (on each page load), with the web form never having a chance to complete. Therefore, the solution is to ensure the parameters are not set in a post-back event. Here's an example:
&lt;xmp&gt;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (!String.IsNullOrEmpty(Request.QueryString["ID"]))
                    {
                        var story = Service.StoryService.DefaultInstance.GetStory(int.Parse(Request.QueryString["ID"]), Domain.Story.GetStoriesCaller.AdministrationArea);
                        if (story != null)
                        {
                            this.reportViewer1.LocalReport.ReportPath = Server.MapPath("../Reports/Story.rdlc");

                            var parameters = new List&lt;Microsoft.Reporting.WebForms.ReportParameter&gt;();

                            parameters.Add(new Microsoft.Reporting.WebForms.ReportParameter("Title", story.Title, false));
                            parameters.Add(new Microsoft.Reporting.WebForms.ReportParameter("Body", story.Title, false));

                            this.reportViewer1.LocalReport.SetParameters(parameters);
                        }
                        else
                            throw new NullReferenceException(String.Format("No story was found matching story ID #{0}.", Request.QueryString["ID"]));
                    }
                    else
                        throw new NullReferenceException("No story ID string string was provided.");
                }
            }
            catch (Exception err)
            {
                this.OnError(err);
                DotNetFun.Sites.Service.ExceptionLogService.DefaultInstance.Add(
                    Error: err,
                    PageURL: Request.Url.AbsoluteUri,
                    UserID: (CurrentUser.IsLoggedIn ? CurrentUser.Info.UserID : (int?)null));
            }
        }
&lt;/xmp&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3905056300938334089?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3905056300938334089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3905056300938334089&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3905056300938334089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3905056300938334089'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2010/09/infinite-loading-loop-message-when.html' title='Infinite &quot;Loading&quot; Loop Message When Setting Parameters of an MS Report in ASP.NET 4.0 / 2010'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-4253822279021227791</id><published>2010-08-25T09:28:00.000-07:00</published><updated>2010-08-25T09:30:40.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='TF31002'/><title type='text'>Team Foundation Server TF31002 Error</title><content type='html'>Make sure that whoever is trying to connect to TFS is a member of the 'Team Foundation Licensed Users' group; otherwise, even administrators won't be able to access TFS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-4253822279021227791?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/4253822279021227791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=4253822279021227791&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4253822279021227791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4253822279021227791'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2010/08/team-foundation-server-tf31002-error.html' title='Team Foundation Server TF31002 Error'/><author><name>MTG C# Guy</name><uri>http://www.blogger.com/profile/05489942699668779727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3756294488096691065</id><published>2009-08-18T11:29:00.000-07:00</published><updated>2011-11-11T08:54:47.912-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Regular Expressions'/><category scheme='http://www.blogger.com/atom/ns#' term='Tab-delimited'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Removing Unwanted Text from Tab-delimited Files using Regex</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Use something like this:  &lt;br /&gt;
&lt;xmp style="background-color: #ffffdd; font-size: 12pt;color:black;"&gt;Regex.Replace("Tab data here....", "\\t|\\r|\\n|\\v|\\f|\\e|\\x20|\\040\\cC\\u0020", "")&lt;/xmp&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3756294488096691065?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3756294488096691065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3756294488096691065&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3756294488096691065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3756294488096691065'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/08/removing-unwanted-text-from-tab.html' title='Removing Unwanted Text from Tab-delimited Files using Regex'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-8005213561789842571</id><published>2009-08-05T14:55:00.000-07:00</published><updated>2011-11-11T08:54:27.063-08:00</updated><title type='text'>Settings DataSet/TableAdapter Connection Strings at Runtime</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
The DataSet's TableAdapter generates strongly types classes in VS.NET, with properties to connection strings that are read-only at runtime, unless, of course, you choose the "User" scope. Follow these steps for changing the connection string upon application startup:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open up the Settings.settings file, whatever it might be named in your project. If it's not there, create one by a) adding a new Settings file to your project, b) adding a new (Connection string) setting, c) save it, d) then ensure that each DataSet's TableAdapter's Connection property references this Settings file's (Connection string) setting.&lt;/li&gt;
&lt;li&gt;Press the F7 key to view its code.&lt;/li&gt;
&lt;li&gt;Add the following code to the Settings() constructor: &lt;xmp style="background-color: #ffffdd; color: black; font-size: 12pt;"&gt;this.SettingsLoaded += new System.Configuration.SettingsLoadedEventHandler(Settings_SettingsLoaded);&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Add the following method to the Settings class: &lt;xmp style="background-color: #ffffdd; color: black; font-size: 12pt;"&gt;        private void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)         {             try             {                 Settings.Default["PrizeWinsConnectionString"] = "PUT YOUR CONNECTION STRING HERE!";             }             catch (System.Exception err)             {                 throw;             }         }&lt;/xmp&gt; &lt;/li&gt;
&lt;li&gt;Save and recompile your project/solution.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-8005213561789842571?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/8005213561789842571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=8005213561789842571&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8005213561789842571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8005213561789842571'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/08/settings-datasettableadapter-connection.html' title='Settings DataSet/TableAdapter Connection Strings at Runtime'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3804100056634044056</id><published>2009-05-18T16:42:00.000-07:00</published><updated>2009-05-18T16:49:31.488-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Crystal Reports'/><title type='text'>Removing decimal places in VS.NET 2008's Crystal Reports</title><content type='html'>&lt;p&gt;There are times where the business requires numbers with decimal places to have those decimal places removed if the decimal value is zero. For example, it's better to display 707 than 707.00, but if it's 707.55, it still stays at 707.55. Here's how you can tell Crystal Reports to NOT use decimal places in this case.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open up the Crystal Report.&lt;/li&gt;
&lt;li&gt;Right-click on the decimal value field, then click on Format Object.&lt;/li&gt;
&lt;li&gt;Select the Number tab.&lt;/li&gt;
&lt;li&gt;Choose Custom Style, then click on the Customize button.&lt;/li&gt;
&lt;li&gt;Click on the X*2 button next to the Decimals drop-down box.&lt;/li&gt;
&lt;li&gt;Change it from Crystal Syntax to Basic Syntax.&lt;/li&gt;
&lt;li&gt;Enter something akin to the following code:&lt;xmp&gt;If ({TABLE.DECIMALFIELD} - Round({TABLE.DECIMALFIELD}, 0)) = 0.0 Then
    formula = 0
Else
    formula = 1
End If&lt;/xmp&gt;Where 0 and 1 are the number of decimal places.&lt;/li&gt;
&lt;li&gt;Click on the Save and Close button.&lt;/li&gt;
&lt;li&gt;Click on OK twice, then save the report.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3804100056634044056?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3804100056634044056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3804100056634044056&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3804100056634044056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3804100056634044056'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/05/removing-decimal-places-in-vsnet-2008s.html' title='Removing decimal places in VS.NET 2008&apos;s Crystal Reports'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-8213929030744914640</id><published>2009-03-31T13:08:00.000-07:00</published><updated>2009-03-31T13:16:22.345-07:00</updated><title type='text'>SQL Server 2005's EXCEPT &amp; INTERSECT Union-like Operators</title><content type='html'>&lt;p&gt;&lt;xmp style="background-color:#ffffdd;padding:5px;"&gt;SELECT name FROM master..sysobjects where name = 'all_columns'
UNION
SELECT name FROM master..sysobjects where name = 'routes';&lt;/xmp&gt;
Results:&lt;xmp&gt;name
-----------
all_columns
routes&lt;/xmp&gt;
&lt;xmp style="background-color:#ffffdd;padding:5px;"&gt;SELECT name FROM master..sysobjects where name = 'all_columns'
EXCEPT
SELECT name FROM master..sysobjects where name = 'routes';&lt;/xmp&gt;
Results:&lt;xmp&gt;name
-----------
all_columns&lt;/xmp&gt;
&lt;xmp style="background-color:#ffffdd;padding:5px;"&gt;SELECT name FROM master..sysobjects where name = 'all_columns'
INTERSECT
SELECT name FROM master..sysobjects where name = 'routes';&lt;/xmp&gt;
Results:&lt;xmp&gt;name
-----------
&lt;/xmp&gt;
&lt;xmp style="background-color:#ffffdd;padding:5px;"&gt;SELECT name FROM master..sysobjects where name = 'all_columns'
INTERSECT
SELECT name FROM master..sysobjects where name = 'all_columns';&lt;/xmp&gt;
Results:&lt;xmp&gt;name
-----------
all_columns&lt;/xmp&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-8213929030744914640?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/8213929030744914640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=8213929030744914640&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8213929030744914640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8213929030744914640'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/sql-server-2005s-except-intersect-union.html' title='SQL Server 2005&apos;s EXCEPT &amp; INTERSECT Union-like Operators'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3710060934013645188</id><published>2009-03-31T12:40:00.000-07:00</published><updated>2009-03-31T13:04:33.783-07:00</updated><title type='text'>SQL Server 2005's Ranking Functions</title><content type='html'>&lt;p&gt;You can create columns that provide unique ranking/sorting capabilities. For example, &lt;b&gt;ROW_NUMBER()&lt;/b&gt; (produces unique row numbers):
&lt;xmp style="background-color:#FFFFDD;"&gt;SELECT ROW_NUMBER() OVER (ORDER BY name) AS ROWNUM, name FROM sysobjects;&lt;/xmp&gt;
The preceding query produces the following results:&lt;xmp&gt;ROWNUM               name
-------------------- --------------------------------------------------------------------------------------------------------------------------------
1                    CoOp
2                    Country
3                    DF__dtpropert__versi__77BFCB91
4                    DF_Carriage_CarriageTypeName
5                    DF_CoOp_CoOpName
6                    DF_Country_CountryName
7                    DF_ExceptionLog_Occurred
8                    DF_History_ActionDateTime
9                    DF_History_ActionTakenByUserID
10                   DF_History_Comments
11                   DF_History_ETA
12                   DF_History_LastNoticeStatusID
.....&lt;/xmp&gt;
Or, there's &lt;b&gt;RANK()&lt;/b&gt; (produces non-unique sorting numbers with possible gaps/skips in the sequence)...&lt;xmp style="background-color:#FFFFDD;"&gt;SELECT RANK() OVER (ORDER BY name asc) AS RANK, name FROM master..syscolumns WHERE LEN(name) &gt; 0;&lt;/xmp&gt;
That query produces this:&lt;xmp&gt;RANK                 name
-------------------- --------------------------------------------------------------------------------------------------------------------------------
1                    @10data
1                    @10data
3                    @11data
3                    @11data
5                    @12data
5                    @12data
7                    @13data
7                    @13data
9                    @14data
9                    @14data
11                   @15data
11                   @15data
13                   @16data
13                   @16data
.....&lt;/xmp&gt;
Or, there's &lt;b&gt;DENSE_RANK()&lt;/b&gt; (produces non-unique sorting numbers with NO gaps/skips in the sequence)...&lt;xmp style="background-color:#FFFFDD;"&gt;SELECT DENSE_RANK() OVER (ORDER BY name asc) AS RANK, name FROM master..syscolumns WHERE LEN(name) &gt; 0;&lt;/xmp&gt;
That will produce this:&lt;xmp&gt;RANK                 name
-------------------- --------------------------------------------------------------------------------------------------------------------------------
1                    @10data
1                    @10data
2                    @11data
2                    @11data
3                    @12data
3                    @12data
4                    @13data
4                    @13data
5                    @14data
5                    @14data
6                    @15data
6                    @15data
7                    @16data
7                    @16data
......&lt;/xmp&gt;
Then there's the interesting &lt;b&gt;NTILE(n)&lt;/b&gt; function. This will produce partitioned/divided result sets with equal sequenced numbers, like this:&lt;xmp style="background-color:#FFFFDD;"&gt;WITH SystemObjects AS ( SELECT TOP 10 name FROM master..sysobjects ) 
SELECT NTILE(5) OVER (ORDER BY name) AS 'NTILE(5)', name from SystemObjects;&lt;/xmp&gt;
That query produces the following output, with the numbers 1 through 5 having a set of 2 for each divided/partitioned section:&lt;xmp&gt;NTILE(5)             name
-------------------- --------------------------------------------------------------------------------------------------------------------------------
1                    all_columns
1                    all_objects
2                    all_parameters
2                    all_sql_modules
3                    all_views
3                    allocation_units
4                    assemblies
4                    assembly_files
5                    assembly_modules
5                    assembly_references&lt;/xmp&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3710060934013645188?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3710060934013645188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3710060934013645188&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3710060934013645188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3710060934013645188'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/sql-server-2005s-ranking-functions.html' title='SQL Server 2005&apos;s Ranking Functions'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3439671755235276449</id><published>2009-03-26T14:41:00.000-07:00</published><updated>2009-03-26T15:20:41.615-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Creating Pivoted Joins in SQL Server 2005</title><content type='html'>&lt;p&gt;You can take a vertical result set and turn it into a horizontal one, like this:
&lt;xmp&gt;DECLARE @TBLTEMP TABLE (Make VARCHAR(32), Model VARCHAR(12), License VARCHAR(12));
INSERT INTO @TBLTEMP VALUES ('BMW', '380i', 'GS45PK1');
INSERT INTO @TBLTEMP VALUES ('BMW', '380i', 'KL45QZ1');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M5', 'QL4AQ91');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M3', '345JK12');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M3', 'RT5JJK2');

SELECT DISTINCT tmp.Make, [380i], [M5], [M3]
 FROM @TBLTEMP tmp
  INNER JOIN (SELECT Make, Model FROM @TBLTEMP) PivotTable 
   PIVOT ( COUNT(Model) FOR Model IN ([380i],[M5],[M3]) ) PivotColumns 
   ON tmp.Make = PivotColumns.Make;
&lt;/xmp&gt;
&lt;/p&gt;

&lt;p&gt;The preceding query takes a count of how many licenses belong to which BMW models, and displays them horizontally. The output should be something like this:
&lt;xmp&gt;Make                             380i        M5          M3
-------------------------------- ----------- ----------- -----------
BMW                              2           1           2
&lt;/xmp&gt;&lt;/p&gt;

&lt;p&gt;If were were to utilize a simple select statement, it would look something like this:
&lt;xmp&gt;DECLARE @TBLTEMP TABLE (Make VARCHAR(32), Model VARCHAR(12), License VARCHAR(12));
INSERT INTO @TBLTEMP VALUES ('BMW', '380i', 'GS45PK1');
INSERT INTO @TBLTEMP VALUES ('BMW', '380i', 'KL45QZ1');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M5', 'QL4AQ91');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M3', '345JK12');
INSERT INTO @TBLTEMP VALUES ('BMW', 'M3', 'RT5JJK2');

SELECT Make, Model, COUNT(*) AS [Count] FROM @TBLTEMP
GROUP BY Make, Model;
&lt;/xmp&gt;The results being this:
&lt;xmp&gt;
Make                             Model        Count
-------------------------------- ------------ -----------
BMW                              380i         2
BMW                              M3           2
BMW                              M5           1
&lt;/xmp&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3439671755235276449?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3439671755235276449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3439671755235276449&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3439671755235276449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3439671755235276449'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/creating-pivoted-joins-in-sql-server.html' title='Creating Pivoted Joins in SQL Server 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-1590388082498788275</id><published>2009-03-25T17:13:00.000-07:00</published><updated>2009-03-26T13:39:46.809-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Random Data Sampling Queries in SQL Server 2005</title><content type='html'>&lt;p&gt;The following query will return a random sampling of data:
&lt;xmp&gt;
SELECT * FROM TBLAPPLICATIONLOG TABLESAMPLE SYSTEM (10 PERCENT);
SELECT * FROM TBLAPPLICATIONLOG TABLESAMPLE SYSTEM (200 ROWS);
&lt;/xmp&gt;
Not only will the records returned be random, but so will the number of rows.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-1590388082498788275?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/1590388082498788275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=1590388082498788275&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1590388082498788275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1590388082498788275'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/random-data-sampling-queries-in-sql.html' title='Random Data Sampling Queries in SQL Server 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-4506783905480488542</id><published>2009-03-25T16:52:00.000-07:00</published><updated>2009-03-25T17:06:44.787-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>New Join Types in SQL Server 2005</title><content type='html'>&lt;p&gt;
&lt;span style="font-weight: bold;"&gt;CROSS APPLY (equivalent to an inner join)&lt;/span&gt;:
&lt;xmp&gt;SELECT so.name as ObjectName, sc.ColumnName
FROM sysobjects so
 CROSS APPLY (
  SELECT name AS ColumnName
  FROM syscolumns WHERE so.id = id
 ) sc
ORDER BY so.name, sc.ColumnName&lt;/xmp&gt;
You will get no null ColumnName fields because this is equivalent to an inner join, so only objects with matching columns or parameters, in the case of SPROCs and functions, will be returned.
&lt;/p&gt;

&lt;p&gt;
&lt;span style="font-weight: bold;"&gt;OUTER APPLY (equivalent to a left join)&lt;/span&gt;:
&lt;xmp&gt;SELECT so.name as ObjectName, sc.ColumnName
FROM sysobjects so
 OUTER APPLY (
  SELECT name AS ColumnName
  FROM syscolumns WHERE so.id = id
 ) sc
ORDER BY so.name, sc.ColumnName&lt;/xmp&gt;
You will get any type of object, even non-tables, non-SPROCs, etc, will have their ColumnName fields as null, as this is equivalent to a left join.
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note that any object with no parameter or column will not have an any records in the syscolumns table (eg, SPROCs with no parameters).&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-4506783905480488542?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/4506783905480488542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=4506783905480488542&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4506783905480488542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4506783905480488542'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/new-join-types-in-sql-server-2005.html' title='New Join Types in SQL Server 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-7942761813520241996</id><published>2009-03-25T16:05:00.000-07:00</published><updated>2009-03-25T16:07:35.784-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Using Common Table Expressions in SQL Server 2005</title><content type='html'>&lt;p&gt;
Pretty cool stuff:
&lt;xmp&gt;
-- Common Table Expressions example:

WITH tblDBs AS
(
 SELECT COUNT(*) AS [Number of Databases] FROM sysdatabases
), 
tblTables AS 
(
 SELECT COUNT(*) AS [Number of Tables] FROM sysobjects WHERE xtype = 'U'
),
tblColumns AS
(
 SELECT COUNT(*) AS [Number of Columns] FROM syscolumns
)
SELECT * FROM tblDBs db, tblTables, tblColumns;
&lt;/xmp&gt;
&lt;/p&gt;
&lt;p&gt;
Results from my DB:
&lt;xmp&gt;
Number of Databases Number of Tables Number of Columns
------------------- ---------------- -----------------
23                  6                11258

(1 row(s) affected)
&lt;/xmp&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-7942761813520241996?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/7942761813520241996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=7942761813520241996&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7942761813520241996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7942761813520241996'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/using-common-table-expressions-in-sql.html' title='Using Common Table Expressions in SQL Server 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-7066969742879055836</id><published>2009-03-24T11:39:00.000-07:00</published><updated>2009-03-31T12:40:45.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>ASP.NET MVC - Validation of viewstate MAC failed.</title><content type='html'>&lt;p&gt;Yup, View State is not supported in MVC, so beware of this. If you try to use a control that relies on it, you'll get the following error:&lt;blockquote&gt;Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Note that you can still use ViewState with ASPX/Web Forms as Views  in MVC, but that violates the MVC pattern.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-7066969742879055836?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/7066969742879055836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=7066969742879055836&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7066969742879055836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7066969742879055836'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/aspnet-mvc-validation-of-viewstate-mac.html' title='ASP.NET MVC - Validation of viewstate MAC failed.'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2968632427406728327</id><published>2009-03-24T11:19:00.000-07:00</published><updated>2009-03-24T11:21:56.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>ASP.NET MVC - Preventing an Action Method from Being Called Publicly</title><content type='html'>&lt;p&gt;By default, any action method defined in a controller class can be called via a browser request. To prevent this, simply mark the method with the [NonAction] attribute:
&lt;xmp&gt;        [NonAction]
        public ActionResult Index(int AreaCode)
        {
            return View();
        }&lt;/xmp&gt; The result of calling a non-action method will be an HTTP 404 error: "The resource cannot be found."&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2968632427406728327?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2968632427406728327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2968632427406728327&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2968632427406728327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2968632427406728327'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/aspnet-mvc-preventing-action-method.html' title='ASP.NET MVC - Preventing an Action Method from Being Called Publicly'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2219231215268261761</id><published>2009-03-24T10:39:00.001-07:00</published><updated>2009-03-24T10:57:10.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>ASP.NET MVC - Creating Routing Constraints</title><content type='html'>&lt;p&gt;To restrict the format of the parameter passed to an action method, you can create a custom route with a regular expression to determine in what format you want the parameter.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open up the Global.asax file.&lt;/li&gt;
&lt;li&gt;Add the following routing code, right above the default route:
&lt;xmp&gt;            routes.MapRoute(
                "Test1",
                "Test1/{AreaCode}",
                new { controller = "Test1", action = "Index" },
                new { AreaCode = @"[1-9][0-9][0-9]" }
                );&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Save the file and compile (Ctrl-Shift-B) and load the application (Ctrl-F5).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The controller action method (in the Test1Controller.cs class file) for the preceding route should look something like this (provided a View was created for that action result:
&lt;xmp&gt;        public ActionResult Index(int AreaCode)
        {
            return View();
        }&lt;/xmp&gt;&lt;/p&gt;

&lt;p&gt;Test1 refers to the controller, Index refers to the action, or method, and {AreaCode} refers to the parameter passed to that action/method. When it runs, MVC calls the following method: Test1Controller.Index(AreaCode). The "[1-9][0-9][0-9]" regular expression ensures that the parameter passed contain 3 digits, no more, no less. If the constraint is violated, a "The resource cannot be found." error code is returned.&lt;/p&gt;

&lt;p&gt;The following URL is valid for the preceding example: http://localhost:????/Test1/111&lt;/p&gt;

&lt;p&gt;The following URLs are NOT valid for the preceding example:&lt;br /&gt;http://localhost:????/Test1/11x&lt;br /&gt;http://localhost:????/Test1/11&lt;br /&gt;http://localhost:????/Test1/1123&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2219231215268261761?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2219231215268261761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2219231215268261761&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2219231215268261761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2219231215268261761'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/aspnet-mvc-creating-routing-constraints.html' title='ASP.NET MVC - Creating Routing Constraints'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-181391910483456360</id><published>2009-03-23T19:44:00.000-07:00</published><updated>2009-03-23T20:28:24.237-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>ASP.NET MVC - Creating Custom Routes</title><content type='html'>&lt;p&gt;The following directions will create both a custome MVC route and show how you can return something other than a View.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Adding a custom route&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Open up the ASP.NET MVC VS.NET project.&lt;/li&gt;
&lt;li&gt;Open up the Global.asax file.&lt;/li&gt;
&lt;li&gt;Add the following code, right above the default routing code:
&lt;xmp&gt;            routes.Add(
                "DotNetFun",
                "DotNetFun/{GUID}",
                new { controller = "DotNetFun", action = "Article" }
                );&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;In the preceding route, DotNetFun refers to the controller, Article refers to the action method, and {GUID} refers to the parameter passed to the method, in the form of a valid Guid.&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on the Controllers folder, then click on Add--&gt;Controller.&lt;/li&gt;
&lt;li&gt;Name the controller DotNetFunController.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Modify the existing Index method so that it looks like the following:
&lt;xmp&gt;        public String Article(Guid GUID)
        {
            return GUID.ToString();
        }&lt;/xmp&gt;Notice how the name of the method changes completely.&lt;/li&gt;
&lt;li&gt;Save the file.&lt;/li&gt;
&lt;li&gt;Right click inside of the Article method, then click on Add View...&lt;/li&gt;
&lt;li&gt;Leave the defaults, then click on Add.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-B to compile your project, then click on Ctrl-F5 to test it.&lt;/li&gt;
&lt;li&gt;You should be able to get to the related path like this: http://localhost:????/DotNetFun/8599AE31-2409-4875-9ECF-0698FAE23EDA&lt;/li&gt;
&lt;li&gt;Again, DotNetFun refers to the controller and 8599AE31-2409-4875-9ECF-0698FAE23EDA to the Guid value passed as a parameter to that method. We don't need to add Article to the URL, since the controller is mapped to it already. We could always demand it by modifying the route, like this:
&lt;xmp&gt;            routes.MapRoute(
                "DotNetFun",
                "DotNetFun/{action}/{GUID}",
                new { controller = "DotNetFun", action = "Article" }
                );&lt;/xmp&gt;Then, we could use the following URL: http://localhost:????/DotNetFun/Article/8599AE31-2409-4875-9ECF-0698FAE23EDA&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Returning content other than a View&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;By default MVC returns a View, which is typically in the form of an ASPX web form, but you can return a string, too. To do this, for example, modify the preceding DotNetFun controller action created above:
&lt;xmp&gt;        public String Article(Guid GUID)
        {
            return String.Format("You passed to the Article method this GUID: {0}", GUID.ToString());
        }&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Recompile the application.&lt;/li&gt;
&lt;li&gt;The result should reveal something like this: You passed to the Article method this GUID: 8599ae31-2409-4875-9ecf-0698fae23eda&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Please note that if the parameter passed is not a valid Guid, you'll get the following error:&lt;blockquote&gt;The parameters dictionary contains a null entry for parameter 'GUID' of non-nullable type 'System.Guid' for method 'System.String Article(System.Guid)' in 'MVCTest.Controllers.DotNetFunController'. To make a parameter optional its type should be either a reference type or a Nullable type.
Parameter name: parameters 
&lt;/blockquote&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-181391910483456360?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/181391910483456360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=181391910483456360&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/181391910483456360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/181391910483456360'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/aspnet-mvc-creating-custom-routes.html' title='ASP.NET MVC - Creating Custom Routes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-7267414623896487311</id><published>2009-03-23T14:45:00.000-07:00</published><updated>2009-03-23T16:45:50.983-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>Getting Started with ASP.NET's MVC (Model View Controller)</title><content type='html'>&lt;ol&gt;
&lt;li&gt;Download and install &lt;a href="http://go.microsoft.com/fwlink/?LinkId=144444" target="_blank"&gt;MVC 1.0&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Create the MVC project.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Startup VS.NET 2008.&lt;/li&gt;
&lt;li&gt;Click on File--&gt;New--&gt;Project.&lt;/li&gt;
&lt;li&gt;Choose the Web project type.&lt;/li&gt;
&lt;li&gt;Choose the ASP.NET MVC Web Application&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Create the Controller.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on the Controllers tab, then click on Add--&gt;Controller.&lt;/li&gt;
&lt;li&gt;Name it Test, then click on OK.&lt;/li&gt;
&lt;li&gt;Open up the Test1Controller.cs class file, in the Controllers folder.&lt;/li&gt;
&lt;li&gt;Modify the Index() method so that it looks like this:&lt;xmp&gt;
        public ActionResult Index(int ID)
        {
            return View();
        }
&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Save it.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Create the action.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Right click inside of the Index method, then click on Add view...&lt;/li&gt;
&lt;li&gt;Leave the defaults, then click on Add.&lt;/li&gt;
&lt;li&gt;In the Views folder, notice that the Index.aspx page was added to the Test1 folder.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-B to compile the application.&lt;/li&gt;
&lt;li&gt;Press Ctrl-F5 to run the application.&lt;/li&gt;
&lt;li&gt;The following URL will map to the Test1 controller, action, and view: http://localhost:????/Test1/Index/1&lt;br /&gt;Test1 is the controller. Index is the action, defined as a method inside the controller class, and 1 is the ID integer passed to that method. When that URL is process, the following method is called: Test1Controller.Index(1)&lt;/li&gt;
&lt;li&gt;To make the ID integer options, convert the type from int to a nullable integer: int?&lt;xmp&gt;
        public ActionResult Index(int? ID)
        {
            return View();
        }&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;After that, you should be able to omit the ID, like this: http://localhost:????/Test1/Index/ or http://localhost:????/Test1/&lt;/li&gt;
&lt;li&gt;Remember to compile the application every time a code change is performed.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-7267414623896487311?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/7267414623896487311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=7267414623896487311&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7267414623896487311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7267414623896487311'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/getting-started-with-aspnets-mvc-model.html' title='Getting Started with ASP.NET&apos;s MVC (Model View Controller)'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-4019885059748765985</id><published>2009-03-19T11:28:00.000-07:00</published><updated>2009-03-19T11:55:52.796-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Controls'/><title type='text'>Be Careful Using OnClientClick with ASP.NET Web Controls</title><content type='html'>&lt;p&gt;When using the OnClientClick property of Web Controls in ASP.NET, especially when the Web Controls involved have their CausesValidation property set to true, validation and related post-backs will be ugly and not function correctly. OnClientClick seems to work well, however, with Web Controls whose CausesValidation property is set to false.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-4019885059748765985?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/4019885059748765985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=4019885059748765985&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4019885059748765985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4019885059748765985'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/03/be-careful-using-onclientclick-with.html' title='Be Careful Using OnClientClick with ASP.NET Web Controls'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-8188979746774090104</id><published>2009-02-17T11:32:00.001-08:00</published><updated>2009-02-17T11:34:28.301-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>When SQL Server 2005 doesn't Cleanly Remove Log Shipping</title><content type='html'>There have been times when I've setup log shipping for several DBs in SQL Server 2005 then later removed the option, only to have Log Shipping Alert job raise errors regarding these no-longer-log-shipped DBs. To clean references to them, delete (CAREFULLY) records in the msdb DB that pertains to log shipping.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-8188979746774090104?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/8188979746774090104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=8188979746774090104&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8188979746774090104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/8188979746774090104'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2009/02/when-sql-server-2005-doesnt-cleanly.html' title='When SQL Server 2005 doesn&apos;t Cleanly Remove Log Shipping'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-962068980610760726</id><published>2008-12-17T11:08:00.000-08:00</published><updated>2008-12-17T11:13:24.662-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='intellisense'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><title type='text'>Unrecognized tag prefix or device filter 'asp'. Intellisense stops working!</title><content type='html'>In VS.NET 2008, when declaring that all ASP.NET web forms use a MasterPage via the web.config file, intellisense might not work. I've found that if I explicitly declare the MasterPageFile property via the form's Page directive, intellisense begins to work again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-962068980610760726?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/962068980610760726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=962068980610760726&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/962068980610760726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/962068980610760726'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/12/unrecognized-tag-prefix-or-device.html' title='Unrecognized tag prefix or device filter &apos;asp&apos;. Intellisense stops working!'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-1403355952498840972</id><published>2008-08-30T11:43:00.000-07:00</published><updated>2008-09-01T16:06:02.810-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Simplify &amp; Write Much-Less JavaScript Code with jQuery</title><content type='html'>&lt;h4&gt;jQuery - A New Way to Write Common JavaScript Design Patterns in a Lot Less Code&lt;/h4&gt;

&lt;script type="text/javascript" src="http://www.dotnetfun.com/articles/jQuery/jquery-1.2.6.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
&lt;!-- jQuery code, by Mike G. @ DotNetFun.com

// Add a body.onload event handler, which is called only when 
// ALL document elements have loaded, including all images:
$(document).ready(function()
{
 // NOTE: ALL FURTHER JAVASCRIPT/JQUERY CODE SHOULD 
 // BE DEFINED WITHIN THIS FUNCTION, EXCEPT FOR OTHER 
 // CLASSES AND FUNCTIONS, OF COURSE.

 // Faded, gradual showing of a division block; 
 // the callback function is optional.
 $("#btnSample1").click(function()
 {
  // 3,000 milliseconds used here; it can also be 
  // "slow", "normal", or "fast"
  $("#divSample1").show(3000, divSample1_Callback);
 });

 // Toggles the visibility between two elements/objects:
 $("#btnSample2").click(function()
 {
  $("#spanSample2a,#spanSample2b").toggle();
 });

 // Faded, gradual showing of a division block, sliding downward:
 $("#btnSample3").click(function()
 {
  $("#divSample3").hide();
  $("#divSample3").slideDown("slow");
  
 });

 // Faded, gradual showing of a division block, sliding downward:
 $("#btnSample4").click(function()
 {
  $("#divSample4").show();
  $("#divSample4").slideUp("slow");
 });

 // Toggles the visibility of an element/object, 
 // in a fading, gradual manner, upward and downward
 $("#btnSample5").click(function()
 {
  $("#divSample5").slideToggle("slow");
 });

});

// Callback function for the preceding divSample1 show call:
function divSample1_Callback()
{
 alert("This is the result of the callback function - divSample1_Callback.\r\n\r\n" + 
  "Clicking on OK will re-hide the divSample1 block.");
 
 // Now, re-hide the divSample1 block, after a 3,000 millisecond 
 // gradual delay/fade:
 $("#divSample1").hide(3000);
}

//--&gt;
&lt;/script&gt;

&lt;p&gt;&lt;a href="http://www.jquery.com"&gt;Click here to visit the jQuery website.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;jQuery is a very basic, but very powerful, JavaScript coding methodology and code set for writing common, dynamic, JavaScript-enabled web functionality, using a lot less code than you would use to write the same functionality otherwise. jQuery is, technically, a set of code wrappers: code written by developers that simplify common tasks. They've written what would normally be more complicated coding/design patterns and made them available as easy-to-use methods, classes, etc. What I like the most about jQuery is its 1) ease of use &amp; installation, 2) easy-to-use effects library, and 3) broad-range-browser compatibility.&lt;/p&gt;

&lt;h4&gt;Installing jQuery&lt;/h4&gt;

&lt;p&gt;jQuery is simply one JavaScript file (.js)! You simply &lt;a target="_blank" href="http://docs.jquery.com/Downloading_jQuery"&gt;download the latest version from the jQuery site&lt;/a&gt;, then include it in your page, like this:
&lt;xmp&gt;&lt;script type="text/javascript" src="jquery-1.2.6.js"&gt;&lt;/script&gt;&lt;/xmp&gt;&lt;/p&gt;

&lt;h4&gt;Execute Code Not when the Page Loads, but when Every Object on the Page has Loaded, Including All Images&lt;/h4&gt;

&lt;p&gt;&lt;xmp&gt;// Add a body.onload event handler, which is called only when 
// ALL document elements have loaded, including all images:
$(document).ready(function()
{
 alert("Hello, this is jQuery-called called!");
});&lt;/xmp&gt;

&lt;h4&gt;Showing and Hiding HTML Elements, Gradually&lt;/h4&gt;
&lt;xmp&gt;&lt;script type="text/javascript"&gt;
&lt;!-- jQuery code, by Mike G. @ DotNetFun.com

// Add a body.onload event handler, which is called only when 
// ALL document elements have loaded, including all images:
$(document).ready(function()
{
 // NOTE: ALL FURTHER JAVASCRIPT/JQUERY CODE SHOULD 
 // BE DEFINED WITHIN THIS FUNCTION, EXCEPT FOR OTHER 
 // CLASSES AND FUNCTIONS, OF COURSE.

 // Faded, gradual showing of a division block; 
 // the callback function is optional.
 $("#btnSample1").click(function()
 {
  // 3,000 milliseconds used here; it can also be 
  // "slow", "normal", or "fast"
  $("#divSample1").show(3000, divSample1_Callback);
 });

});

// Callback function for the preceding divSample1 show call:
function divSample1_Callback()
{
 alert("This is the result of the callback function - divSample1_Callback.\r\n\r\n" + 
  "Clicking on OK will re-hide the divSample1 block.");
 
 // Now, re-hide the divSample1 block, after a 3,000 millisecond 
 // gradual delay/fade:
 $("#divSample1").hide(3000);
}

//--&gt;
&lt;/script&gt;

&lt;div id="divSample1" style="display:none"&gt;Faded, gradual showing of a division block&lt;/div&gt;
&lt;button id="btnSample1"&gt;Show it&lt;/button&gt;&lt;/xmp&gt;
&lt;b&gt;Click on the following button to test the show() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample1" style="display:none"&gt;Faded, gradual showing of a division block&lt;/div&gt;
&lt;button id="btnSample1"&gt;Show it #1&lt;/button&gt;&lt;/p&gt;

&lt;h4&gt;Toggle the Visibility Between Two Elements/Objects&lt;/h4&gt;

&lt;xmp&gt;&lt;script type="text/javascript"&gt;
$(document).ready(function()
{
 // Toggles the visibility between two elements/objects:
 $("#btnSample2").click(function()
 {
  $("#spanSample2a,#spanSample2b").toggle();
 });
});
&lt;/script&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the toggle() code.&lt;/b&gt;&lt;br /&gt;
&lt;span id="spanSample2a"&gt;Hello!&lt;/span&gt;
&lt;span id="spanSample2b" style="display:none"&gt;Goodbye!&lt;/span&gt;
&lt;button id="btnSample2"&gt;Toggle it&lt;/button&gt;&lt;/p&gt;&lt;/xmp&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the toggle() code.&lt;/b&gt;&lt;br /&gt;
&lt;span id="spanSample2a"&gt;Hello!&lt;/span&gt;
&lt;span id="spanSample2b" style="display:none"&gt;Goodbye!&lt;/span&gt;
&lt;button id="btnSample2"&gt;Toggle it&lt;/button&gt;&lt;/p&gt;

&lt;h4&gt;Gradually Show an Element, Sliding Downward&lt;/h4&gt;

&lt;xmp&gt;&lt;script type="text/javascript"&gt;
$(document).ready(function()
{
 // Faded, gradual showing of a division block, sliding downward:
 $("#btnSample3").click(function()
 {
  $("#divSample3").hide();
  $("#divSample3").slideDown("slow");
  
 });

});
&lt;/script&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideDown() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample3" style="display:none; background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample3"&gt;Slide it&lt;/button&gt;&lt;/p&gt;&lt;/xmp&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideDown() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample3" style="display:none; background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample3"&gt;Slide it&lt;/button&gt;&lt;/p&gt;

&lt;h4&gt;Gradually Show an Element, Sliding Upward&lt;/h4&gt;

&lt;xmp&gt;&lt;script type="text/javascript"&gt;
$(document).ready(function()
{
 // Faded, gradual showing of a division block, sliding downward:
 $("#btnSample4").click(function()
 {
  $("#divSample4").show();
  $("#divSample4").slideUp("slow");
 });
});
&lt;/script&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideDown() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample4" style="background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample4"&gt;Slide it&lt;/button&gt;&lt;/p&gt;&lt;/xmp&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideUp() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample4" style="background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample4"&gt;Slide it&lt;/button&gt;&lt;/p&gt;

&lt;h4&gt;Toggle the Visibility of an Element/Object, Gradually, Upward &amp; Downward&lt;/h4&gt;

&lt;xmp&gt;&lt;script type="text/javascript"&gt;
$(document).ready(function()
{
// Toggles the visibility of an element/object, 
 // in a fading, gradual manner, upward and downward
 $("#btnSample5").click(function()
 {
  $("#divSample5").slideToggle("slow");
 });
}
&lt;/script&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideToggle() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample5" style="display:none; background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample5"&gt;Slide toggle&lt;/button&gt;&lt;/p&gt;&lt;/xmp&gt;

&lt;p&gt;&lt;b&gt;Click on the following button to test the slideToggle() code.&lt;/b&gt;&lt;br /&gt;
&lt;div id="divSample5" style="display:none; background-color:Red; width:100px; height:50px;"&gt;&lt;/div&gt;
&lt;button id="btnSample5"&gt;Slide toggle&lt;/button&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-1403355952498840972?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/1403355952498840972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=1403355952498840972&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1403355952498840972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1403355952498840972'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/08/simplify-write-much-less-javascript.html' title='Simplify &amp; Write Much-Less JavaScript Code with jQuery'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3819135135173432771</id><published>2008-06-13T19:21:00.000-07:00</published><updated>2008-06-13T19:45:41.089-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><title type='text'>MS SQL Server 2008 - New Features - SSMS Table Re-creation Prevention</title><content type='html'>&lt;p&gt;One annoying new feature in SSMS is that when you make a change to a table using the Designer which requires the table to be re-created, such as creating an identity column, by default, you'll get the following message:&lt;br /&gt;
&lt;blockquote&gt;
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.
&lt;/blockquote&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFMuPBJ7xXI/AAAAAAAAAHM/9SLdV0BIk40/s400/SSMS+Saving+changes+is+not+permitted.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211560029340812658" /&gt;
&lt;/p&gt;

&lt;p&gt;
To prevent this message from re-appearing, perform the following steps:
&lt;ol&gt;
&lt;li&gt;In SSMS, click on Tools, then Options.&lt;/li&gt;
&lt;li&gt;Open up the Designers node.&lt;/li&gt;
&lt;li&gt;Click on "Table and Database Designers".&lt;/li&gt;
&lt;li&gt;Uncheck the checkbox labeled "Prevent saving changes that require table re-creation".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFMuOFUTlVI/AAAAAAAAAHE/lwrbJWdadPE/s400/SSMS+Options+Table+Designers.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211560013278188882" /&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3819135135173432771?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3819135135173432771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3819135135173432771&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3819135135173432771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3819135135173432771'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/ms-sql-server-2008-new-features_13.html' title='MS SQL Server 2008 - New Features - SSMS Table Re-creation Prevention'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_LdNeXsKHo20/SFMuPBJ7xXI/AAAAAAAAAHM/9SLdV0BIk40/s72-c/SSMS+Saving+changes+is+not+permitted.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2339516516954625696</id><published>2008-06-12T14:53:00.000-07:00</published><updated>2008-06-12T15:56:09.054-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><title type='text'>MS SQL Server 2008 - New Features - Auditing</title><content type='html'>&lt;h4&gt;You can now audit specific events in SQL Server 2008&lt;/h4&gt;
&lt;p&gt;The following steps will walk through how you can setup MS SQL Server 2008 to audit failed logons.&lt;/p&gt;

&lt;h4&gt;Auditing Failed Logons&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Login to MS SQL Server Management Studio (SSMS).&lt;/li&gt;
&lt;li&gt;Expand the &lt;b&gt;Security&lt;/b&gt; folder.&lt;/li&gt;
&lt;li&gt;Right-click on the &lt;b&gt;Audits&lt;/b&gt; folder, then click on &lt;b&gt;New Audit...&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;b&gt;Audit name&lt;/b&gt; field, enter "Failed Logins" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the &lt;b&gt;Audit Destination&lt;/b&gt; to &lt;b&gt;Application Log&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_LdNeXsKHo20/SFGd1NSELhI/AAAAAAAAAGc/T7RpqNGRjlM/s400/CreateAudit.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211119781268434450" /&gt;
&lt;/li&gt;
&lt;Li&gt;Under the Audits folder, right-click on &lt;b&gt;Failed Logins&lt;/b&gt;, then click on &lt;b&gt;Enable Audit&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Close the success dialog box.&lt;/li&gt;
&lt;li&gt;Right-click on the &lt;b&gt;Server Audit Specifications&lt;/b&gt;, then click on &lt;b&gt;New Server Audit Specifications...&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;b&gt;Name&lt;/b&gt; field, enter "Failed Logins" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the &lt;b&gt;Audit&lt;/b&gt; field to &lt;b&gt;Failed Logins&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;b&gt;Actions&lt;/b&gt; grid, set the &lt;b&gt;Audit Action Type&lt;/b&gt; to &lt;b&gt;FAILED_LOGIN_GROUP&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;b&gt;OK&lt;/b&gt;.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFGiXrErxnI/AAAAAAAAAGk/w71xxwWTn3g/s400/Create+Server+Audit+Specification.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211124771427436146" /&gt;
&lt;/li&gt;
&lt;li&gt;Under the &lt;b&gt;Server Audit Specifications&lt;/b&gt; folder, right-click on &lt;b&gt;Failed Logins&lt;/b&gt;, then click on &lt;b&gt;Enable Server Audit Specification&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Test auditing by attempting to logon to the server with invalid logon credentials.&lt;/li&gt;
&lt;li&gt;Once that's done, check for an audit event by right-clicking on the &lt;b&gt;Failed Logins&lt;/b&gt; Audit, then clicking on &lt;b&gt;View Audit Logs&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;The failed logon should appear in the log as well as the Windows' Application Log. Take a look at the &lt;b&gt;statement&lt;/b&gt; field--it contains an explanation of the event, something like this: &lt;b&gt;Login failed for user 'sa'. Reason: Password did not match that for the login provided. [CLIENT: 10.1.141.146]&lt;/b&gt;&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SFGoftNVfqI/AAAAAAAAAG0/8R9iClz4bmY/s400/View+Audit+Logs.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211131506509315746" /&gt;&lt;br /&gt;You should also see this in the Windows' Application log:&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_LdNeXsKHo20/SFGpVuYK8dI/AAAAAAAAAG8/wvw2Gchefsk/s400/View+Audit+Application+Log.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5211132434536133074" /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2339516516954625696?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2339516516954625696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2339516516954625696&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2339516516954625696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2339516516954625696'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/ms-sql-server-2008-new-features_12.html' title='MS SQL Server 2008 - New Features - Auditing'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_LdNeXsKHo20/SFGd1NSELhI/AAAAAAAAAGc/T7RpqNGRjlM/s72-c/CreateAudit.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3459322434845923120</id><published>2008-06-11T14:22:00.000-07:00</published><updated>2008-06-11T15:03:16.292-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSMS'/><title type='text'>MS SQL Server 2008 - New Features - SSMS Easier Navigation</title><content type='html'>&lt;h4&gt;Easier SQL Server Management Studio (SSMS) Navigation&lt;/h4&gt;
&lt;p&gt;One of my biggest complaints with SSMS v9 (2005) is it's more-difficult-to-get-to menu items. For example, in order to open up an Object Explorer for a Registered server, you would have to 1) right-click on the server, 2) navigate to Connect, then 3) click on Object Explorer.&lt;br /&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SFBFdT3DG7I/AAAAAAAAAGE/zQB4ues_40Q/s400/SQL+Server+2008+SSMS+Object+Explorer+Menu.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5210741138717350834" /&gt;&lt;br /&gt;With SSMS v10 (2008), all you need to do is 1) right-click on the server, then 2) click on Object Explorer, leaving out the extra navigational step. Now, you might think this is minutiae, but in the world of fast-paced, busy development and administration, every little second helps. The easier it is to get to what I need to do, the faster I can do it, and the faster I can do it, the more likely I am to meet deadlines, get more done, etc.&lt;/p&gt;

&lt;h4&gt;Object Explorer All Registered Servers in a Folder&lt;/h4&gt;
&lt;p&gt;Typically, when I'm working with a set of servers at the same time, such as copying objects from one server to another, setting up replication or mirroring, etc, I open up all of the affected servers in SSMS v9, but I need to do this once for each server. Now, with SSMS v10, I can open up ALL servers within a folder simply by 1) right-clicking on a registered folder and 2) choosing Object Explorer.&lt;br /&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_LdNeXsKHo20/SFBFy4ugh7I/AAAAAAAAAGM/PTB5sL0C9WU/s400/SQL+Server+2008+SSMS+Object+Explorer+All+Servers.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5210741509390895026" /&gt;&lt;br /&gt;All of the servers will appear in the Object Explorer with all of the servers open and ready for managing, saving me time. Again, time is precious, so this is a cool feature in my book!&lt;/p&gt;

&lt;h4&gt;Select and Edit Top n Rows&lt;/h4&gt;
&lt;p&gt;Another time-saver is now being able to select the top 1000 rows of a table or view as well as edit the top 200 rows respectively. With prior versions, I'd have to open up Query Analyzer or a new query in SSMS and write a SELECT TOP n query against a table or view. This saves time, especially when you're retrieving rows from very large tables/views.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SFBLhY4HqVI/AAAAAAAAAGU/LG15uRP2fVk/s400/SQL+Server+2008+SSMS+Object+Explorer+Select+Top+1000+Rows.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5210747805853264210" /&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3459322434845923120?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3459322434845923120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3459322434845923120&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3459322434845923120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3459322434845923120'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/ms-sql-server-2008-new-features-ssms.html' title='MS SQL Server 2008 - New Features - SSMS Easier Navigation'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_LdNeXsKHo20/SFBFdT3DG7I/AAAAAAAAAGE/zQB4ues_40Q/s72-c/SQL+Server+2008+SSMS+Object+Explorer+Menu.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-7545185793800683642</id><published>2008-06-11T08:16:00.000-07:00</published><updated>2008-06-14T11:56:39.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Activity Monitor'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>MS SQL Server 2008 - New Features - SSMS Activity Monitor</title><content type='html'>&lt;h4&gt;New SQL Server Management Studio (SSMS) Activity Monitor&lt;/h4&gt;
&lt;p&gt;There are many new, awesome features in SQL Server 2008, but one I've been anticipating is something that should've been developed years ago--a graphical, near-real-time charts of performance indicators, such as CPU usage, wait states, I/O usage, etc. In SQL Server 2000, you had to run several system stored procedures, such as sp_who, sp_lock, sp_spaceused, and sp_monitor, to get an understanding of what was going on, and in SQL Server 2005, you have an activity monitor, but it's a grid consisted of rows and columns of data, not anything graphical. Another cool feature in v2008 is a listing of SQL queries deemed "expensive". With this information, you can better ascertain which queries might be impacting SQL Server performance.&lt;/p&gt;

&lt;h4&gt;Overview Performance Charts&lt;/h4&gt;
&lt;p&gt;With SQL Server 2008, you get a chart-based view of some of the more important performance indicators. The new Activity Monitor in SQL Server 2008 provides such as view. To get to it, simply right-click on a server in the SSMS Object Explorer pane, then click on Activity Monitor (contrast this with SQL Server 2005, in which you have to drill down into Management folder to get to AM). See the following image for a look Activity Monitor's Overview real-time charts.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SE_uc2OGbII/AAAAAAAAAFs/Fq_WycfZvtA/s400/SQL+Server+2008+Activity+Monitor.JPG" border="0" alt="SQL Server 2008 Activity Monitor Overview" id="BLOGGER_PHOTO_ID_5210645473249356930" /&gt;
&lt;/p&gt;

&lt;h4&gt;Recent Expensive Queries and Other Features&lt;/h4&gt;
&lt;p&gt;This feature provides a near-real-time view of expensive queries, something that can help DBAs and developers get a handle on which queries might be impacting server performance, negatively. Other Activity Monitor features include Processes, Resource Waits, and Data File I/O, all in near-real-time views.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SE_2cDbdM3I/AAAAAAAAAF8/VkEStERcX1A/s400/SQL+Server+2008+Activity+Monitor+Recent+Expensive+Queries.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5210654255708189554" /&gt;
&lt;/p&gt;

&lt;p&gt;To adjust the refresh wait of all of the information in Activity Monitor (you can't set the refresh rate per individual section), simply right-click on on the Overview/charts area, click on Refresh Interval, then choose a rate.&lt;/p&gt;

&lt;h4&gt;Filters&lt;/h4&gt;
&lt;p&gt;You can filter the data in the grid sections by clicking on the filter indicator for the appropriate column and selecting the data/value to filter by, a very cool feature, as you might not want to view all of the information on the grid, only a select view/representation.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SE_1QYxGuII/AAAAAAAAAF0/mpVI9Zp69Pg/s400/SQL+Server+2008+Activity+Monitor+Grid+Filters.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5210652955766077570" /&gt;
&lt;/p&gt;

&lt;h4&gt;Backward Compatibility&lt;/h4&gt;
&lt;p&gt;SQL Server 2005's Activity Monitor will work with SQL Server 2005 but not with v2000 or earlier releases. One thing I noticed with RC0 is that it doesn't show Processor Time statistics for SQL Server 2005 servers.&lt;/p&gt;

&lt;h4&gt;Comparing SQL Server 2005's Activity Monitor&lt;/h4&gt;
&lt;p&gt;In SQL Server 2005, Activity Monitor is limited by Processes, Locks by Object, and Locks by Process, and none of them are graphical. You can't view all of the information on one form. To view each search, you right-click on Activity Monitor, typically in Object Explorer in SSMS, then choose a section. With SQL Server 2008's Activity Monitor, you get to view all of the performance-based information on one form, making it easier to view and manage. SQL Server 2008's new Activity Monitor is a much-welcomed feature!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-7545185793800683642?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/7545185793800683642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=7545185793800683642&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7545185793800683642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7545185793800683642'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/ms-sql-server-2008-new-features.html' title='MS SQL Server 2008 - New Features - SSMS Activity Monitor'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_LdNeXsKHo20/SE_uc2OGbII/AAAAAAAAAFs/Fq_WycfZvtA/s72-c/SQL+Server+2008+Activity+Monitor.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-5023780844819923014</id><published>2008-06-02T11:10:00.000-07:00</published><updated>2008-06-02T11:45:38.711-07:00</updated><title type='text'>Properly Reinstalling SQL Server 2005 Reporting Services</title><content type='html'>&lt;ol&gt;
&lt;li&gt;Stop the default IIS web site. &lt;b&gt;DO NOT SHUTDOWN IIS.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Delete both SQL Server 2005 Report Server databases.&lt;/li&gt;
&lt;li&gt;In Control Panel, click on the Change button for the pertinent SQL Server 2005 install instance.&lt;/li&gt;
&lt;li&gt;Continue to select Report Server and the option to remove it.&lt;/li&gt;
&lt;li&gt;Reinstall Reporting Services by running the installer on the SQL Server 2005 disc.&lt;/li&gt;
&lt;li&gt;Once setup is complete, launch the Reporting Services Configuration tool with the Configuration Tools menu in your Start menu.&lt;/li&gt;
&lt;li&gt;Fix any red-X items in the list.&lt;/li&gt;
&lt;li&gt;You should be good to go!&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-5023780844819923014?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/5023780844819923014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=5023780844819923014&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/5023780844819923014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/5023780844819923014'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/properly-reinstalling-sql-server-2005.html' title='Properly Reinstalling SQL Server 2005 Reporting Services'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-141636891728293201</id><published>2008-05-08T08:57:00.000-07:00</published><updated>2008-05-08T08:58:52.054-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10g'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Oracle expdp fails with ORA-31637 and ORA-00832</title><content type='html'>To resolve this problem, ensure that the shared_pool_size initialization parameter is set to a sufficient value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-141636891728293201?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/141636891728293201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=141636891728293201&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/141636891728293201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/141636891728293201'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/05/oracle-expdp-fails-with-ora-31637-and.html' title='Oracle expdp fails with ORA-31637 and ORA-00832'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6124287962096099972</id><published>2008-05-05T16:49:00.000-07:00</published><updated>2008-05-07T13:12:15.141-07:00</updated><title type='text'>Creating a Custom SharePoint (MOSS) 2007 Calendar View Web Part with VS.NET 2005</title><content type='html'>&lt;p&gt;This conceptual tutorial shows you how to create a custom calendar web part that gets its events from an already-existing calendar in MOSS 2007.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Prerequisites:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&amp;displaylang=en"&gt;Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/sharepoint/default.mspx"&gt;MOSS 2007&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=6D94E307-67D9-41AC-B2D6-0074D6286FA9&amp;displaylang=en"&gt;SharePoint Server 2007 SDK Software Development Kit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b2c27a7f-d875-47d5-b226-e2578a116e12&amp;displaylang=en"&gt;VS.NET 2005&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;ALL SP development is to be done on the MOSS 2007 server itself.&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note: This tutorial will be a conceptual one, not one where I go into the actual development of a real application/web part.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open up VS.NET, then create a new SharePoint-Web Part project.&lt;/li&gt;
&lt;li&gt;Make sure a reference to Microsoft.SharePoint.dll is there.&lt;/li&gt;
&lt;li&gt;Open up the Web Part .cs (code) file.&lt;/li&gt;
&lt;li&gt;Ensure the following using statements are present:&lt;blockquote&gt;
using Microsoft.SharePoint;&lt;br /&gt;
using Microsoft.SharePoint.WebControls;&lt;br /&gt;
using Microsoft.SharePoint.WebPartPages;&lt;br /&gt;&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;Ensure the Web Part class is deriving from the following class:&lt;blockquote&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;Something in the Web Part class code file, define variables that might be used, such as the following:
&lt;xmp&gt;
private String strListName = "DotNetFun Calendar";
        private SPCalendarView calendarView = new SPCalendarView();
        private Guid listGuid;
&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Override the base class' CreateChildControls() method:&lt;blockquote&gt;protected override void CreateChildControls()&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;The CreateChildControls() method should look something like this:
&lt;xmp&gt;
        protected override void CreateChildControls()
        {
            try
            {
                SPSecurity.RunWithElevatedPrivileges(
                    delegate()
                    {
                        base.CreateChildControls();

                        ViewType viewType = ViewType.Month;

                        using (SPWeb web = SPContext.Current.Site.OpenWeb(this.webGuid))
                        {
                            // Change Cal-view based on if QueryString specifies it:
                            if (Page.Request.QueryString["CalendarPeriod"] != null)
                            {
                                switch (Page.Request.QueryString["CalendarPeriod"].ToString().ToLower())
                                {
                                    case "day":
                                        this.calendarView.ViewType = "day";
                                        viewType = ViewType.Day;
                                        break;
                                    case "week":
                                        this.calendarView.ViewType = "week";
                                        viewType = ViewType.Week;
                                        break;
                                    case "timeline":
                                        this.calendarView.ViewType = "timeline";
                                        viewType = ViewType.Timeline;
                                        break;
                                    default:
                                        this.calendarView.ViewType = "month";
                                        viewType = ViewType.Month;
                                        break;
                                }
                            }

                            SPList listDotNetFunCalendar = web.Lists[this.strListName];

                            if (listDotNetFunCalendar.Views["Calendar"] == null)
                                throw new ApplicationException("The Calendar view was not found. Please create one accordingly.");

                            SPView viewDotNetFunCalendar = listDotNetFunCalendar.Views["Calendar"];

                            if (this.calendarView.ViewGuid != null)
                                viewDotNetFunCalendar = listDotNetFunCalendar.Views[new Guid(this.calendarView.ViewGuid)];

                            this.listGuid = listDotNetFunCalendar.ID;

                            DateTime dtStart = DateTime.Now;
                            if (this.calendarView.SelectedDate != null)
                                dtStart = DateTime.Parse(this.calendarView.SelectedDate).AddDays(-7);
                            DateTime dtEnd = dtStart.AddMonths(1).AddDays(7);
                            SPQuery query = new SPQuery();
                            query.Query = String.Format(
                                "&lt;Query&gt;" +
                                "&lt;Where&gt;&lt;And&gt;" +
                                "&lt;Geq&gt;&lt;FieldRef Name=\"{0}\" /&gt;" +
                                "&lt;Value Type=\"DateTime\"&gt;{1}&lt;/Value&gt;&lt;/Geq&gt;" +
                                "&lt;Leq&gt;&lt;FieldRef Name=\"{0}\" /&gt;" +
                                "&lt;Value Type=\"DateTime\"&gt;{2}&lt;/Value&gt;&lt;/Leq&gt;" +
                                "&lt;/And&gt;&lt;/Where&gt;&lt;OrderBy&gt;&lt;FieldRef Name=\"{0}\" /&gt;&lt;/OrderBy&gt;" +
                                "&lt;/Query&gt;",
                                "Start Time",
                                dtStart.ToShortDateString(),
                                dtEnd.ToShortDateString());

                            viewDotNetFunCalendar.Query = query.Query;
                            web.AllowUnsafeUpdates = true;
                            //viewDotNetFunCalendar.Update();

                            //System.Web.HttpContext.Current.Response.Write(String.Format("{0}&lt;br /&gt;", viewDotNetFunCalendar.Query));
                            SPCalendarItemCollection items = new SPCalendarItemCollection();

                            foreach (SPListItem listItem in listDotNetFunCalendar.GetItems(viewDotNetFunCalendar))
                            {
                                SPCalendarItem calItem = new SPCalendarItem();
                                calItem.ItemID = listItem["ID"].ToString();
                                calItem.Title = listItem["Title"].ToString();
                                calItem.CalendarType = Convert.ToInt32(SPCalendarType.Gregorian);
                                calItem.StartDate = (DateTime)listItem["Start Time"];
                                calItem.ItemID = listItem.ID.ToString();
                                calItem.WorkSpaceLink = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                                // Only allow color-coding, which requires all all-day 
                                // event, if a Month view:
                                if (viewType == ViewType.Month)
                                    calItem.IsAllDayEvent = true;
                                calItem.DisplayFormUrl = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                                if (listItem["End Time"] != null)
                                {
                                    calItem.hasEndDate = true;
                                    calItem.EndDate = (DateTime)listItem["End Time"];
                                }
                                else
                                    calItem.hasEndDate = false;

                                if (listItem["Description"] != null)
                                    calItem.Description = listItem["Description"].ToString();

                                if (listItem["Location"] != null)
                                    calItem.Location = listItem["Location"].ToString();

                                // Define CSS based on category:
                                // Note, CSS styles are stored in CORE.CSS, here:
                                // %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES
                                // Append "sel" (without quotes) to the CSS Class name to 
                                // override the onmouseover CSS changes in the CORE.CSS file.
                                switch (listItem["Category"].ToString())
                                {
                                    case "Programming/Scheduling":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarProgramming";
                                        break;
                                    case "Production":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarProduction";
                                        break;
                                    case "Ad Sales":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarAdSales";
                                        break;
                                    case "Marketing/Promotions":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarMarketing";
                                        break;
                                    case "PR":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarPR";
                                        break;
                                    case "Online/Interactive":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarInteractive";
                                        break;
                                    case "Company Events/HR":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarHR";
                                        break;
                                    case "General":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarGeneral";
                                        break;
                                }
                                items.Add(calItem);
                            }

                            // Set calendar-only properties:
                            this.calendarView.DisplayItemFormUrl = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                            this.calendarView.EditItemFormUrl = String.Format("/Lists/{0}/EditForm.aspx", this.strListName);
                            this.calendarView.NewItemFormUrl = String.Format("/Lists/{0}/NewForm.aspx", this.strListName);
                            this.calendarView.EnableViewState = true;
                            this.calendarView.DataSource = items;
                            this.calendarView.DataBind();
                            this.DataBind();
                        }

                        this.Controls.Add(this.calendarView);
                    });
            }
            catch (Exception err)
            {
                this.HandleException(err);
            }
        }
&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Override the base class' RenderContents(HtmlTextWriter writer) method:&lt;blockquote&gt;RenderContents(HtmlTextWriter writer)&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;The RenderContents(HtmlTextWriter writer) method should look something like this:
&lt;xmp&gt;
        protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSecurity.RunWithElevatedPrivileges(
                delegate()
                {
                    // Check if current user can add events:
                    bool blnCanAddEvents = false;
                    using (SPWeb web = SPContext.Current.Site.OpenWeb(this.webGuid))
                    {
                        try
                        {
                            web.Lists[this.strListName].Permissions.CheckPermissions(SPRights.AddListItems);
                            blnCanAddEvents = true;
                        }
                        catch
                        {
                        }
                    }

                    // Render header firstly:
                    StringBuilder sbHeader = new StringBuilder();
                    sbHeader.AppendLine("&lt;table bgcolor='#05C4D8' align='center' width='100%' border='1' cellpadding='2' cellspacing='2'&gt;");
                    sbHeader.AppendLine("&lt;tr&gt;&lt;th align='center' bgcolor='Black'&gt;");
                    sbHeader.AppendLine("&lt;font color='#05C4D8' size='4'&gt;DotNetFun PROGRAMMING&lt;/font&gt;");
                    sbHeader.AppendLine("&lt;/th&gt;&lt;/table&gt;");
                    writer.Write(sbHeader.ToString());

                    // Render calendar secondly:
                    this.calendarView.RenderControl(writer);

                    // Append color legend:
                    StringBuilder sbLegend = new StringBuilder();
                    sbLegend.AppendLine("&lt;table align='center' width='100%' border='0'&gt;");
                    sbLegend.AppendLine("&lt;td width='50%' align='left' valign='top'&gt;");
                    sbLegend.AppendLine("&lt;b&gt;&lt;u&gt;Legend:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#72FFF6;padding:2px;'&gt;Programming/Scheduling&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#1AA4C2;padding:2px;'&gt;Production&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#3F8698;padding:2px;'&gt;Ad Sales&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#76D600;padding:2px;'&gt;Marketing/Promotions&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#FF9A00;padding:2px;'&gt;PR&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#E000B6;padding:2px;'&gt;Online/Interactive&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#F51604;padding:2px;'&gt;Company Events/HR&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:White;padding:2px;'&gt;General&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;/td&gt;");
                    sbLegend.AppendLine("&lt;td width='50%' align='left' valign='top'&gt;");
                    sbLegend.AppendLine("&lt;b&gt;&lt;u&gt;Options:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;");
                    if (blnCanAddEvents)
                        sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/Lists/{0}/NewForm.aspx\"&gt;Add New Event&lt;/a&gt;&lt;/li&gt;", this.strListName));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/Lists/{0}/\"&gt;View the Full Calendar&lt;/a&gt;&lt;/li&gt;", this.strListName));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/_layouts/listfeed.aspx?List={0}\"&gt;RSS Feed&lt;/a&gt;&lt;/li&gt;", this.listGuid.ToString()));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"http://DotNetFunshare001/_layouts/SubNew.aspx?List={0}\"&gt;Alert Me When this Calendar Changes&lt;/a&gt;&lt;/li&gt;", this.listGuid.ToString()));
                    sbLegend.AppendLine("&lt;/td&gt;&lt;/table&gt;");
                    writer.Write(sbLegend.ToString());
                });
        }
&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Ensure that the AssemblyInfo.cs file is using whole, major version numbers and nothing else (e.g., 1.0.0.0).&lt;/li&gt;
&lt;li&gt;The code sample in this tutorial makes use of CSS via the MOSS 2007's CORE.CSS master CSS file, located here: %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES&lt;/li&gt;
&lt;li&gt;Before you can use the Web Part, it must be trusted by declaring it a safe control. Do this by adding something like the following to the site's web.config file, typically, located here, C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config: &lt;/li&gt;
&lt;xmp&gt;
&lt;SafeControl Assembly="SPDotNetFunCalendarWebpart, Version=52.0.0.0, Culture=neutral, PublicKeyToken=fc6dbd48e3fd5742" Namespace="DotNetFun.SharePoint.WebParts" TypeName="*" /&gt;
&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Add the following line to the AssemblyInfo.cs code file:
&lt;xmp&gt;[assembly: System.Security.AllowPartiallyTrustedCallers()]&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Sign the project with a strong-name key, then add it to the GAC, after compiling it, of course.&lt;/li&gt;
&lt;li&gt;Go to the settings page of the site on which the calendar list exists and from which data is being retrieved.&lt;/li&gt;
&lt;li&gt;Under the Galleries section, click on Web Parts.&lt;/li&gt;
&lt;li&gt;Click on the New button.&lt;/li&gt;
&lt;li&gt;Check the checkbox for the calendar web part just created.&lt;/li&gt;
&lt;li&gt;Click on Populate Gallery.&lt;/li&gt;
&lt;li&gt;Add a new Permission Level for this particular type of web part, as shown above, and grant it basic rights plus the Add right, as without Add, it won't work.&lt;/li&gt;
&lt;li&gt;The web part is now ready for use on this site.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;b&gt;Sample, entire Web part class code file:&lt;/b&gt;
&lt;xmp&gt;
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using System.Text;

namespace DotNetFun.SharePoint.WebParts
{
    [Guid("a6b6f461-cc95-4cf3-b419-b0b1b1d20355")]
    public class SPDotNetFunCalendarWebpart : System.Web.UI.WebControls.WebParts.WebPart
    {
        private Guid webGuid = SPContext.Current.Web.ID;
        private String strListName = "DotNetFun Calendar";
        private SPCalendarView calendarView = new SPCalendarView();
        private Guid listGuid;

        public SPDotNetFunCalendarWebpart()
        {
            this.ExportMode = WebPartExportMode.All;
            this.Title = "DotNetFun Programming Calendar";
        }
        
        protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSecurity.RunWithElevatedPrivileges(
                delegate()
                {
                    // Check if current user can add events:
                    bool blnCanAddEvents = false;
                    using (SPWeb web = SPContext.Current.Site.OpenWeb(this.webGuid))
                    {
                        try
                        {
                            web.Lists[this.strListName].Permissions.CheckPermissions(SPRights.AddListItems);
                            blnCanAddEvents = true;
                        }
                        catch
                        {
                        }
                    }

                    // Render header firstly:
                    StringBuilder sbHeader = new StringBuilder();
                    sbHeader.AppendLine("&lt;table bgcolor='#05C4D8' align='center' width='100%' border='1' cellpadding='2' cellspacing='2'&gt;");
                    sbHeader.AppendLine("&lt;tr&gt;&lt;th align='center' bgcolor='Black'&gt;");
                    sbHeader.AppendLine("&lt;font color='#05C4D8' size='4'&gt;DotNetFun PROGRAMMING&lt;/font&gt;");
                    sbHeader.AppendLine("&lt;/th&gt;&lt;/table&gt;");
                    writer.Write(sbHeader.ToString());

                    // Render calendar secondly:
                    this.calendarView.RenderControl(writer);

                    // Append color legend:
                    StringBuilder sbLegend = new StringBuilder();
                    sbLegend.AppendLine("&lt;table align='center' width='100%' border='0'&gt;");
                    sbLegend.AppendLine("&lt;td width='50%' align='left' valign='top'&gt;");
                    sbLegend.AppendLine("&lt;b&gt;&lt;u&gt;Legend:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#72FFF6;padding:2px;'&gt;Programming/Scheduling&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#1AA4C2;padding:2px;'&gt;Production&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#3F8698;padding:2px;'&gt;Ad Sales&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#76D600;padding:2px;'&gt;Marketing/Promotions&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#FF9A00;padding:2px;'&gt;PR&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#E000B6;padding:2px;'&gt;Online/Interactive&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:#F51604;padding:2px;'&gt;Company Events/HR&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;label style='width:250px;background-color:White;padding:2px;'&gt;General&lt;/label&gt;&lt;br /&gt;");
                    sbLegend.AppendLine("&lt;/td&gt;");
                    sbLegend.AppendLine("&lt;td width='50%' align='left' valign='top'&gt;");
                    sbLegend.AppendLine("&lt;b&gt;&lt;u&gt;Options:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;");
                    if (blnCanAddEvents)
                        sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/Lists/{0}/NewForm.aspx\"&gt;Add New Event&lt;/a&gt;&lt;/li&gt;", this.strListName));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/Lists/{0}/\"&gt;View the Full Calendar&lt;/a&gt;&lt;/li&gt;", this.strListName));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"/_layouts/listfeed.aspx?List={0}\"&gt;RSS Feed&lt;/a&gt;&lt;/li&gt;", this.listGuid.ToString()));
                    sbLegend.AppendLine(String.Format("&lt;li&gt;&lt;a href=\"http://DotNetFunshare001/_layouts/SubNew.aspx?List={0}\"&gt;Alert Me When this Calendar Changes&lt;/a&gt;&lt;/li&gt;", this.listGuid.ToString()));
                    sbLegend.AppendLine("&lt;/td&gt;&lt;/table&gt;");
                    writer.Write(sbLegend.ToString());
                });
        }

        private void HandleException(Exception Error)
        {
            SPSecurity.RunWithElevatedPrivileges(
                delegate()
                {
                    throw Error;
                    //System.Web.HttpContext.Current.Response.Write("&lt;p&gt;&lt;b&gt;&lt;font color='red'&gt;An error occurred: " + 
                    //    Error.Message + " " + (Error.StackTrace != null ? Error.StackTrace : "") + 
                    //    "&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;");
                });
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        private enum ViewType
        {
            Day, Week, Month, Timeline
        }

        protected override void CreateChildControls()
        {
            try
            {
                SPSecurity.RunWithElevatedPrivileges(
                    delegate()
                    {
                        base.CreateChildControls();

                        ViewType viewType = ViewType.Month;

                        using (SPWeb web = SPContext.Current.Site.OpenWeb(this.webGuid))
                        {
                            // Change Cal-view based on if QueryString specifies it:
                            if (Page.Request.QueryString["CalendarPeriod"] != null)
                            {
                                switch (Page.Request.QueryString["CalendarPeriod"].ToString().ToLower())
                                {
                                    case "day":
                                        this.calendarView.ViewType = "day";
                                        viewType = ViewType.Day;
                                        break;
                                    case "week":
                                        this.calendarView.ViewType = "week";
                                        viewType = ViewType.Week;
                                        break;
                                    case "timeline":
                                        this.calendarView.ViewType = "timeline";
                                        viewType = ViewType.Timeline;
                                        break;
                                    default:
                                        this.calendarView.ViewType = "month";
                                        viewType = ViewType.Month;
                                        break;
                                }
                            }

                            SPList listDotNetFunCalendar = web.Lists[this.strListName];

                            if (listDotNetFunCalendar.Views["Calendar"] == null)
                                throw new ApplicationException("The Calendar view was not found. Please create one accordingly.");

                            SPView viewDotNetFunCalendar = listDotNetFunCalendar.Views["Calendar"];

                            if (this.calendarView.ViewGuid != null)
                                viewDotNetFunCalendar = listDotNetFunCalendar.Views[new Guid(this.calendarView.ViewGuid)];

                            this.listGuid = listDotNetFunCalendar.ID;

                            DateTime dtStart = DateTime.Now;
                            if (this.calendarView.SelectedDate != null)
                                dtStart = DateTime.Parse(this.calendarView.SelectedDate).AddDays(-7);
                            DateTime dtEnd = dtStart.AddMonths(1).AddDays(7);
                            SPQuery query = new SPQuery();
                            query.Query = String.Format(
                                "&lt;Query&gt;" +
                                "&lt;Where&gt;&lt;And&gt;" +
                                "&lt;Geq&gt;&lt;FieldRef Name=\"{0}\" /&gt;" +
                                "&lt;Value Type=\"DateTime\"&gt;{1}&lt;/Value&gt;&lt;/Geq&gt;" +
                                "&lt;Leq&gt;&lt;FieldRef Name=\"{0}\" /&gt;" +
                                "&lt;Value Type=\"DateTime\"&gt;{2}&lt;/Value&gt;&lt;/Leq&gt;" +
                                "&lt;/And&gt;&lt;/Where&gt;&lt;OrderBy&gt;&lt;FieldRef Name=\"{0}\" /&gt;&lt;/OrderBy&gt;" +
                                "&lt;/Query&gt;",
                                "Start Time",
                                dtStart.ToShortDateString(),
                                dtEnd.ToShortDateString());

                            viewDotNetFunCalendar.Query = query.Query;
                            web.AllowUnsafeUpdates = true;
                            //viewDotNetFunCalendar.Update();

                            //System.Web.HttpContext.Current.Response.Write(String.Format("{0}&lt;br /&gt;", viewDotNetFunCalendar.Query));
                            SPCalendarItemCollection items = new SPCalendarItemCollection();

                            foreach (SPListItem listItem in listDotNetFunCalendar.GetItems(viewDotNetFunCalendar))
                            {
                                SPCalendarItem calItem = new SPCalendarItem();
                                calItem.ItemID = listItem["ID"].ToString();
                                calItem.Title = listItem["Title"].ToString();
                                calItem.CalendarType = Convert.ToInt32(SPCalendarType.Gregorian);
                                calItem.StartDate = (DateTime)listItem["Start Time"];
                                calItem.ItemID = listItem.ID.ToString();
                                calItem.WorkSpaceLink = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                                // Only allow color-coding, which requires all all-day 
                                // event, if a Month view:
                                if (viewType == ViewType.Month)
                                    calItem.IsAllDayEvent = true;
                                calItem.DisplayFormUrl = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                                if (listItem["End Time"] != null)
                                {
                                    calItem.hasEndDate = true;
                                    calItem.EndDate = (DateTime)listItem["End Time"];
                                }
                                else
                                    calItem.hasEndDate = false;

                                if (listItem["Description"] != null)
                                    calItem.Description = listItem["Description"].ToString();

                                if (listItem["Location"] != null)
                                    calItem.Location = listItem["Location"].ToString();

                                // Define CSS based on category:
                                // Note, CSS styles are stored in CORE.CSS, here:
                                // %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES
                                // Append "sel" (without quotes) to the CSS Class name to 
                                // override the onmouseover CSS changes in the CORE.CSS file.
                                switch (listItem["Category"].ToString())
                                {
                                    case "Programming/Scheduling":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarProgramming";
                                        break;
                                    case "Production":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarProduction";
                                        break;
                                    case "Ad Sales":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarAdSales";
                                        break;
                                    case "Marketing/Promotions":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarMarketing";
                                        break;
                                    case "PR":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarPR";
                                        break;
                                    case "Online/Interactive":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarInteractive";
                                        break;
                                    case "Company Events/HR":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarHR";
                                        break;
                                    case "General":
                                        calItem.BackgroundColorClassName = "DotNetFunCalendarGeneral";
                                        break;
                                }
                                items.Add(calItem);
                            }

                            // Set calendar-only properties:
                            this.calendarView.DisplayItemFormUrl = String.Format("/Lists/{0}/DispForm.aspx", this.strListName);
                            this.calendarView.EditItemFormUrl = String.Format("/Lists/{0}/EditForm.aspx", this.strListName);
                            this.calendarView.NewItemFormUrl = String.Format("/Lists/{0}/NewForm.aspx", this.strListName);
                            this.calendarView.EnableViewState = true;
                            this.calendarView.DataSource = items;
                            this.calendarView.DataBind();
                            this.DataBind();
                        }

                        this.Controls.Add(this.calendarView);
                    });
            }
            catch (Exception err)
            {
                this.HandleException(err);
            }
        }
    }
}
&lt;/xmp&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6124287962096099972?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6124287962096099972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6124287962096099972&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6124287962096099972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6124287962096099972'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/05/creating-custom-sharepoint-moss-2007.html' title='Creating a Custom SharePoint (MOSS) 2007 Calendar View Web Part with VS.NET 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-1827279641711197832</id><published>2008-04-23T15:50:00.000-07:00</published><updated>2009-08-14T08:25:50.454-07:00</updated><title type='text'>Enabling &gt; 4GB RAM Support with Oracle 10g Running on Windows Server 2003 32-bit Ed.</title><content type='html'>&lt;ol&gt;
&lt;li&gt;Add the /3G, USERENV, and /PAE switches to the boot.ini file, on the Windows Server 2003 Server. For example: &lt;cite&gt;multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows Server 2003" /fastdetect /NoExecute=OptIn /3GB /USERENV /PAE&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;The account that is used to start the Oracle Service must be given the "Lock Pages in Memory" right. You can do this by a) going to Administrative Tools, from the Start menu or Control Panel, b) opening Local Security Policy, c) opening Local Policies, then d) opening User Rights Assignment; e) open/edit the "Lock Pages in Memory" key, f) then add the Oracle Service account to this list.&lt;/li&gt;
&lt;li&gt;Create an AWE_WINDOW_MEMORY String (REG_SZ) registry key in the Windows' Registry, under HKLM\Software\Oracle\&lt;span style="font-style: italic;"&gt;h&lt;/span&gt;, where &lt;span style="font-style: italic;"&gt;h&lt;/span&gt; is the ORACLE_HOME you're targeting. Set this value to the following calculated value (you can calculate this value via the calculator below):&lt;blockquote&gt;
SETS_PER_POOL = 2 * CPU_COUNT (if VLM is enabled; VLM is enabled by setting USE_INDIRECT_DATA_BUFFERS=TRUE)

SETS_PER_POOL = CPU Count / 2  (If VLM is NOT enabled

_DB_BLOCK_LRU_LATCHES = (8 * SETS_PER_POOL)

AWE_WINDOW_MEMORY (min.) = ((4096 * DB_BLOCK_SIZE * _DB_BLOCK_LRU_LATCHES) / 8) * 1.03125

&lt;/blockquote&gt;
So, in a server with 8GB of RAM with 4 CPUs and a DB_BLOCK_SIZE of 8192, the AWE_WINDOW_MEMORY would be ((((2 * 4) * 8) * 4096 * 8192) / 8) * 1.03125 = 276824064.
&lt;/li&gt;
&lt;li&gt;Set the &lt;span style="font-style: italic;"&gt;_DB_BLOCK_LRU_LATCHES&lt;/span&gt; DB instance parameter according to the preceding formula.

&lt;/li&gt;&lt;li&gt;Set the DB instance parameter &lt;span style="font-style: italic;"&gt;use_indirect_data_buffers&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;TRUE&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;Ensure that the DB instance parameter &lt;span style="font-style: italic;"&gt;db_cache_size&lt;/span&gt; is NOT set.&lt;/li&gt;
&lt;li&gt;Set the DB instance parameter &lt;span style="font-style: italic;"&gt;db_block_buffers&lt;/span&gt; to the following calculated value (you can use the calculator below instead):&lt;blockquote&gt;
db_block_buffers = (Total RAM - 4GB + AWE_WINDOW_MEMORY) / DB_BLOCK_SIZE&lt;/blockquote&gt;
So, using the preceding example, the db_block_buffers parameter value would be 786432.&lt;/li&gt;
&lt;li&gt;Set the DB instance parameter &lt;span style="font-style: italic;"&gt;PGA_AGGREGATE_TARGET&lt;/span&gt; to (&lt;total physical="" memory=""&gt; * 80%) * 40%.&lt;/total&gt;&lt;/li&gt;
&lt;li&gt;Ensure the DB instance parameter &lt;span style="font-style: italic;"&gt;sga_target&lt;/span&gt; is NOT set.&lt;/li&gt;
&lt;li&gt; Set the DB instance parameter &lt;span style="font-style: italic;"&gt;shared_pool_size&lt;/span&gt; to AWE_WINDOW_MEMORY * 1.27923, at the very minimum.

&lt;/li&gt;&lt;li&gt;Ensure that the &lt;span style="font-style: italic;"&gt;streams_pool&lt;/span&gt; is NOT set to 0 if you will be using utilities such as the Data Pump ones (e.g., expdp and impdp). 1MB is a good start.
&lt;/li&gt;
&lt;li&gt;Restart the server and related Oracle services and DB(s).&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;b&gt;Note: The CPU count includes hyperthreaded processors, so in a dual-core processor, the CPU count would be 2, not 1.&lt;/b&gt;&lt;/p&gt;

&lt;form name="frmORA" id="frmORA"&gt;
&lt;u&gt;Set these values:&lt;/u&gt;
&lt;br /&gt;
Is VLM enabled? &lt;input name="oraVLMEnabled" checked="checked" type="checkbox"&gt;
&lt;br /&gt;
CPU_COUNT = &lt;input size="5" name="oraCPU_COUNT" type="text"&gt;
&lt;br /&gt;
DB_BLOCK_SIZE = &lt;input size="6" name="oraDB_BLOCK_SIZE" value="8192" type="text"&gt;
&lt;br /&gt;
Total RAM = &lt;input size="16" name="oraTotalRAM" type="text"&gt;
&lt;br /&gt;
&lt;u&gt;Results:&lt;/u&gt;
&lt;br /&gt;
SETS_PER_POOL &lt;input size="5" readonly="readonly" name="oraSETS_PER_POOL" type="text"&gt;
&lt;br /&gt;
_DB_BLOCK_LRU_LATCHES = &lt;input size="5" readonly="readonly" name="ora_DB_BLOCK_LRU_LATCHES" type="text"&gt;
&lt;br /&gt;
AWE_WINDOW_MEMORY (min.) = &lt;input size="16" name="oraAWE_WINDOW_MEMORY" readonly="readonly" type="text"&gt;
&lt;br /&gt;
AWE_WINDOW_MEMORY (rec.) = &lt;input size="16" name="oraAWE_WINDOW_MEMORY_REC" readonly="readonly" type="text"&gt;
&lt;br /&gt;
DB_BLOCK_BUFFERS  = &lt;input size="16" name="oraDB_BLOCK_BUFFERS" readonly="readonly" type="text"&gt;
&lt;br /&gt;
PGA_AGGREGATE_TARGET (min.) = &lt;input size="16" name="oraPGA_AGGREGATE_TARGET" readonly="readonly" type="text"&gt;
&lt;br /&gt;
PGA_AGGREGATE_TARGET (rec.) = &lt;input size="16" name="oraPGA_AGGREGATE_TARGET_REC" readonly="readonly" type="text"&gt;
&lt;br /&gt;
SHARED_POOL_SIZE (min.) = &lt;input size="16" name="oraSHARED_POOL_SIZE" readonly="readonly" type="text"&gt;
&lt;br /&gt;
SHARED_POOL_SIZE (rec.) = &lt;input size="16" name="oraSHARED_POOL_SIZE_REC" readonly="readonly" type="text"&gt;
&lt;br /&gt;
&lt;input value="Calculate" onclick="OraCalculate();" type="button"&gt;
&lt;/form&gt;
&lt;script language="JavaScript"&gt;function OraCalculate() {  var frmORA = document.getElementById("frmORA"); var intCPUCount = new Number(frmORA.oraCPU_COUNT.value);  var intSetsPerPool = intCPUCount * 2;  if (! frmORA.oraVLMEnabled.checked)    intSetsPerPool = intCPUCount / 2;  frmORA.oraSETS_PER_POOL.value = intSetsPerPool;  var intLatches = intSetsPerPool * 8;  frmORA.ora_DB_BLOCK_LRU_LATCHES.value = intLatches;  var intDBBlockSize = new Number(frmORA.oraDB_BLOCK_SIZE.value);  var intAWEMemory = Math.round(((4096 * intDBBlockSize * intLatches) / 8) * 1.03125);  frmORA.oraAWE_WINDOW_MEMORY.value = intAWEMemory;  var intTotalRAM = new Number(frmORA.oraTotalRAM.value);  var intDBBlockBuffers = Math.round((intTotalRAM - 4294967296 + intAWEMemory) / intDBBlockSize);  frmORA.oraDB_BLOCK_BUFFERS.value = intDBBlockBuffers;  var intSharedPool = Math.round(intAWEMemory * 1.27923);  frmORA.oraSHARED_POOL_SIZE.value = intSharedPool;  var intSharedPoolRec = Math.round(intSharedPool * 1.25);  var intAWEMemoryRec = Math.round(intAWEMemory * 1.25);  frmORA.oraAWE_WINDOW_MEMORY_REC.value = intAWEMemoryRec;  frmORA.oraSHARED_POOL_SIZE_REC.value = intSharedPoolRec;  var intPGATarget = Math.round((intSharedPool * 0.333));  var intPGATargetRec = Math.round(((intSharedPool * 0.333) * 1.5));  frmORA.oraPGA_AGGREGATE_TARGET.value = intPGATarget;  frmORA.oraPGA_AGGREGATE_TARGET_REC.value = intPGATargetRec;}&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-1827279641711197832?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/1827279641711197832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=1827279641711197832&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1827279641711197832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/1827279641711197832'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/04/enabling-4gb-ram-support-with-oracle.html' title='Enabling &gt; 4GB RAM Support with Oracle 10g Running on Windows Server 2003 32-bit Ed.'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2780638606990759007</id><published>2008-04-10T13:12:00.000-07:00</published><updated>2008-04-10T14:40:12.019-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Search'/><category scheme='http://www.blogger.com/atom/ns#' term='moss 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='moss'/><title type='text'>Configuring Search for SharePoint Server (MOSS) 2007</title><content type='html'>&lt;ol&gt;
&lt;li&gt;Open up the MOSS administration site.&lt;/li&gt;
&lt;li&gt;Open up the Shared Services Administration site.&lt;/li&gt;
&lt;li&gt;In the Search section, click on Search Settings.&lt;/li&gt;
&lt;li&gt;Click on "Default content access account".&lt;/li&gt;
&lt;li&gt;Change the account and password to match an account that has access to ALL of the sites and its content.&lt;br /&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_LdNeXsKHo20/R_513MeRc2I/AAAAAAAAAFE/blZq3BL08R0/s400/SearchDefaultContentAccessAccount.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5187713411878843234" /&gt;&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Crawl Rules.&lt;/li&gt;
&lt;li&gt;If no crawl rules are defined, define them by adding them.&lt;/li&gt;
&lt;li&gt;Click on New Crawl Rule.&lt;/li&gt;
&lt;li&gt;Enter the full path to the base site collection in the Path field. Append an asterisk (*) at the end of the URL to indicate searching all subsites of this URL.&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R_6GeseRc3I/AAAAAAAAAFM/7GS0YczhKDw/s400/SearchEditCrawlRule.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5187731682669720434" /&gt;&lt;/li&gt;
&lt;li&gt;Select the "Include all items in this path" option.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on "Content sources and crawl schedules".&lt;/li&gt;
&lt;li&gt;Click on "Local Office SharePoint Server sites".&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R_6I2ceRc4I/AAAAAAAAAFU/Xf9pT7nHbNU/s400/SearchCrawlSchedules.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5187734289714869122" /&gt;&lt;/li&gt;
&lt;li&gt;In the Crawl Schedules section, click on the Create schedule link under the Full Crawl drop-down list.&lt;/li&gt;
&lt;li&gt;Set the options, then click on OK.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R_6JKceRc5I/AAAAAAAAAFc/V1Eyd9ce5V4/s400/SearchManageSchedules.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5187734633312252818" /&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2780638606990759007?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2780638606990759007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2780638606990759007&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2780638606990759007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2780638606990759007'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/04/configuring-search-for-sharepoint.html' title='Configuring Search for SharePoint Server (MOSS) 2007'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_LdNeXsKHo20/R_513MeRc2I/AAAAAAAAAFE/blZq3BL08R0/s72-c/SearchDefaultContentAccessAccount.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2708720080146788919</id><published>2008-04-04T11:39:00.000-07:00</published><updated>2008-06-10T08:46:29.130-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup'/><title type='text'>Backing up a SharePoint (MOSS) 2007 Site</title><content type='html'>&lt;ol&gt;
&lt;li&gt;Setup a writable share with write permissions, specfically granting the SharePoint (MOSS) 2007 server read and write permissions to this share. For example, if the MOSS server is named TEST, grant DOMAIN\TEST$ read and write permissions to this share (where DOMAIN is the domain or workgroup the server belongs to, and TEST$ is the computer's account name on the domain/workgroup). For this example, a share has been setup on the TEST server called MOSSBackup&lt;/li&gt;
&lt;li&gt;Open up a command prompt on the MOSS server (cmd).&lt;/li&gt;
&lt;li&gt;Navigate to the BIN folder:&lt;xmp&gt;cd "%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\BIN"&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Execute the following command to perform a full backup of the MOSS databases, sites, etc.:&lt;xmp&gt;stsadm -o backup -backupmethod full -directory \\TEST\MOSSBackup&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Add this command to a nightly scheduled task.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2708720080146788919?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2708720080146788919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2708720080146788919&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2708720080146788919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2708720080146788919'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/04/backing-up-sharepoint-moss-2007-site.html' title='Backing up a SharePoint (MOSS) 2007 Site'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6347797846549450511</id><published>2008-04-04T09:53:00.000-07:00</published><updated>2008-04-16T22:01:13.215-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10g'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard'/><category scheme='http://www.blogger.com/atom/ns#' term='Standby'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Failover'/><title type='text'>Implementing Oracle 10g Data Guard for Standby/Failover Availability</title><content type='html'>&lt;p&gt;&lt;em&gt;This tutorial demonstrates how to setup Data Guard in the Windows version of Oracle Database 10g. I am assuming you already know how to restart database instances and listeners.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Notes: Oracle Enterprise Manager requires that the database instance it manages be accessible via a Net name. In other words, ensure that a tnsnames.ora file is setup to point to the instance, correctly. DB_UNIQUE_NAME refers to a globally unique name. SERVICE_NAMES refers to one or more service-based names which are registered with the TNS listener. If SERVICE_NAMES is empty, the instance registers with the TNS listener a service name in the following format: DB_UNIQUE_NAME.DB_DOMAIN. Dont' confuse what's in SERVICE_NAMES with a "service name". service names are, typically, Oracle Net names as defined in a tnsnames.ora file, and it's how Oracle Net applications such as SQL*Plus communicate with DB instances. A SID is equivalent to a DB name, or DB_NAME, not a service name, so don't confuse SID with service names either.&lt;/p&gt;

&lt;h4&gt;Preparing the Source/Primary Database&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Login to Oracle Enterprise Manager (typically the shortcut named "Database Control - SID").&lt;/li&gt;
&lt;li&gt;Click on Administration.&lt;/li&gt;
&lt;li&gt;Click on "All Initialization Parameters".&lt;/li&gt;
&lt;li&gt;Ensure that the remote_login_passwordfile parameter is set to "EXCLUSIVE" (without quotes). If it's not, create an exclusive password via the "orapwd" (without quotes) command, then set it. You can set the parameter via an SQL command:&lt;xmp&gt;ALTER SYSTEM SET remote_login_passwordfile = 'EXCLUSIVE' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;The DB_NAME parameter must be the same for both the source and target databases. The database name is NOT case sensitive. This is just a note, not anything that needs to be done or set at this point.&lt;/li&gt;

&lt;li&gt;The DB_UNIQUE_NAME parameter must be unique for both the source and target databases. If they're not, set them via the Oracle Enterprise Manager. For now, just ensure that the primary/target DB has a unique DB name. Per Oracle, the default value of DB_UNIQUE_NAME is the value of DB_NAME, and DB_UNIQUE_NAME can be up to 30 characters and is case insensitive. The following characters are valid in a database name: alphanumeric characters, underscore (_), number sign (#), and dollar sign ($).&lt;br /&gt;
&lt;img id="BLOGGER_PHOTO_ID_5188769147881649826" alt="" src="http://bp1.blogger.com/_LdNeXsKHo20/SAI2DHj99qI/AAAAAAAAAFk/2RKA9UsFUfU/s400/Setting+DB_UNIQUE_NAME.JPG" border="0" /&gt;
Alternatively, you can issue the following SQL command:&lt;xmp&gt;alter system set db_unique_name = 'unique_name' scope=spfile&lt;/xmp&gt;&lt;b&gt;NOTE: Be careful when changing this value. When the SERVICE_NAMES parameter is empty, the instance will register with the TNS listener the DB_UNIQUE_NAME and DB_DOMAN parameters to form a unique, global service name. It's automatically determined. Therefore, BEFORE changing the DB_UNIQUE_NAME, ensure you set the SERVICE_NAMES parameter to include the original service name registered with the TNS listener for this DB instance ALONG with the new DB_UNIQUE_NAME.DB_DOMAIN service name that would've changed. Otherwise, applications such as Oracle Enterprise Manager will not work because they will refer to an service name that no longer exists. So, for example, if the original service name setup for use with OEM was dgtest.dotnetfun.local, and the new DB_UNIQUE_NAME for that DB instance is dgtest_primary, the SERVICE_NAMES parameter would be set to 'dgtest.dotnetfun.local', 'dgtest_primary.dotnetfun.local'.&lt;/b&gt;&lt;/li&gt;


&lt;li&gt;The SERVICE_NAMES parameter must be unique for both the source and target databases. If they're not, set them via the Oracle Enterprise Manager as specified above. Alternatively, you can use following SQL command:&lt;xmp&gt;ALTER SYSTEM SET service_names = 'service_name' SCOPE=SPFILE&lt;/xmp&gt;&lt;b&gt;NOTE: Again, be careful not to remove the original service name setup for use with Oracle Enterprise Manager, as OEM references the instance this way, and removing it will proably render OEM useless.&lt;/b&gt; The default value, per Oracle, is DB_NAME.DB_DOMAIN.&lt;/li&gt;

&lt;li&gt;Set the LOG_ARCHIVE_CONFIG parameter to something like this: 'DG_CONFIG=(source_db_unique_name,target_db_unique_name)' (without single quotes, where source_db_unique_name is the unique DB name of the primary DB and target_db_unique_name is the unique DB name of the standby DB. You can do this via Oracle Enterprise Manager or, alternatively, by issuing the following SQL command: &lt;xmp&gt;ALTER SYSTEM SET log_archive_config = 'DG_CONFIG=(source_db_unique_name,target_db_unique_name)' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Set the LOG_ARCHIVE_DEST_1 parameter to point to the source archive log destination, via an SQL command:&lt;xmp&gt;ALTER SYSTEM SET log_archive_dest_1 = 'LOCATION=archive_log_dir VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db_unique_name' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Set the LOG_ARCHIVE_DEST_2 parameter to point to the target archive log destination, via an SQL command:&lt;xmp&gt;ALTER SYSTEM SET log_archive_dest_2 = 'SERVICE=target_service_name VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=db_unique_name' SCOPE=SPFILE&lt;/xmp&gt; Note that SERVICE here refers to a TNS service name/alias that points to the standby/target DB instance, typically, via a tnsnames.ora service/alias stored on the primary DB.&lt;/li&gt;

&lt;li&gt;Set the LOG_ARCHIVE_DEST_STATE_1 and LOG_ARCHIVE_DEST_STATE_2 parameters to ENABLED either via OEM or an SQL command:&lt;xmp&gt;ALTER SYSTEM SET log_archive_dest_state_1 = "ENABLE" SCOPE=SPFILE;
ALTER SYSTEM SET log_archive_dest_state_2 = "ENABLE" SCOPE=SPFILE;&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Set the FAL_SERVER parameter to the service name/alias of the source/primary DB, either via OEM or an SQL command:&lt;xmp&gt;ALTER SYSTEM SET fal_server = 'source_service_name' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Set the fal_client parameter to the service name/alias of the target/standby DB, either via OEM or an SQL command:&lt;xmp&gt;ALTER SYSTEM SET fal_client = 'target_service_name' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;If the source and target DBs use different DB data file locations/folders, specify both the source and target locations via the db_file_name_convert parameter, either via OEM or an SQL command, starting with the source path, then the target path:&lt;xmp&gt;ALTER SYSTEM SET db_file_name_convert = 'E:\oracle\product\10.2.0\oradata\Test1\','C:\oracle\product\10.2.0\oradata\test1\' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;If the source and target DBs use different log file locations/folders (NOT archive log files), specify both the source and target locations via the log_file_name_convert parameter, either via OEM or an SQL command, starting with the source path, then the target path:&lt;xmp&gt;ALTER SYSTEM SET log_file_name_convert = 'E:\oracle\product\10.2.0\flash_recovery_area\TEST1\ARCHIVELOG','C:\oracle\product\10.2.0\flash_recovery_area\TEST1\ARCHIVELOG' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Set the standby_file_management parameter to AUTO, either via OEM or an SQL command:&lt;xmp&gt;ALTER SYSTEM SET standby_file_management = 'AUTO' SCOPE=SPFILE&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;If the source database is not already in archive log mode, perform the following SQL commands:&lt;xmp&gt;shutdown immediate;
startup mount;
alter database archivelog;
alter database open;&lt;/xmp&gt;To test that archiving is working, force a log switch by issuing the following SQL command:&lt;xmp&gt;ALTER SYSTEM SWITCH LOGFILE;&lt;/xmp&gt;&lt;/li&gt;

&lt;li&gt;Perform a cold backup of the source/primary DB's data files. Shutdown the database first, then copy all data files, control files, and online redo log files. After that's done, startup the DB again.&lt;/li&gt;

&lt;li&gt;Create a standby control file for the target/standby DB by issuing the following SQL command:&lt;xmp&gt;alter database create standby controlfile as 'path\test1_mtgvm1.ctl';&lt;/xmp&gt;Replace path with the directory where the control file is to be created.&lt;/li&gt;

&lt;li&gt;Create and edit an initialization file for the target/standby DB by issuing the following SQL command:&lt;xmp&gt;create pfile=path\initSID.ora' from spfile;&lt;/xmp&gt;Replace path with the directory where you want the init file created and SID with the unique DB name of the target/standby DB.&lt;/li&gt;

&lt;li&gt;Edit the target/standby init file so that the following parameters apply to the target/standby DB: DB_UNIQUE_NAME, SERVICE_NAMES, CONTROL_FILES, DB_FILE_NAME_CONVERT, LOG_FILE_NAME_CONVERT, LOG_ARCHIVE_DEST_n, INSTANCE_NAME, FAL_SERVER, and FAL_CLIENT. Switch the LOG_ARCHIVE_DEST_n values so that the source and target values are reversed, opposite in order. The same goes for the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT values--their values should be switched so that the first path is the standy's and second is the primary's. Ensure that any paths that refer to the local, standby DB are accurate. Ensure that the COMPATIBLE parameter is the same for both the primary and standby databases.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Preparing the Target/Standby Database&lt;/h4&gt;
&lt;ol&gt;

&lt;li&gt;Copy the data files, control files, and initialization file to the standby/target server/location, ensuring that they are placed in the proper directories and match paths specified in the initialization file, specifically according to paths defined in the following parameters: CONTROL_FILES, DB_FILE_NAME_CONVERT, LOG_FILE_NAME_CONVERT.&lt;/li&gt;


&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6347797846549450511?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6347797846549450511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6347797846549450511&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6347797846549450511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6347797846549450511'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/04/implementing-oracle-10g-data-guard-for.html' title='Implementing Oracle 10g Data Guard for Standby/Failover Availability'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_LdNeXsKHo20/SAI2DHj99qI/AAAAAAAAAFk/2RKA9UsFUfU/s72-c/Setting+DB_UNIQUE_NAME.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-730590054523963824</id><published>2008-04-02T20:37:00.000-07:00</published><updated>2008-04-02T20:41:07.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Configuration Assistant'/><category scheme='http://www.blogger.com/atom/ns#' term='ORA-00911'/><category scheme='http://www.blogger.com/atom/ns#' term='ORA-02156'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>ORA-02156, ORA-00911, and other Oracle Errors During Database Configuration Assistant Creation of Database</title><content type='html'>&lt;p&gt;If you get ORA-02156, ORA-00911, and other Oracle errors during a database creation process via the Database Configuration Assistant, it's most likely due to an account password that contains odd characters, such as spaces and other non-alpha-numeric characters.&lt;/p&gt;

&lt;p&gt;Choose a typical alpha-numeric password, then change it once accounts and databases have been created.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-730590054523963824?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/730590054523963824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=730590054523963824&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/730590054523963824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/730590054523963824'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/04/ora-02156-ora-00911-and-other-oracle.html' title='ORA-02156, ORA-00911, and other Oracle Errors During Database Configuration Assistant Creation of Database'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2669697483086672715</id><published>2008-03-27T08:23:00.000-07:00</published><updated>2008-03-31T08:58:17.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='mirroring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Mirroring Databases in SQL Server 2005</title><content type='html'>&lt;h4&gt;Introduction&lt;/h4&gt;

&lt;p&gt;This tutorial will show you how to mirror one database from one instance of SQL Server 2005 to another. I will be using the AdventureWorks database for this demonstration and will not be using a Witness server (only a Principal and Mirror server [i.e., Source and Target]).&lt;/p&gt;

&lt;p style="background-color:#FFFFDD"&gt;&lt;em&gt;Please note that both the Principal and Mirror servers must be of the same SQL Server edition. If they are not, mirroring will not work.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;Enable Mirroring in SQL Server 2005 &lt;u&gt;if&lt;/u&gt; SP1 is Not Installed&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;On computer/instance mirror A:&lt;/b&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the SQL Server Configuration Manager for SQL Server 2005, typically, this is located in the Programs menu of the Start button (Microsoft SQL Server 2005, then Configuration Tools).&lt;/li&gt;
&lt;li&gt;Select the SQL Server 2005 Services node.&lt;/li&gt;
&lt;li&gt;In the right pane, right-click on the SQL Server service, then click on Properties.&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-u8dtE1nYI/AAAAAAAAAB8/ErBd9KAh8JM/s400/SQL+Server+Configuration+Manager+Service+Properties.JPG" border="0" alt="SQL Server Configuration Manager for SQL Server 2005" id="BLOGGER_PHOTO_ID_5182443014722002306" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the Advanced tab.&lt;/li&gt;
&lt;li&gt;Locate the Startup Parameters field, then append trace flag 1400 to it: ; -T 1400&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-u_dtE1nZI/AAAAAAAAACE/TmUChxR-03w/s400/SQL+Server+Instance+Startup+Parameters.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182446313256885650" /&gt;&lt;/li&gt;
&lt;li&gt;Right-click on the SQL Server service, then click on either Restart or Start.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;b&gt;On computer/instance mirror B:&lt;/b&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Repeat the steps outlined for &lt;b&gt;On computer/instance mirror A&lt;/b&gt; for this computer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style="background-color:#FFFFDD"&gt;&lt;em&gt;Please note mirroring doesn't seem to work if you use this trace flag with SQL Server 2005 without any Service Packs installed. The trace flag seems to work ONLY with older RTM versions. So, if you have SQL Server 2005 with no Service Packs installed, please install them on all running instances.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;Preparing Databases for Mirroring&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Using SSMS (SQL Server Management Studio), set the Recovery Model of the source database to Full, if it's not already.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-0kjtE1naI/AAAAAAAAACM/lU4TIMfyRTs/s400/SQL+Server+Recovery+Model.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182838941987216802" /&gt;&lt;/li&gt;
&lt;li&gt;Backup the source database &lt;u&gt;AND&lt;/u&gt; transaction log(s), a full backup first, then a transaction log(s) backup.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0lDdE1nbI/AAAAAAAAACU/dRMbZUzgpPg/s400/SQL+Server+DB+Backup.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182839487448063410" /&gt;&lt;/li&gt;
&lt;li&gt;Restore the just-backed up source database &lt;u&gt;AND&lt;/u&gt; transaction log(s) to the target server/instance using the WITH NORECOVERY option for each restore(s), starting with the full database restore, then transaction log(s) restore(s), ensuring that the data file paths are not physically the same (i.e., do not overwrite the source data files with this restore).&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-0mgtE1ncI/AAAAAAAAACc/KtVkk-dMFeA/s400/SQL+Server+Restore+DB.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182841089470864834" /&gt;&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-0nTNE1neI/AAAAAAAAACs/H34kMnbQX70/s400/SQL+Server+DB+Backup+Final.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182841957054258658" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Configuring and Starting Mirroring&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Using SSMS, launch the Mirror... task on the source database.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0otdE1nfI/AAAAAAAAAC0/-npNMY8VH48/s400/SQL+Server+Mirror+Task.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182843507537452530" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the Configure Security... button.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0pidE1ngI/AAAAAAAAAC8/MD0fIWCQ7VI/s400/SQL+Server+Configure+Mirroring+Main.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182844418070519298" /&gt;&lt;/li&gt;
&lt;li&gt;Select No to NOT include a witness server.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on Next to save the security configuration.&lt;/li&gt;
&lt;li&gt;Select the source server, which should already be selected, in the Principal server instance field, set or leave the port, then specify a unique Endpoint name.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0qfdE1nhI/AAAAAAAAADE/5FwM8FqNOtE/s400/SQL+Server+Principal+Server.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182845466042539538" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select the target server in the Mirror server instance field, set or leave the port, then specify a unique Endpoint name.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0rTdE1niI/AAAAAAAAADM/G-XeNNZhVv4/s400/SQL+Server+Mirror+Task.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182846359395737122" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Set the Principal and Mirror Service Accounts, preferrably, they will be the same account.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-0r4tE1njI/AAAAAAAAADU/l7_anfhSIaI/s400/SQL+Server+Service+Accounts.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182846999345864242" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on Finish.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0tCdE1nkI/AAAAAAAAADc/gh8zLwO8yc4/s400/SQL+Server+DB+Mirror+Finish.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182848266361216578" /&gt;&lt;br /&gt;If you run into problems, re-click on the Configure Security button to change the parameters. You should get Successful results for both Endpoints.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-0tttE1nlI/AAAAAAAAADk/sUdyFnkd9w4/s400/SQL+Server+DB+Mirror+Results.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182849009390558802" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Do Not Start Mirroring.&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R-0569E1nnI/AAAAAAAAAD0/kYFHJaTCnww/s400/SQL+Server+DB+Mirror+Start.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182862431163358834" /&gt;&lt;/li&gt;
&lt;li&gt;Start mirroring by clicking on the Start Mirroring button. If successfull, the Pause button should be enabled.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-0-jdE1nqI/AAAAAAAAAEM/F4nKpHRwMmo/s400/SQL+Server+DB+Mirror+Starting.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182867524994571938" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Using the Database Mirroring Monitor&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;In SSMS, right-click on the source database, navigate to Tasks, then click on Launch Database Mirroring Monitor...&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-1StNE1nrI/AAAAAAAAAEU/pBa6FmE316o/s400/SQL+Server+DB+database+Mirroring+Monitor.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182889682730852018" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Register mirrored database.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-1T6dE1nsI/AAAAAAAAAEc/xinRgw3TZSY/s400/SQL+Server+DB+Database+Mirroring+Monitor+Register.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182891009875746498" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the Connect button, then select the Mirror/target server.&lt;/li&gt;
&lt;li&gt;Click on the Register checkbox in the Mirrored databases list.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-1UjdE1ntI/AAAAAAAAAEk/CQb884m4tmo/s400/SQL+Server+DB+Database+Mirroring+Monitor+Registered+Servers.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182891714250383058" /&gt;&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the left pane, expand the Database Mirroring Monitor node by clicking on the plus sign.&lt;/li&gt;
&lt;li&gt;Click on the mirrored database. You should now see the status of the mirror.&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-1VQNE1nuI/AAAAAAAAAEs/9wM5j1qKaVk/s400/SQL+Server+DB+Database+Mirroring+Monitor+Status.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5182892483049529058" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Failing Over to the Mirrored/Target Database&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Execute the following T-SQL command at the mirror:&lt;cite&gt;ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS&lt;/cite&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Issues to Consider About Database Mirroring and this Tutorial&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;b&gt;The source/Principal and target/Mirror SQL Server Service account(s) must be granted CONNECT permission on the target/Mirror and source/Principal servers respectively.&lt;/b&gt; If not, mirroring will fail upon start.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Encryption&lt;/b&gt; - By default, data is encrypted, sent to the mirror, then decrypted. This uses up more server resources and bandwidth than it would without encryption. So, ONLY use encryption if the data being mirrored is sensitive and should be encrypted.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Witness&lt;/b&gt; - This tutorial doesn't use a Witness server. A witness server can provided automated failover capabilities.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Asynchronous mirroring is only available in SQL Server 2005 Enterprise &amp; Developer Editions&lt;/b&gt;, Synchronous mirroring is available in all others, except for Express Edition. So, fully evaluate the performance implications when using mirroring with SQL Server 2005 Standard Edition, as performance might be negatively impacted in a production environment.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2669697483086672715?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2669697483086672715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2669697483086672715&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2669697483086672715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2669697483086672715'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/mirroring-databases-in-sql-server-2005.html' title='Mirroring Databases in SQL Server 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_LdNeXsKHo20/R-u8dtE1nYI/AAAAAAAAAB8/ErBd9KAh8JM/s72-c/SQL+Server+Configuration+Manager+Service+Properties.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-7894586488541402850</id><published>2008-03-24T08:27:00.000-07:00</published><updated>2008-03-24T16:51:19.677-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SetParent failed for Database'/><category scheme='http://www.blogger.com/atom/ns#' term='BDC'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='definition editor'/><title type='text'>Business Data Catalog Definition Editor Installation Error 'SetParent failed for Database'</title><content type='html'>&lt;p&gt;If you get a 'SetParent failed for Database' error during the installation of the Microsoft Business Data Catalog Definition Editor, allow remote connections to the local SQL Server 2005 Express Edition server:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start the "SQL Server Surface Area Configuration" application.&lt;/li&gt;
&lt;li&gt;Click on "Surface Area Configuration for Services and Connections".&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-g-JtE1nWI/AAAAAAAAABs/EkNzs99o0ZU/s400/SQL+Server+Surface+Area+Configuration.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181459707729386850" /&gt;&lt;/li&gt;
&lt;li&gt;Under Database Engine, select Remote Connections.&lt;/li&gt;
&lt;li&gt;Select "Local and remote connections".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R-g-XNE1nXI/AAAAAAAAAB0/u351OY2KBZs/s400/SQL+Server+2005+Remote+Connections.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181459939657620850" /&gt;&lt;/li&gt;
&lt;li&gt;Close the application.&lt;/li&gt;
&lt;li&gt;Retry the BDC Editor installation.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-7894586488541402850?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/7894586488541402850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=7894586488541402850&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7894586488541402850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/7894586488541402850'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/business-data-catalog-definition-editor.html' title='Business Data Catalog Definition Editor Installation Error &apos;SetParent failed for Database&apos;'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_LdNeXsKHo20/R-g-JtE1nWI/AAAAAAAAABs/EkNzs99o0ZU/s72-c/SQL+Server+Surface+Area+Configuration.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6430045237267467201</id><published>2008-03-19T12:27:00.000-07:00</published><updated>2008-03-24T08:12:27.724-07:00</updated><title type='text'>Displaying External Web Services Data in SharePoint Server 2007</title><content type='html'>&lt;h4&gt;Prerequisites&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;SharePoint Server 2007 (MOSS 2007) Enterprise Edition&lt;/li&gt;
&lt;li&gt;SharePoint Server 2007 SDK v1.3 or newer&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Building the Application Definition File&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;If you haven't already installed the BDC Definition Editor, install it. It should be located here: "%ProgramFiles%\2007 Office System Developer Resources\Tools\BDC Definition Editor". Just launch the setup.exe program to install it.&lt;/li&gt;
&lt;li&gt;From the Programs menu, startup the Microsoft ® Business Data Catalog Definition Editor.&lt;/li&gt;
&lt;li&gt;Click on "Add LOB SYstem".&lt;/li&gt;
&lt;li&gt;Click on "Connect to Webservice".&lt;/li&gt;
&lt;li&gt;Enter the following Web Service URL in the Url field: &lt;a href="http://ws.cisa.ca/WehireWS/JobsWs.asmx?WSDL"&gt;http://ws.cisa.ca/WehireWS/JobsWs.asmx?WSDL&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on Connect.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-ccP9E1nSI/AAAAAAAAABM/-QaOBqPJqmM/s400/AddLOBSystem.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181140956731514146" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the "Add Web Method" side-button.&lt;/li&gt;
&lt;li&gt;Drag the GetJobsByTitle method onto the Design area.&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R-ceAdE1nTI/AAAAAAAAABU/MUxRxgU8zWI/s400/AddWebMethod.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181142889466797362" /&gt;&lt;/li&gt;
&lt;li&gt;Call the LOB System Name "JobsWesternCanadaWebService" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objecta pane, click on the JobsWesternCanadaWebService system.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the WildcardCharacter field to "$" (without quotes).&lt;/li&gt;
&lt;li&gt;Ensure that that WsdlAuthenticationMode is set to PassThrough.&lt;/li&gt;
&lt;li&gt;Set the DefaultDisplayName to "Jobs in Western Canada Web Service" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, expand the Entities node, then click on Entity0.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Title to "Jobs in Western Canada" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the Name property to "JobsWesternCanada" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the DefaultDisplayName to "Jobs in Western Canada" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, right-click on the Identifiers node, then click on Add Identifier.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Name to "Title" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, locate the GetJobsByTitle method, then locate the title parameter.&lt;/li&gt;
&lt;li&gt;Expand the title parameter's nodes until you reach the Item node, then select it.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Identifier property to Title[JobsWesternCanada].&lt;/li&gt;
&lt;li&gt;Set the name property to "Title" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, expand the Return parameter's nodes until you reach the Item node, then click on the Title node.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Identifier property to Title[JobsWesternCanada].&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, locate the Filters node of the GetJobsByTitle method.&lt;/li&gt;
&lt;li&gt;Right-click on the Filters node, then click on Add Filter.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Name to "TitleEqualsFilter" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the DefaultDisplayName to "Title" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the FilterType to Equals.&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, locate and expand the last title parameter node of the GetJobsByTitle method, then select it.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the FilterDescriptor to TitleEqualsFilter.&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, right-click on the Instances node of the GetJobsByTitle method, then click on Add Method Instance.&lt;/li&gt;
&lt;li&gt;Select Association as the Method Instance Type.&lt;/li&gt;
&lt;li&gt;In the Source Entities pane, set the entity to JobsWesternCanada.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R-cj2dE1nVI/AAAAAAAAABk/HrJOejrrZN8/s400/CreateMethodInstance.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181149314737872210" /&gt;&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Name property to "GetJobsByTitleAssociationInstance" (without quotes).&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, right-click on the Instances node of the GetJobsByTitle method, then click on Add Method Instance.&lt;/li&gt;
&lt;li&gt;Select Finder as the Method Instance Type.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Properties pane, set the Name to "GetJobsByTitleFinderInstance" (without quotes).&lt;/li&gt;
&lt;li&gt;Test to ensure the Finder method works by a) right-clicking on the GetJobsByTitleFinderInstance method, b) clicking on Execute, c) entering ".NET Web Developer" (without quotes) in the Value field, d) then clicking on the Execute button. You should get results back from the web service. Close the test form.&lt;/li&gt;
&lt;li&gt;In the Metadata Objects pane, select the JobsWesternCanadaWebService LOB system.&lt;/li&gt;
&lt;li&gt;Click on the Export button, then save the file as "JobsWesternCanadaWebService.xml" (without quotes).&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_LdNeXsKHo20/R-cjMdE1nUI/AAAAAAAAABc/xcl-vhmuriQ/s400/BDCEditor.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5181148593183366466" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Importing the BDC Definition File&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Open up the SharePoint 3.0 Central Administration web page.&lt;/li&gt;
&lt;li&gt;Under Shared Services Administration, click on the shared service listed.&lt;/li&gt;
&lt;li&gt;Under Business Data Catalog, click on "Import application definition".&lt;/li&gt;
&lt;li&gt;Click on the Browse button, then locate and open the JobsWesternCanadaWebService.xml file.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-aEMdE1nLI/AAAAAAAAAAU/JUFN2QtHEV0/s400/BDCImportDefinition.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180973770834549938" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Import.&lt;/li&gt;
&lt;li&gt;You should've gotten a success message. Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Manage Permissions.&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_LdNeXsKHo20/R-aGE9E1nNI/AAAAAAAAAAk/4XoSPc8u_W8/s400/BDCDefinitionManagePermissions.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180975841008786642" /&gt;&lt;/li&gt;
&lt;li&gt;Add the users/groups you'd like to grant permission to execute the LOB system.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-aFGdE1nMI/AAAAAAAAAAc/7RpJEprarD0/s400/BDCDefinitionPermissions.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180974767266962626" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Displaying the Web Service Data via a Business Data List&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;In the SharePoint Server 2007 site, navigate to a web part page where you'd like to see the web service in action.&lt;/li&gt;
&lt;li&gt;Click on Site Actions, then Edit Page.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-aG4NE1nOI/AAAAAAAAAAs/YmYk-eM0MqA/s400/EditPage.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180976721477082338" /&gt;&lt;/li&gt;
&lt;li&gt;Click on "Add a Web Part".&lt;/li&gt;
&lt;li&gt;Expand the "All Web Parts" node.&lt;/li&gt;
&lt;li&gt;Under Business Data, check the "Business Data List" web part.&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_LdNeXsKHo20/R-aIHNE1nPI/AAAAAAAAAA0/YpvykQXhnyk/s400/AddBusinessDataList.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180978078686747890" /&gt;&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Click on Edit in the "Business Data List" web part, then click on "Modify shared web part".&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-aI6dE1nQI/AAAAAAAAAA8/j3axwlpPLUE/s400/EditBusinessDataList.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180978959155043586" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the Browse icon, next to the Type field.&lt;/li&gt;
&lt;li&gt;Select JobsWesternCanadaWebService_Instance, then click on OK.&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_LdNeXsKHo20/R-aKVdE1nRI/AAAAAAAAABE/4MF2OTKqx8g/s400/BusinessDataListProperties.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5180980522523139346" /&gt;&lt;/li&gt;
&lt;li&gt;Click on the Apply button.&lt;/li&gt;
&lt;li&gt;Click on the OK button.&lt;/li&gt;
&lt;li&gt;Click on the Publish button, if necessary, to save the page changes.&lt;/li&gt;
&lt;li&gt;In the "Jobs in Western Canada List" web part, enter ".NET Web Developer" (without quotes) in the "Title is equal to" field.&lt;/li&gt;
&lt;li&gt;Click on Retrieve Data. As of March 23, 2008, there is one result listed.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5180968144427392162" alt="" src="http://bp0.blogger.com/_LdNeXsKHo20/R-Z_E9E1nKI/AAAAAAAAAAM/4e2gDRAtvnw/s400/JobsWesternCanadaListResults.JPG" border="0" /&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6430045237267467201?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6430045237267467201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6430045237267467201&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6430045237267467201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6430045237267467201'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/displaying-external-db-data-in.html' title='Displaying External Web Services Data in SharePoint Server 2007'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_LdNeXsKHo20/R-ccP9E1nSI/AAAAAAAAABM/-QaOBqPJqmM/s72-c/AddLOBSystem.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2256355535258000043</id><published>2008-03-17T08:51:00.000-07:00</published><updated>2008-06-09T17:10:56.172-07:00</updated><title type='text'>What to do if you get MOSS 2007 COM/W3SVC-WP 80070005 Errors</title><content type='html'>&lt;p&gt;I recently installed a MOSS 2007 server and applied several service packs, including WSS SP1 and MOSS 2007 SP1. This resulted in COM+ application security settings being reset to their default settings, specifically the COM+ application, OSearch.&lt;/p&gt;

&lt;p&gt;

&lt;p&gt;The event viewer revealed the following error, for me:&lt;/p&gt;

&lt;cite&gt;The Execute method of job definition Microsoft.Office.Server.Search.Administration.IndexingScheduleJobDefinition (ID 86e55a13-e654-4458-aa3c-87f910d6ec9e) threw an exception. More information is included below.

Retrieving the COM class factory for component with CLSID {3D42CCB1-4665-4620-92A3-478F47389230} failed due to the following error: 80070005.&lt;/cite&gt;

&lt;p&gt;Other associated errors produced by this problemare shown below and can be resolved by the following steps:&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;Starting up database 'SharedServices1_Search_DB_GUID'.&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;The worker process failed to initialize the http.sys communication or the w3svc communication layer and therefore could not be started.  The data field contains the error number.&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Unable to reach Excel Calculation Services http://HOSTNAME:PORT/SharedServicesProvider/ExcelCalculationServer/ExcelService.asmx.&lt;/cite&gt;&lt;/p&gt;

&lt;h4&gt;Ensure that all Relevant COM+ Applications are Accessible by the ASPNET, WSS &amp; Service Accounts&lt;/h4&gt;

&lt;p&gt;To fix this problem, follow these steps on the computer hosting MOSS 2007:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the Windows' Start button.&lt;/li&gt;
&lt;li&gt;Click on Run.&lt;/li&gt;
&lt;li&gt;Type "%WINDIR%\system32\Com\comexp.msc" (without quotes), then press the Enter key.&lt;/li&gt;
&lt;li&gt;Navigate to the Component Services, Computers, My Computer, DCOM Config folder.&lt;/li&gt;
&lt;li&gt;Right-click on the OSearch application, then click on Properties.&lt;/li&gt;
&lt;li&gt;Click on the Security tab.&lt;/li&gt;
&lt;li&gt;In the Launch and Activation section, click on Edit.&lt;/li&gt;
&lt;li&gt;Ensure that any and all WSS* accounts are listed. If they are not, add them.&lt;/li&gt;
&lt;li&gt;Grant these accounts all of the permissions available.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Access Permissions section, click on Edit.&lt;/li&gt;
&lt;li&gt;Ensure that all of the the ASPNET, WSS*, and SP service accounts are listed. If they are not, add them.&lt;/li&gt;
&lt;li&gt;Grant these accounts all of the permissions available.&lt;/li&gt;
&lt;li&gt;Click on OK twice.&lt;/li&gt;
&lt;li&gt;Repeat steps 5 through 14 above for the following other SP COM applications: SharedAccess, SPSearch.&lt;/li&gt;
&lt;li&gt;Restart IIS by running "iisreset" (without quotes) from a command prompt.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Ensure that the Identity Account is the Same Across All WSS/MOSS Shared Services (ONLY) Web Application Pools&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Login to SharePoint Central Administration.&lt;/li&gt;
&lt;li&gt;Under Central Administration, click on Operations.&lt;/li&gt;
&lt;li&gt;Under Security Configuration, click on Service accounts.&lt;/li&gt;
&lt;li&gt;Select Web application pool.&lt;/li&gt;
&lt;li&gt;Select the Web Service pool.&lt;/li&gt;
&lt;li&gt;Select the affected Web service.&lt;/li&gt;
&lt;li&gt;In the list of Application pools, for each Shared Service Pool, configure the account to be the same and that that account has been granted access to the COM+ applications in the preceding section.&lt;/li&gt;
&lt;li&gt;Click on OK once done.&lt;/li&gt;
&lt;li&gt;Restart IIS6 by executing "iisreset" from the Windows' Run dialog box.&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2256355535258000043?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2256355535258000043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2256355535258000043&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2256355535258000043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2256355535258000043'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/what-to-do-if-you-get-wss-3moss-2007.html' title='What to do if you get MOSS 2007 COM/W3SVC-WP 80070005 Errors'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-4965386359728117230</id><published>2008-03-10T08:33:00.000-07:00</published><updated>2008-03-22T13:50:48.463-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='vs.net 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint server 2007'/><title type='text'>Creating Custom SharePoint Server 2007 Workflows with VS.NET 2005</title><content type='html'>&lt;a name="#TOC"&gt;&lt;/a&gt;
&lt;h4&gt;Table of Contents&lt;/h4&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#creatinginitform"&gt;Creating the InfoPath Initiation Form&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#creatingactionform"&gt;Creating the InfoPath Action Form&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#creatingworkflow"&gt;Creating the Approval Workflow in VS.NET 2005&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#deploying"&gt;Deploying the VS.NET workflow and InfoPath forms to SharePoint Server 2007&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#usingworkflow"&gt;Using the Deployed Custom Workflow in SharePoint Server 2007&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#makingchanges"&gt;If Problems Arise, and Making Changes&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#whatsmissing"&gt;What's Missing from this Workflow?&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#resources"&gt;Additional Information &amp; Resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;a name="introduction"&gt;&lt;/a&gt;
&lt;h4&gt;Introduction&lt;/h4&gt;

&lt;p&gt;As an enterprise developer, it's no surprise that one business process often encountered is the approving of documents, such as legal contracts, budgets, etc. Business workflows are often followed, but in a way that is typically inefficient. For example, an employee might fill out an expense report and forward it to HR for approval. This typically involves filling out an Excel or Word document, e-mailing it to HR for processing, then waiting for either a check and/or a response or request for changes. SharePoint offers a simplified solution for routing documents through a workflow process. The problem is that there are few workflows available in SharePoint, some may not meet the requirements/needs of the business, and you can't modify existing, builtin SharePoint workflows.&lt;/p&gt;

&lt;p&gt;There are two ways to add custom-built workflows to SharePoint Server 2007: SharePoint Designer 2007 and Visual Studio .Net 2005 with Extensions for Workflows (WF). SharePoint Designer 2007 offers limited workflow authoring, but VS.NET 2005 (and later) offers significantly extensible capabilities.&lt;/p&gt;

&lt;p&gt;The following tutorial shows you how to develop a simple workflow that allows an approver to reject, approve, or set other statuses of a document.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Requirements:&lt;/b&gt; &lt;em&gt;(All of the following must be installed and performed on the SharePoint Server 2007 server.)&lt;/em&gt; 
&lt;ul&gt;&lt;li&gt;Visual Studio .NET 2005&lt;/li&gt;
&lt;li&gt;Visual Studio Tools for Applications (part of MS Office)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;displaylang=en"&gt;Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;SharePoint Server 2007&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=6D94E307-67D9-41AC-B2D6-0074D6286FA9&amp;displaylang=en"&gt;SharePoint Server 2007 SDK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=4191A531-A2E9-45E4-B71E-5B0B17108BD2"&gt;Windows SharePoint Services 3.0 Service Pack 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD59175C-ADp6A-4027-8C2F-DB25322F791B&amp;displaylang=en"&gt;2007 Microsoft Office Servers Service Pack 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;InfoPath 2007&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;(All of the following must be performed on the SharePoint Server 2007 server.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="creatinginitform"&gt;&lt;/a&gt;
&lt;h4&gt;Creating the InfoPath Initiation Form&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Startup InfoPath 2007.&lt;/li&gt;
&lt;li&gt;Click on Design a Form Template, in the Design a Form area.&lt;/li&gt;
&lt;li&gt;Click on Blank, in the Form Template area.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Data Source, under Design Tasks.&lt;/li&gt;
&lt;li&gt;Right-click on the myFields folder, then click on Properties.&lt;/li&gt;
&lt;li&gt;Set the Name of the Data Source to "initiationFields" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on the initiationFields folder, then click on Add.&lt;/li&gt;
&lt;li&gt;Enter "initApprover" (without quotes) in the Name field.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on the initiationFields folder, then click on Add.&lt;/li&gt;
&lt;li&gt;Enter "initExpires" (without quotes) in the Name field.&lt;/li&gt;
&lt;li&gt;Set the Data type to Date and Time.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on the initiationFields folder, then click on Add.&lt;/li&gt;
&lt;li&gt;Enter "initComments" (without quotes) in the Name field.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Design Tasks, then click on Controls.&lt;/li&gt;
&lt;li&gt;Uncheck the Automatically create data source check box.&lt;/li&gt;
&lt;li&gt;From the Controls toolbox, drag a Text Box control onto the design area.&lt;/li&gt;
&lt;li&gt;Click on initApprover, then click on OK.&lt;/li&gt;
&lt;li&gt;Rename the label to "Approver:" (without quotes).&lt;/li&gt;
&lt;li&gt;Drag and drop a Date Picker control onto the design area.&lt;/li&gt;
&lt;li&gt;Click on initExpires, then click on OK.&lt;/li&gt;
&lt;li&gt;Rename the label to "Expires:" (without quotes).&lt;/li&gt;
&lt;li&gt;Drag a Text Box control onto the design area.&lt;/li&gt;
&lt;li&gt;Click on initComments, then click on OK.&lt;/li&gt;
&lt;li&gt;Rename the label to "Comments:" (without quotes).&lt;/li&gt;
&lt;li&gt;Drag a button onto the design area.&lt;/li&gt;
&lt;li&gt;Right-click on the button, then click on Button Properties.&lt;/li&gt;
&lt;li&gt;Set the Label to "Send for Approval" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Rules.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Click on Add Action.&lt;/li&gt;
&lt;li&gt;Select Submit using a data connection, from the Action drop-down list.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Select Create a new connection to.&lt;/li&gt;
&lt;li&gt;Select Submit data.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select To the hosting environment...&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Name the data connection "Initiation" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Finish.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Add Action.&lt;/li&gt;
&lt;li&gt;Select Close the form, from the Action drop-down list.&lt;/li&gt;
&lt;li&gt;Uncheck the "... prompt to save ..." check box.&lt;/li&gt;
&lt;li&gt;Click on OK four times.&lt;/li&gt;
&lt;li&gt;Click on Tools, in the menu bar, then click on Form Options.&lt;/li&gt;
&lt;li&gt;Click on Security and Trust.&lt;/li&gt;
&lt;li&gt;Uncheck "Automatically determine security level...".&lt;/li&gt;
&lt;li&gt;Select Full Trust.&lt;/li&gt;
&lt;li&gt;Check the "Sign this form template" check box.&lt;/li&gt;
&lt;li&gt;Click on Create Certificate.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Compatibility.&lt;/li&gt;
&lt;li&gt;Check the "Design a form template that can be opened in a browser...".&lt;/li&gt;
&lt;li&gt;In the "Enter the URL of a server..." field, enter the HTTP path to the SharePoint 2007 server (e.g., http://dotnetfun).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Attaching an Item Metadata Schema File which allows us to set form fields from the VS.NET workflow.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Open/start an instance of Windows' Notepad.&lt;/li&gt;
&lt;li&gt;Enter the following XML code:&lt;xmp&gt;&lt;z:row xmlns:z="#RowsetSchema" ows_initApprover="" ows_initExpires="" ows_initComments="" /&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Save the document as ItemMetadata.xml (ensuring that "Save as Type" is set to "All types").&lt;/li&gt;
&lt;li&gt;Close Windows' Notepad.&lt;/li&gt;
&lt;li&gt;Click on Data Source, under Design Tasks.&lt;/li&gt;
&lt;li&gt;Click on Data Source.&lt;/li&gt;
&lt;li&gt;Click on Manage Data Connections.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Select "Create a new connection to:", then select Receive data.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select XML document, then click on Next.&lt;/li&gt;
&lt;li&gt;Click on Browse, then locate the ItemMetadata.xml file you just saved.&lt;/li&gt;
&lt;li&gt;Open the ItemMetadata.xml file.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select "Include the data as a resource...", then click on Next.&lt;/li&gt;
&lt;li&gt;Set the name to "ItemMetadata" (without quotes), and ensure the check box is checked.&lt;/li&gt;
&lt;li&gt;Click on Finish.&lt;/li&gt;
&lt;li&gt;Click on Close.&lt;/li&gt;
&lt;li&gt;In the design area, right-click on the initComments text box, then click on Properties.&lt;/li&gt;
&lt;li&gt;In the Default Value area, click on the button next to the Value field.&lt;/li&gt;
&lt;li&gt;Click on "Insert Field or Group".&lt;/li&gt;
&lt;li&gt;From the Data Source drop-down list, select ItemMetadata.&lt;/li&gt;
&lt;li&gt;Click on/select the initComments field.&lt;/li&gt;
&lt;li&gt;Click OK three times.&lt;/li&gt;
&lt;li&gt;In the design area, right-click on the initExpires Date Picker, then click on Properties.&lt;/li&gt;
&lt;li&gt;In the Default Value area, click on the button next to the Value field.&lt;/li&gt;
&lt;li&gt;Click on "Insert Field or Group".&lt;/li&gt;
&lt;li&gt;From the Data Source drop-down list, select ItemMetadata.&lt;/li&gt;
&lt;li&gt;Click on/select the initExpires field.&lt;/li&gt;
&lt;li&gt;Click OK three times.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Publishing the form.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Click on File, from the menu bar, then click on Publish.&lt;/li&gt;
&lt;li&gt;Click on "To a network location...".&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on the Browse button, then press Alt-4.&lt;/li&gt;
&lt;li&gt;Call the folder "Published InfoPath Forms" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Set the file name to "ApprovalInitiation.xsn" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Set the "Form template name" to "ApprovalInitiation" (without quotes).&lt;/li&gt;
&lt;li&gt;
&lt;li&gt;Click on Next, ensuring the user access path/field is empty.&lt;/li&gt;
&lt;li&gt;Click on Publish.&lt;/li&gt;
&lt;li&gt;Click on Close.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Generating an initiationFields class file for use with the VS.NET workflow project.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Click on File, from the menu bar, then click on "Save as Source Files".&lt;/li&gt;
&lt;li&gt;Navigate to where the form was published in the preceding steps, then click on OK, clicking on OK to ignore the warning.&lt;/li&gt;
&lt;li&gt;In Windows, click on the Start button, then navigate to Programs, Microsoft Visual Studio 2005, Visual Studio Tools, then click on "Visual Studio 2005 Command Prompt".&lt;/li&gt;
&lt;li&gt;Navigate to the location where the form was published. For example, try typing and entering this: &lt;em&gt;cd "%HOMEPATH%\My Documents\Published InfoPath Forms"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Type and enter the following command: &lt;em&gt;xsd /c myschema.xsd /o:.&lt;/em&gt;
&lt;li&gt;Back in InfoPath, Save the InfoPath document, calling it "ApprovalInitiation.xsn" (without quotes), clicking on OK when prompted about Publishing the form.&lt;/li&gt;
&lt;li&gt;Close InfoPath.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="creatingactionform"&gt;&lt;/a&gt;
&lt;h4&gt;Creating the InfoPath Action Form&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Startup InfoPath 2007.&lt;/li&gt;
&lt;li&gt;Click on Design a Form Template, in the Design a Form area.&lt;/li&gt;
&lt;li&gt;Click on Blank, in the Form Template area.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Data Source, under Design Tasks.&lt;/li&gt;
&lt;li&gt;Right-click on the myFields folder, then click on Properties.&lt;/li&gt;
&lt;li&gt;Set the Name of the Data Source to "actionFields" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on the actionFields folder, then click on Add.&lt;/li&gt;
&lt;li&gt;Set the Name to "actionStatus" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on the actionStatus field in the actionFields data source, then click on Properties.&lt;/li&gt;
&lt;li&gt;In the Defaul Value area, click on the button next to Value.&lt;/li&gt;
&lt;li&gt;Click on "Insert Field or Group".&lt;/li&gt;
&lt;li&gt;Activate the Data Source drop-down list box, then select ItemMetadata.&lt;/li&gt;
&lt;li&gt;Click on actionStatus, then click on OK.&lt;/li&gt;
&lt;li&gt;Click on OK two times.&lt;/li&gt;
&lt;li&gt;Right-click on the actionFields folder, then click on Add.&lt;/li&gt;
&lt;li&gt;Set the Name to "actionComments" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Design Tasks, then click on Controls.&lt;/li&gt;
&lt;li&gt;Uncheck the Automatically create data source check box.&lt;/li&gt;
&lt;li&gt;Drag a Drop-down List Box onto the design area.&lt;/li&gt;
&lt;li&gt;Select actionStatus, then click on OK.&lt;/li&gt;
&lt;li&gt;Rename the label to "Approval Status:" (without quotes).&lt;/li&gt;
&lt;li&gt;Right-click on the drop-down list box, then click on Properties.&lt;/p&gt;
&lt;li&gt;In the "List box entries" section, ensure that "Enter list box entries manually" is selected.&lt;/li&gt;
&lt;li&gt;Select the first list entry, then click on Modify.&lt;/li&gt;
&lt;li&gt;Enter "Approve" (without quotes) in the Value and Display Name fields.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Enter "Needs Revising" in the Value and Display Name fields.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Enter "Reject" in the Value and Display Name fields.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Drag and drop a Text Box control onto the design area.&lt;/li&gt;
&lt;li&gt;Select actionComments, then click on OK.&lt;/li&gt;
&lt;li&gt;Drag a button onto the design area.&lt;/li&gt;
&lt;li&gt;Right-click on the button, then click on Button Properties.&lt;/li&gt;
&lt;li&gt;Set the Label to "Submit" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Rules.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Click on Add Action.&lt;/li&gt;
&lt;li&gt;Select Submit using a data connection, from the Action drop-down list.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Select Create a new connection to.&lt;/li&gt;
&lt;li&gt;Select Submit data.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select "To the hosting environment...".&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Name the data connection "Action" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Finish.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Add Action.&lt;/li&gt;
&lt;li&gt;Select Close the form, from the Action drop-down list.&lt;/li&gt;
&lt;li&gt;Uncheck the "... prompt to save ..." check box.&lt;/li&gt;
&lt;li&gt;Click on OK four times.&lt;/li&gt;
&lt;li&gt;Click on Tools, in the menu bar, then click on Form Options.&lt;/li&gt;
&lt;li&gt;Click on Security and Trust.&lt;/li&gt;
&lt;li&gt;Uncheck "Automatically determine security level...".&lt;/li&gt;
&lt;li&gt;Select Full Trust.&lt;/li&gt;
&lt;li&gt;Check the "Sign this form template" check box.&lt;/li&gt;
&lt;li&gt;Click on Create Certificate.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Compatibility.&lt;/li&gt;
&lt;li&gt;Check the "Design a form template that can be opened in a browser...".&lt;/li&gt;
&lt;li&gt;In the "Enter the URL of a server..." field, enter the HTTP path to the SharePoint 2007 server (e.g., http://dotnetfun).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Attaching an Item Metadata Schema File which allows us to set form fields from the VS.NET workflow.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Open/start an instance of Windows' Notepad.&lt;/li&gt;
&lt;li&gt;Enter the following XML code:&lt;xmp&gt;&lt;z:row xmlns:z="#RowsetSchema" ows_actionStatus="" ows_actionComments="" /&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Save the document as ItemMetadata.xml (ensuring that "Save as Type" is set to "All types").&lt;/li&gt;
&lt;li&gt;Close Windows' Notepad.&lt;/li&gt;
&lt;li&gt;Click on Data Source, under Design Tasks.&lt;/li&gt;
&lt;li&gt;Click on Data Source.&lt;/li&gt;
&lt;li&gt;Click on Manage Data Connections.&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;Select "Create a new connection to:", then select Receive data.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select XML document, then click on Next.&lt;/li&gt;
&lt;li&gt;Click on Browse, then locate the ItemMetadata.xml file you just saved.&lt;/li&gt;
&lt;li&gt;Open the ItemMetadata.xml file.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Select "Include the data as a resource...", then click on Next.&lt;/li&gt;
&lt;li&gt;Set the name to "ItemMetadata" (without quotes), and ensure the check box is checked.&lt;/li&gt;
&lt;li&gt;Click on Finish.&lt;/li&gt;
&lt;li&gt;Click on Close.&lt;/li&gt;
&lt;li&gt;In the design area, right-click on the actionComments text box, then click on Properties.&lt;/li&gt;
&lt;li&gt;In the Default Value area, click on the button next to the Value field.&lt;/li&gt;
&lt;li&gt;Click on "Insert Field or Group".&lt;/li&gt;
&lt;li&gt;From the Data Source drop-down list, select ItemMetadata.&lt;/li&gt;
&lt;li&gt;Click on/select the actionComments field.&lt;/li&gt;
&lt;li&gt;Click OK three times.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Publishing the form.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Click on File, from the menu bar, then click on Publish.&lt;/li&gt;
&lt;li&gt;Click on "To a network location...".&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on the Browse button, then navigate to and open the "Published InfoPath Forms" folder.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Set the file name to "ApprovalAction.xsn" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Set the "Form template name" to "ApprovalAction" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Next, ensuring the user access path/field is empty.&lt;/li&gt;
&lt;li&gt;Click on Publish.&lt;/li&gt;
&lt;li&gt;Click on Close.&lt;/li&gt;
&lt;li&gt;Save the InfoPath document, calling it "ApprovalAction.xsn" (without quotes), clicking on OK when prompted about Publishing the form.&lt;/li&gt;
&lt;li&gt;Close InfoPath.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="creatingworkflow"&gt;&lt;/a&gt;
&lt;h4&gt;Creating the Approval Workflow in VS.NET 2005&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Startup VS.NET 2005.&lt;/li&gt;
&lt;li&gt;Click on File--&gt;new--Project.&lt;/li&gt;
&lt;li&gt;Select SharePoint, under Project Types.&lt;/li&gt;
&lt;li&gt;Select SharePoint Server Sequential Workflow Library, under Templates.&lt;/li&gt;
&lt;li&gt;Name the project and solution "SharePointApprovalWorkflow" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Adding the initiationFields class file to the project.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;In the Solution Explorer, right-click on the SharePointApprovalWorkflow project, then navigate to Add, then click on Existing Item...&lt;/li&gt;
&lt;li&gt;Navigate to the folder where the initiationFields class file was generated using the VS.NET xsd command. This might be &lt;em&gt;"%HOMEPATH%\My Documents\Published InfoPath Forms"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Select the myschema.cs class file, but DO NOT open it.&lt;/li&gt;
&lt;li&gt;Press F2 to rename the class file, calling it "initiationFields.cs" (without quotes), then press Enter to commit the rename.&lt;/li&gt;
&lt;li&gt;Click on Add, ensuring the class file was added in the Solution Explorer.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Creating the workflow.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;In the Solution Explorer, right-click on Workflow1.cs, then click on View Designer.&lt;/li&gt;
&lt;li&gt;In the designer, right-click on onWorkflowActivated1, then click on Generate Handlers.&lt;/li&gt;
&lt;li&gt;Directly above the onWorkflowActivated1_Invoked method, but NOT inside of the method itself, type the following:&lt;xmp&gt;        public String initApprover = default(String);
        public DateTime? initExpires = default(DateTime?);
        public String initComments = default(String);&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;In the designer, right-click on onWorkflowActivated1, then click on Properties.&lt;/li&gt;
&lt;li&gt;Inside of the onWorkflowActivated1_Invoked method, type the following code:&lt;xmp&gt;            XmlSerializer serializer = new XmlSerializer(typeof(initiationFields));
            XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(this.workflowProperties.InitiationData));
            initiationFields initFields = (initiationFields)serializer.Deserialize(reader);
            this.initApprover = initFields.initApprover;
            this.initExpires = initFields.initExpires;
            this.initComments = initFields.initComments;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right-click on Workflow1.cs, then click on View Designer.&lt;/li&gt;
&lt;li&gt;Right-click on onWorkflowActivated1, then click on Properties.&lt;/li&gt;
&lt;li&gt;In the Toolbox, drag and drop a CreateTask object onto the design area, directly beneath the onWorkflowActivated1 object, from the SharePoint - Workflow Task area.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the CorrelationToken property's empty field, then type "taskToken" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on the plus sign next to the CorrelationToken property, then select Workflow1 in the OwnerActivityName property.&lt;/li&gt;
&lt;li&gt;Click on the TaskID property, then click on the elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member" tab."&lt;/li&gt;
&lt;li&gt;Select Create Field, then type "taskID" (without quotes) in the "New member name" field.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on the TaskProperties property, then click on the elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member" tab."&lt;/li&gt;
&lt;li&gt;Select Create Field, then type "taskProperties" (without quotes) in the "New member name" field.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;In the designer, right-click on createTask1, then click on Generate Handlers.&lt;/li&gt;
&lt;li&gt;At the top of the class file, add the following using statement:&lt;xmp&gt;using Microsoft.SharePoint.Utilities;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Somewhere in the class file, add the following method:&lt;xmp&gt;        private SPPrincipalInfo ResolveUser(String UserName)
        {
            return SPUtility.ResolvePrincipal(
                this.workflowProperties.Web,
                UserName,
                SPPrincipalType.All,
                SPPrincipalSource.All, 
                null,
                false);
        }&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;In the createTask1_MethodInvoking method, type the following code:&lt;xmp&gt;            this.taskID = Guid.NewGuid();
            this.taskProperties.AssignedTo = this.ResolveUser(this.initApprover).LoginName;
            this.taskProperties.Description = "Approve " +
                this.workflowProperties.Item.Name + " Task Assigned to " +
                this.ResolveUser(this.initApprover).DisplayName;
            this.taskProperties.DueDate = 
                (this.initExpires != null ? this.initExpires.Value : 
                DateTime.Now.AddDays(7));
            this.taskProperties.Title = "Approve " +
                this.workflowProperties.Item.Name;
                this.taskProperties.ExtendedProperties["actionStatus"] = "Approve";
            this.taskProperties.ExtendedProperties["actionComments"] =
                DateTime.Now.ToString() + ": " +
                this.workflowProperties.OriginatorUser.Name +
                " wants you to approve this document. Comment(s): " +
                this.initComments + "\r\n";
            this.taskProperties.SendEmailNotification = true;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Click on the Workflow1.cs [Design] tab.&lt;/li&gt;
&lt;li&gt;From the Toolbox, drag and drop a While to directly beneath the createTask1 object.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the Condition property, then activate the drop-down list.&lt;/li&gt;
&lt;li&gt;Select Code Condition.&lt;/li&gt;
&lt;li&gt;Click on the plus sign next to Condition, then type "whileActivity1_CheckIfTaskComplete" (without quotes) in the empty Condition property field.&lt;/li&gt;
&lt;li&gt;Press the Enter key, this will take you back to the code view.&lt;/li&gt;
&lt;li&gt;Right above the whileActivity1_CheckIfTaskComplete method, NOT inside of it, type the following code:&lt;xmp&gt;        private bool blnIsTaskComplete = false;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Inside of the whileActivity1_CheckIfTaskComplete method, type the following code:&lt;xmp&gt;            e.Result = !this.blnIsTaskComplete;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Click on the Workflow1.cs [Design] tab.&lt;/li&gt;
&lt;li&gt;In the Toolbox, drag and drop an OnTaskChanged object directly into the whileActivity1 area.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the AfterProperties property, then elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member tab", then select the Create Field option.&lt;/li&gt;
&lt;li&gt;In the "New member name" field, type "taskChangedAfterProperties".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the BeforeProperties property, then elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member tab", then select the Create Field option.&lt;/li&gt;
&lt;li&gt;In the "New member name" field, type "taskChangedBeforeProperties".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on the CorrelationToken property, then activate the drop-down list.&lt;/li&gt;
&lt;li&gt;Select taskToken from the list (NOT workflowToken).&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the Executor property, then elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member tab", then select the Create Field option.&lt;/li&gt;
&lt;li&gt;In the "New member name" field, type "taskChangedExecutor".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the TaskID property, then elipses button.&lt;/li&gt;
&lt;li&gt;In the "Bind to existing member" tab, locate and select the taskID property.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;In the designer area, right-click on onTaskChanged1, then click on Generate Handlers.&lt;/li&gt;
&lt;li&gt;In the onTaskChanged1_Invoked method, type the following code:&lt;xmp&gt;            this.blnIsTaskComplete = 
                (this.taskChangedAfterProperties.ExtendedProperties["actionStatus"].ToString() == "Approve" ||
                this.taskChangedAfterProperties.ExtendedProperties["actionStatus"].ToString() == "Reject");
            // If the task has expired, set it to complete:
            if (this.initExpires != null &amp;&amp;
                DateTime.Now &gt; this.initExpires)
                this.blnIsTaskComplete = true;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Click on the Workflow1.cs [Design] tab.&lt;/li&gt;
&lt;li&gt;From the Toolbox, drag and drop a CompleteTask object directly beneath the whileActivity1 object.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the CorrelationToken property, then activate the drop-down list.&lt;/li&gt;
&lt;li&gt;Select taskToken.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the TaskId property, then click on the elipses button.&lt;/li&gt;
&lt;li&gt;In the "Bind to an existing member" tab, locate and select the TaskID property.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Properties pane, click on the TaskOutcome property, then click on the elipses button.&lt;/li&gt;
&lt;li&gt;Click on the "Bind to a new member" tab, then click on Create Field.&lt;/li&gt;
&lt;li&gt;In the "New member name" field, type "taskOutcome".&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Right-click on completeTask1, then click on Generate Handlers.&lt;/li&gt;
&lt;li&gt;In the completeTask1_MethodInvoking method, type the following code:&lt;xmp&gt;            this.taskOutcome = this.taskChangedAfterProperties.ExtendedProperties["actionStatus"].ToString();
            this.taskProperties.PercentComplete = 100;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;Build the project by pressing F6.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Sign the project with a strong-name key and add it to the GAC.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;In the Solution Explorer, right-click on SharePointApprovalWorkflow, then click on Properties.&lt;/li&gt;
&lt;li&gt;Click on the Signing tab/option.&lt;/li&gt;
&lt;li&gt;Ensure "Sign the Assembly" is checked.&lt;/li&gt;
&lt;li&gt;Under "Choose a strong name key file", click on the drop-down list, then click on/select New...&lt;/li&gt;
&lt;li&gt;Set the "Key file name" to "SharePointApprovalWorkflow.snk" (without quotes).&lt;/li&gt;
&lt;li&gt;Uncheck the option to password-protect the key.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;Build the project by pressing F6.&lt;/li&gt;
&lt;li&gt;In Windows, open/startup the Microsoft .Net Framework 2.0 Configuration MMC tool, typically from the Administrative Tools folder in the Programs menu of Start button (aka mscorcfg.msc).&lt;/li&gt;
&lt;li&gt;Navigate to and select My Computer.&lt;/li&gt;
&lt;li&gt;Click on "Manage the Assembly Cache".&lt;/li&gt;
&lt;li&gt;Click on "View List of Aseemblies in the Assembly Cache".&lt;/li&gt;
&lt;li&gt;Right-click on the Assembly Cache node in the left pane, then click on Add...&lt;/li&gt;
&lt;li&gt;Navigate to the bin\Debug folder where the SharePointApprovalWorkflow project compiled the assembly, typically "%HOMEPATH%\My Documents\Visual Studio 2005\Projects\SharePointApprovalWorkflow\SharePointApprovalWorkflow\bin\Debug", then select and open the SharePointApprovalWorkflow.dll assembly.&lt;/li&gt;
&lt;li&gt;In the right pane, locate the SharePointApprovalWorkflow assembly, then write and store the Public Key Token, as you will need this value later (you can copy it by double-clicking on it, then selecting the text from the dialog box and copying it to the clipboard).&lt;/li&gt;
&lt;li&gt;Close the MMC.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="deploying"&gt;&lt;/a&gt;
&lt;h4&gt;Deploying the VS.NET workflow and InfoPath forms to SharePoint Server 2007&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;In the VS.NET 2005 workflow project, click on Tools from the menu bar, then click on Code Snippets Manager.&lt;/li&gt;
&lt;li&gt;Click on the Add button.&lt;/li&gt;
&lt;li&gt;In the Language drop-down list, select XML.&lt;/li&gt;
&lt;li&gt;Navigate to and Open the following folder: "%ProgramFiles%\Microsoft Visual Studio 8\Xml\1033\Snippets\SharePoint Server Workflow"&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Creating the Feature.xml file.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Right-click on the SharePointApprovalWorkflow project, navigate to Add, then click on New Item.&lt;/li&gt;
&lt;li&gt;Select XML File, then call the file name "Feature.xml" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;In the code editor, place the cursor directly beneath the first line, the XML declaration line.&lt;/li&gt;
&lt;li&gt;Press Ctrl-K-X.&lt;/li&gt;
&lt;li&gt;Double-click on "SharePoint Server Workflow".&lt;/li&gt;
&lt;li&gt;Double-click on Feature.xml Code.&lt;/li&gt;
&lt;li&gt;Remove the ElementFile element/node from the XML file.&lt;/li&gt;
&lt;li&gt;Generate a random GUID from a website such as this one: &lt;a href="http://www.famkruithof.net/uuid/uuidgen"&gt;http://www.famkruithof.net/uuid/uuidgen&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Copy and paste the generated GUID into the ID property, replacing the GUID value currently present.&lt;/li&gt;
&lt;li&gt;Change the Title from "Default Title" to "Custom Approval Workflow" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the Description property to "Custom-designed approval workflow." (without quotes).&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;The Feature.xml file should look something like this:&lt;xmp&gt;&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;Feature  Id="7d943930-f3ad-11dc-95ff-0800200c9a66"
          Title="Custom Approval Workflow"
          Description="Custom-designed approval workflow."
          Version="12.0.0.0"
          Scope="Site"
          ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
          ReceiverClass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver"
          xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;ElementManifests&gt;
    &lt;ElementManifest Location="workflow.xml" /&gt;
  &lt;/ElementManifests&gt;
  &lt;Properties&gt;
    &lt;Property Key="GloballyAvailable" Value="true" /&gt;
    &lt;!-- Value for RegisterForms key indicates the path to the forms relative to feature file location --&gt;
    &lt;!-- if you don't have forms, use *.xsn --&gt;
    &lt;Property Key="RegisterForms" Value="*.xsn" /&gt;
  &lt;/Properties&gt;
&lt;/Feature&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Creating the Workflow.xml file.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Right-click on the SharePointApprovalWorkflow project, navigate to Add, then click on New Item.&lt;/li&gt;
&lt;li&gt;Select XML File, then call the file name "Feature.xml" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on Add.&lt;/li&gt;
&lt;li&gt;In the code editor, place the cursor directly beneath the first line, the XML declaration line.&lt;/li&gt;
&lt;li&gt;Press Ctrl-K-X.&lt;/li&gt;
&lt;li&gt;Double-click on "SharePoint Server Workflow".&lt;/li&gt;
&lt;li&gt;Double-click on Workflow.xml Code.&lt;/li&gt;
&lt;li&gt;Set the Name property to "Custom Approval Workflow" (without quotes).&lt;/li&gt;
&lt;li&gt;Set the Description to "Custom-designed approval workflow." (without quotes).&lt;/li&gt;
&lt;li&gt;Generate a random GUID from a website such as this one: &lt;a href="http://www.famkruithof.net/uuid/uuidgen"&gt;http://www.famkruithof.net/uuid/uuidgen&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Copy and paste the generated GUID into the ID property, replacing the GUID value currently present.&lt;/li&gt;
&lt;li&gt;Set the CodeBehindClass property to "SharePointApprovalWorkflow.Workflow1" (without quotes).&lt;/li&gt;
&lt;li&gt;In the CodeBesideAssembly property, replace the publicKeyToken with the copied Public Key Token obtained via the GAC earlier.&lt;/li&gt;
&lt;li&gt;In the Association_FormURN element, replace the associationFormURN value with the URN of the ApprovalInitiation.xsn document. To get this a) Open up InfoPath and the ApprovalInitiation.xsn document, b) click on Open when you get the security notice, c) click on Tools, then Design this Form, d) click on File, then Properties, e) copy the contents of the ID field, f) then paste this value into the Association_FormURN element.&lt;/li&gt;
&lt;li&gt;In the Instantiation_FormURN element, replace the associationFormURN value with the URN used in the preceding step.&lt;/li&gt;
&lt;li&gt;In the Task0_FormURN element, replace the existing value with the URN of the ApprovalAction.xsn document. To get this a) Open up InfoPath and the ApprovalAction.xsn document, b) click on Open when you get the security notice, c) click on Tools, then Design this Form, d) click on File, then Properties, e) copy the contents of the ID field, f) then paste this value into the Task0_FormURN element.&lt;/li&gt;
&lt;li&gt;Comment/remark out both the Modification_GUID_FormURN and Modification_GUID_Name elements, as we will not be using them (once the initiation is complete, there's no going back in this example/workflow).&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;li&gt;The Workflow.xml should look something like this:&lt;xmp&gt;&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;Workflow
       Name="Custom Approval Workflow"
       Description="Custom-designed approval workflow."
       Id="d5df1be0-f3ae-11dc-95ff-0800200c9a66"
       CodeBesideClass="SharePointApprovalWorkflow.Workflow1" 
       CodeBesideAssembly="SharePointApprovalWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3e823471b9dbc370"
       TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
       AssociationUrl="_layouts/CstWrkflIP.aspx"
       InstantiationUrl="_layouts/IniWrkflIP.aspx"
       ModificationUrl="_layouts/ModWrkflIP.aspx"
       StatusUrl="_layouts/WrkStat.aspx"&gt;
    &lt;Categories/&gt;
    &lt;!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have --&gt;
    &lt;MetaData&gt;
      &lt;Association_FormURN&gt;urn:schemas-microsoft-com:office:infopath:ApprovalInitiation:-myXSD-2008-03-16T04-37-49&lt;/Association_FormURN&gt;
      &lt;Instantiation_FormURN&gt;urn:schemas-microsoft-com:office:infopath:ApprovalInitiation:-myXSD-2008-03-16T04-37-49&lt;/Instantiation_FormURN&gt;
      &lt;Task0_FormURN&gt;urn:schemas-microsoft-com:office:infopath:ApprovalAction:-myXSD-2008-03-16T05-02-49&lt;/Task0_FormURN&gt;
      &lt;!--
      &lt;Modification_GUID_FormURN&gt;modificationURN&lt;/Modification_GUID_FormURN&gt;
      &lt;Modification_GUID_Name&gt;Name of Modification&lt;/Modification_GUID_Name&gt;
      --&gt;
      &lt;AssociateOnActivation&gt;false&lt;/AssociateOnActivation&gt;
    &lt;/MetaData&gt;
  &lt;/Workflow&gt;
&lt;/Elements&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;p&gt;&lt;em&gt;&lt;b&gt;Installing the workflow in SharePoint Server 2007.&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;In Windows' Explorer, navigate to the following folder: "%ProgramFiles%\\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES"&lt;/li&gt;
&lt;li&gt;Create a new folder here called "CustomApprovalWorkflow" (without quotes).&lt;/li&gt;
&lt;li&gt;Copy and paste the following files into the CustomApprovalWorkflow folder: ApprovalAction.xsn, ApprovalInitiation.xsn, Feature.xml, and Workflow.xml&lt;/li&gt;
&lt;li&gt;Open up a Windows' Command Prompt.&lt;/li&gt;
&lt;li&gt;Type the following command: cd "%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\BIN"&lt;/li&gt;
&lt;li&gt;Type the following command: stsadm  -o installFeature -name CustomApprovalWorkflow -force&lt;/li&gt;
&lt;li&gt;Press Enter.&lt;/li&gt;
&lt;li&gt;You should've gotten the following message: Operation completed successfully.&lt;/li&gt;
&lt;li&gt;Type the following command: stsadm -o activateFeature -name CustomApprovalWorkflow -url http://URLToSharePointServer&lt;/li&gt;
&lt;li&gt;Ensure the URLToSharePointServer is replaced with the site URL of the SharePoint Server 2007 to where this workflow will be employed/used.&lt;/li&gt;
&lt;li&gt;Restart IIS by typing and entering "iisreset" (without quotes) from a Windows' Command Prompt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="usingworkflow"&gt;&lt;/a&gt;
&lt;h4&gt;Using the Deployed Custom Workflow in SharePoint Server 2007&lt;/h4&gt;

&lt;ol&gt;
&lt;p&gt;&lt;em&gt;Associating a workflow with a document library.&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Locate a document library to which you'd like to associate this workflow.&lt;/li&gt;
&lt;li&gt;Click on the Settings menu on the Toolbar of the list/library.&lt;/li&gt;
&lt;li&gt;Click the Document Library Settings.&lt;/li&gt;
&lt;li&gt;Click on Workflow settings.&lt;/li&gt;
&lt;li&gt;Select on "Custom Approval Workflow".&lt;/li&gt;
&lt;li&gt;Call the workflow "Custom Approval Workflow" (without quotes).&lt;/li&gt;
&lt;li&gt;Select "New task list" from the Task List drop-down menu.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;You're now at the association form, which is the same as the initiation form (the ApprovalInitiation.xsn form). What's entered here will determine what's set by default for all new workflows initiated for this library, so ensure you leave each field blank, except for the Comments area.&lt;/li&gt;
&lt;li&gt;In Comments, enter "Please approve this document." (without quotes).&lt;/li&gt;
&lt;li&gt;Click on "Send for Approva". This will not actually send the form for approval, just save the form's values for future workflows.&lt;/li&gt;
&lt;p&gt;&lt;em&gt;Initiating a document workflow.&lt;/em&gt;&lt;/p&gt;
&lt;li&gt;Upload a test document to this library. We'll refer to this document as the "test document".&lt;/li&gt;
&lt;li&gt;In the library, locate the test document, and activate its drop-down menu.&lt;/li&gt;
&lt;li&gt;Click on Workflows from the drop-down menu.&lt;/li&gt;
&lt;li&gt;Click on "Custom Approval Workflow".&lt;/li&gt;
&lt;li&gt;In the Approver field, type in your full name, or the name of a person who has been added to SharePoint Server 2007 and is allowed to interact with workflows.&lt;/li&gt;
&lt;li&gt;In the Expires field, enter the date after today.&lt;/li&gt;
&lt;li&gt;In Comments, enter "Please approve this document." (without quotes).&lt;/li&gt;
&lt;li&gt;Click on "Send for Approval". The workflow status of this document should set to In Progress. If it's set to Error, please revisit the preceding steps to determine what you might've missed, and visit the section referring to fixing problems (below)&lt;/li&gt;
&lt;li&gt;Locate the test document in the library, then click on the In Progress link. This will allow you to view the status of this document's workflow.&lt;/li&gt;
&lt;li&gt;At this point, the document needs approval, so no task has been started, as it's set not to start automatically. So, under Tasks, click on the test document's link to start a task.&lt;/li&gt;
&lt;li&gt;This page/form is what the approver(s) should see in order to approve, reject, or revise a document. To approve this document, leave the Approval Status to Approve.&lt;/li&gt;
&lt;li&gt;In Comments, enter "Approved." (without quotes).&lt;/li&gt;
&lt;li&gt;Click on the Submit button. The workflow is now complete, as either Reject or Approve are the status values necessary to complete the workflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="makingchanges"&gt;&lt;/a&gt;
&lt;h4&gt;If Problems Arise, and Making Changes&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;If changes need to be made to the VS.NET project.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Making changes to the workflow VS.NET 2005 project(s) involves re-adding the assembly to the GAC and restarting IIS.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make the changes in VS.NET, then recompile the project/solution.&lt;/li&gt;
&lt;li&gt;Open up the Microsoft .Net Framework 2.0 Configuration MMC.&lt;/li&gt;
&lt;li&gt;Under My Computer, click on "Manage the assemly cache".&lt;/li&gt;
&lt;li&gt;Click on "View List of Assemblies in the Assembly Cache".&lt;/li&gt;
&lt;li&gt;Locate the SharePointApprovalWorkflow assembly.&lt;/li&gt;
&lt;li&gt;Right-click on SharePointApprovalWorkflow, then click on Delete.&lt;/li&gt;
&lt;li&gt;Click on Yes.&lt;/li&gt;
&lt;li&gt;Right-click on Assembly Cache, then click on Add...&lt;/li&gt;
&lt;li&gt;Locate and open the SharePointApprovalWorkflow.dll assembly.&lt;/li&gt;
&lt;li&gt;Restart IIS by running "iisreset" (without quotes) from a command prompt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;b&gt;If changes need to be made to the InfoPath form(s).&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Making changes to the InfoPath form(s) involves changing the form(s)'s content(s), publishing and saving them, then uninstalling the reinstalling the workflow in SharePoint Server 2007. You do not need to restart IIS if you're just making changes to the InfoPath form(s).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open up the InfoPath form from the location where it was saved, not published. &lt;em&gt;Note: the locations where InfoPath forms are saved and where they are published are two different locations altogether--NEVER modify a published InfoPath form. Instead, ALWAYS modify the original, saved form(s).&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Click on Open if you get a security notice warning.&lt;/li&gt;
&lt;li&gt;Click on Tools from the menu bar, then click on "Design this form". This will open the form in another instance of InfoPath. You can close the other, read-only instance.&lt;/li&gt;
&lt;li&gt;Make any changes then save the form.&lt;/li&gt;
&lt;li&gt;Click on File, from the menu bar, then click on Publish.&lt;/li&gt;
&lt;li&gt;Click on "To a network location...".&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on the Browse button, then locate and open/select the folder to which the form was published, if it's not already in the field.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Next.&lt;/li&gt;
&lt;li&gt;Click on Next, ensuring the user access path/field is empty.&lt;/li&gt;
&lt;li&gt;Click on Publish.&lt;/li&gt;
&lt;li&gt;Click on Close.&lt;/li&gt;
&lt;li&gt;Open up a Windows' Command Prompt.&lt;/li&gt;
&lt;li&gt;Type the following command: cd "%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\BIN"&lt;/li&gt;
&lt;li&gt;Type the following command: stsadm  -o uninstallFeature -name CustomApprovalWorkflow -force&lt;/li&gt;
&lt;li&gt;Press Enter.&lt;/li&gt;
&lt;li&gt;You should've gotten the following message: Operation completed successfully.&lt;/li&gt;
&lt;li&gt;Type the following command: stsadm  -o installFeature -name CustomApprovalWorkflow -force&lt;/li&gt;
&lt;li&gt;Press Enter.&lt;/li&gt;
&lt;li&gt;You should've gotten the following message: Operation completed successfully.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="whatsmissing"&gt;&lt;/a&gt;
&lt;h4&gt;What's Missing from this Workflow?&lt;/h4&gt;

&lt;p&gt;This sample workflow is extremely basic and is missing several elements that you will probably want to develop in a real-world, enterprise environment. The following are just some:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;E-mails:&lt;/b&gt; One thing that you might want to implement is the sending of e-mail messages upon changes made to the workflow. For example, upon a new workflow initiation, you'll probably want to notify the approver(s)/assignee(s) that an approval is awaiting him or her, and provide links to the appropriate content in the HTML-encoded message. I personally use the &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.sendemail.aspx" target="_blank"&gt;SPUtility.SendEmail() method&lt;/a&gt; for this.li&gt;
&lt;li&gt;&lt;b&gt;Workflow History Logging:&lt;/b&gt; Another thing you'll probably want to implement is the tracking of what's being done and the status of the workflow at particular action points in the flow. For example, when an approver/assignee rejects or approves a document, you'll want to log the comments and status to the workflow's history. I personally use the Workflow's &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflow.createhistoryevent.aspx" target="_blank"&gt;CreateHistoryEvent() method&lt;/a&gt; for this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="#TOC"&gt;Back to TOC&lt;/a&gt;&lt;/p&gt;

&lt;a name="resources"&gt;&lt;/a&gt;
&lt;h4&gt;Additional Information &amp; Resources&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms564355.aspx" target="_blank"&gt;Walkthrough: Creating Office SharePoint Server 2007 Workflows in Visual Studio 2005&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms549489.aspx" target="_blank"&gt;Workflows in Office SharePoint Server 2007&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms461324.aspx" target="_blank"&gt;Workflow Development in Visual Studio 2005&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb386211.aspx" target="_blank"&gt;SharePoint Workflow Solutions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-4965386359728117230?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/4965386359728117230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=4965386359728117230&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4965386359728117230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/4965386359728117230'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/creating-custom-sharepoint-server-2007.html' title='Creating Custom SharePoint Server 2007 Workflows with VS.NET 2005'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-5158732561220767976</id><published>2008-03-06T09:58:00.000-08:00</published><updated>2008-03-06T13:23:36.716-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='content type'/><category scheme='http://www.blogger.com/atom/ns#' term='aspx'/><category scheme='http://www.blogger.com/atom/ns#' term='moss 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint server 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><title type='text'>Understanding the SharePoint Server 2007 (MOSS) Content Structure/Architecture</title><content type='html'>&lt;p&gt;A MOSS 2007 server is an ASP.NET 2.0 Web site. Pages are rendered via ASPX (ASP.NET Web Forms) files, typically. Each ASPX page is tied to a &lt;b&gt;Master Page&lt;/b&gt; and a &lt;b&gt;Page Layout&lt;/b&gt;. Master Pages dictate a consistent look throughout the SharePoint site, and Page Layouts dictate how the individual page looks. Master Pages and Page Layouts are stored in the Master Page and Page Layout Galleries. Each Page Layout is associated with a &lt;b&gt;Content Type&lt;/b&gt;, which dictates what type of content a Page Layout will render. Three default, out-of-box Content Types exist: Page, Article Page, and Welcome Page. Each Content Type defines one or more &lt;b&gt;Column Templates&lt;/b&gt;, which are columns, or fields, that store data pertaining to the type of content (per the Content Type). Column Templates define what type of controls are assigned to data colums (such as DropDownList, Label, Picture, or TextBox controls).&lt;/p&gt;

&lt;xmp&gt;| ASPX Page
|----------------&gt; Master Page
|----------------&gt; Page Layout ---&gt; Content Type --&gt; Column Templates&lt;/xmp&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-5158732561220767976?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/5158732561220767976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=5158732561220767976&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/5158732561220767976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/5158732561220767976'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/understanding-sharepoint-server-2007.html' title='Understanding the SharePoint Server 2007 (MOSS) Content Structure/Architecture'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-585435875227601738</id><published>2008-03-06T09:03:00.000-08:00</published><updated>2008-03-06T09:09:41.805-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aspx'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint server'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint server 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='moss'/><title type='text'>Editing SharePoint Server 2007 (MOSS) ASPX Files Directly</title><content type='html'>&lt;p&gt;You can directly edit the ASP.NET ASPX files used by SharePoint by opening them up either via Notepad, VS.NET, or any other text editor. The files are stored in &lt;i&gt;%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12&lt;/i&gt; (most are in the &lt;i&gt;TEMPLATE&lt;/i&gt; folder).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-585435875227601738?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/585435875227601738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=585435875227601738&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/585435875227601738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/585435875227601738'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/editing-sharepoint-server-2007-moss.html' title='Editing SharePoint Server 2007 (MOSS) ASPX Files Directly'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2510385918663718520</id><published>2008-03-05T15:07:00.000-08:00</published><updated>2008-03-05T15:13:24.270-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vss'/><category scheme='http://www.blogger.com/atom/ns#' term='visual source safe'/><title type='text'>Visual Source Safe's ANALYZE Tool</title><content type='html'>&lt;p&gt;VSS 6 and later have a tool for verifying the VSS database: ANALYZE.EXE. It's locationed in the VSS DB's &lt;b&gt;win32&lt;/b&gt; directory. You can run ANALYZE.EXE from anywhere, but you have to pass it the path to the VSS DB. For example, from a command shell, run...&lt;/p&gt;

&lt;p&gt;analyze -x -v3 \\myDFS.com\VSS\data&lt;/p&gt;

&lt;p&gt;&lt;b&gt;\\myDFS.com\VSS\&lt;/b&gt; is an example path to a share to a VSS DB, and &lt;b&gt;data&lt;/b&gt; is a VSS DB folder.&lt;/p&gt;

&lt;p&gt;The preceding command will verify the DB and report any errors and/or inconsistencies.&lt;/p&gt;

&lt;p&gt;To fix the DB, run the following...&lt;/p&gt;

&lt;p&gt;analyze -f -v3 \\myDFS.com\VSS\data&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2510385918663718520?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2510385918663718520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2510385918663718520&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2510385918663718520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2510385918663718520'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/visual-source-safes-analyze-tool.html' title='Visual Source Safe&apos;s ANALYZE Tool'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6905664324483057513</id><published>2008-03-02T11:04:00.000-08:00</published><updated>2008-03-05T16:43:42.011-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='comparison'/><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='2005'/><category scheme='http://www.blogger.com/atom/ns#' term='differences'/><category scheme='http://www.blogger.com/atom/ns#' term='10g'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Differences Between MS SQL Server 2005 and Oracle Database 10g</title><content type='html'>&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Oracle Tablespaces &amp; SQL Server Filegroups&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Tablespaces in Oracle are equivalent to SQL Server Filegroups. They each are logical groupings of physical data files used to store related database objects, such as tables, indexes, etc. In Oracle 10g, two tablespaces are created when creating a database, by default: SYSTEM and SYSAUX. In SQL Server, one filegroup is created when creating a database, by default: PRIMARY. In both RDBMSes, you can create user-defined tablespaces and filegroups, in addition the the preceding mentioned.&lt;/p&gt;
&lt;p&gt;In Oracle 10g, you have the added benefit of being able to mark a tablespace as temporary, allowing tables added to be managed on a per-user-basis. For example, data added to a table in a temporary tablespace will only be modifiable by that user and that user only. There are other tablespace features, such as making them dictionary or locally managed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Oracle Blocks, Extents, and Segments &amp; SQL Server Pages &amp; Extents&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6905664324483057513?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6905664324483057513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6905664324483057513&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6905664324483057513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6905664324483057513'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/03/differences-between-ms-sql-server-2005.html' title='Differences Between MS SQL Server 2005 and Oracle Database 10g'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-2229564021882349938</id><published>2008-02-28T09:00:00.000-08:00</published><updated>2008-02-29T10:51:31.927-08:00</updated><title type='text'>Creating a Silverlight-AJAX-Enabled Web Site with Silverlight 1.1 and VS.NET 2008</title><content type='html'>&lt;h4&gt;Install the necessary components.&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Install the &lt;b&gt;Windows Silverlight 1.1 Runtime&lt;/b&gt; from here: &lt;a href="http://www.microsoft.com/silverlight/resources/LicenseWinDev.aspx"&gt;http://www.microsoft.com/silverlight/resources/LicenseWinDev.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install the &lt;b&gt;Microsoft Silverlight 1.1 Tools Alpha for Visual Studio 2008&lt;/b&gt; from here: &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=25144c27-6514-4ad4-8bcb-e2e051416e03&amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=25144c27-6514-4ad4-8bcb-e2e051416e03&amp;displaylang=en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install VS.NET 2008.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Create an ASP.NET Web Application&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Startup VS.NET 2008.&lt;/li&gt;
&lt;li&gt;Click on File-&gt;New-&gt;Web Site.&lt;/li&gt;
&lt;li&gt;Select ASP.NET Web Site.&lt;/li&gt;
&lt;li&gt;In the Location path, replace "WebSite1" with "DotNetFun" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all of your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Add Silverlight Content to an ASP.NET Web Site&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;In VS.NET 2008, the ASP.NET Web Site created in the preceding steps, &lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right-click on the 'DotNetFun solution and click on Add-&gt;New Project.&lt;/li&gt;
&lt;li&gt;Under project types, select/click on Silverlight&lt;/li&gt;
&lt;li&gt;Under templates, select/click on Silverlight Project.&lt;/li&gt;
&lt;li&gt;Change the project name from "SilverlightProject1" to "SilverlightProjectTest" (without quotes).&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right-click on the DotNetFun ASP.NET project and click on Add Silverlight Link.&lt;/li&gt;
&lt;li&gt;Select/click on the SilverlightProjectTest project.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Click on Yes to enable Silverlight script debugging.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Adding AJAX Functionality to an ASP.NET Web Site&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Simply add an AJAX Web Form to the ASP.NET project.&lt;/li&gt;
&lt;li&gt;Press Ctrl-Shift-S to save all your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Discussion&lt;/h4&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-2229564021882349938?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/2229564021882349938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=2229564021882349938&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2229564021882349938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/2229564021882349938'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/02/creating-silverlight-ajax-enabled-web.html' title='Creating a Silverlight-AJAX-Enabled Web Site with Silverlight 1.1 and VS.NET 2008'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-160093920271311792</id><published>2008-02-27T15:56:00.000-08:00</published><updated>2008-02-28T09:57:03.246-08:00</updated><title type='text'>Getting Started with Silverlight 1.1 and Visual Studio .Net 2008</title><content type='html'>&lt;h4&gt;Install the necessary components.&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Install the &lt;b&gt;Windows Silverlight 1.1 Runtime&lt;/b&gt; from here: &lt;a href="http://www.microsoft.com/silverlight/resources/LicenseWinDev.aspx"&gt;http://www.microsoft.com/silverlight/resources/LicenseWinDev.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install the &lt;b&gt;Microsoft Silverlight 1.1 Tools Alpha for Visual Studio 2008&lt;/b&gt; from here: &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=25144c27-6514-4ad4-8bcb-e2e051416e03&amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=25144c27-6514-4ad4-8bcb-e2e051416e03&amp;displaylang=en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install VS.NET 2008.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Create a Silverlight VS.NET 2008 project.&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Startup VS.NET 2008.&lt;/li&gt;
&lt;li&gt;Click on File-&gt;New-&gt;Project.&lt;/li&gt;
&lt;li&gt;Under Visual C#, click on the Silverlight node.&lt;/li&gt;
&lt;li&gt;Select the Silverlight Project project.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;Double click on the Page.xaml XAML file in the Solution Explorer.&lt;/li&gt;
&lt;li&gt;Between the Canvas XML elements, type in the following XAML code:
&lt;xmp&gt;&lt;TextBlock x:Name="txtHelloWorld"
             MouseLeftButtonDown="txtHelloWorld_Click"&gt;
    Hello World! Click here.&lt;/TextBlock&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Double click the Page.xaml.cs file in the Solution Explorer.&lt;/li&gt;
&lt;li&gt;Add the following event handler method:
&lt;xmp&gt;&lt;TextBlock x:Name="txtHelloWorld"
             MouseLeftButtonDown="txtHelloWorld_Click"&gt;
    Hello World! Click here.&lt;/TextBlock&gt;&lt;/xmp&gt;&lt;/li&gt;
&lt;li&gt;Save all changes.&lt;/li&gt;
&lt;li&gt;Test the Silverlight application by right-clicking on the TestPage.html file in the Solution Explorer and clicking on View in Browser, then click on the text--it should respond to the event.
&lt;/ol&gt;
&lt;h4&gt;Discussion&lt;/h4&gt;

&lt;p&gt;The JavaScript code in the TestPage.Html.js file is responsible for actually rendering the Silverlight content in the client's browser. This is done by calling the createSilverlight() JavaScript function from within the TestPage.Html page. The JavaScript code in the Silverlight.js file checks if Silverlight is installed and redirects the user to install if chosen to do so.&lt;/p&gt;

&lt;p&gt;Please note that this Silverlight project does not incorporate ASP.NET functionality/content, only basic HTML content. In order to create an ASP.NET website that makes use of Silverlight functionality, please refer to my article titled "Creating a Silverlight-AJAX-Enabled Web Site with Silverlight 1.1 and VS.NET 2008".&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-160093920271311792?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/160093920271311792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=160093920271311792&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/160093920271311792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/160093920271311792'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/02/getting-started-with-silverlight-11-and.html' title='Getting Started with Silverlight 1.1 and Visual Studio .Net 2008'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-3188157578145852530</id><published>2008-02-16T12:59:00.000-08:00</published><updated>2008-06-17T08:30:36.922-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.NET 2008'/><title type='text'>MS Visual Studio 2008 - New Features - System Designer</title><content type='html'>&lt;h4&gt;Visually Create Systems with VS.NET 2008 Architecture Edition&lt;/h4&gt;

&lt;p&gt;The new System Designer project (found in the New Project\Distributed Systems folder) allows developers and architects to, first, visually define and design an application system. Prior to System Designer, you only had the Application Design project, an application-scope-only designer, limiting you to defining and implementing applications, such ASP.NET, Windows Forms, Web Services, etc., in a visual way. The problem with the Application Design project, of course, is that it's application-scope-limited--it pertains to an application, or set of related applications, and not to an entire system or even a multitude of systems. Conceptually speaking, a system should comprise one or more applications/services, without having to define applications within an application project per se. The System Design project allows us to create systems and add to them inter-related applications and even sub-systems--a beneficial feature for us application designers and system architects.&lt;/p&gt;

&lt;p&gt;The System Design project helps to facilitate visual system-design and implementation in VS.NET 2008 Architecture edition. To develop a System Design project, perform the test steps below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Startup VS.NET 2008 Architecture Edition.&lt;/li&gt;
&lt;li&gt;Click on File, New, then Project, or press Ctrl-Shift-N.&lt;/li&gt;
&lt;li&gt;Locate and select the Distributed Systems folder/node.&lt;/li&gt;
&lt;li&gt;Select System Design, then click on OK.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_LdNeXsKHo20/SFbbvygMToI/AAAAAAAAAHU/xU2JpJd9EbM/s400/New+System+Design+Project.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212595232785059458" /&gt;
&lt;br /&gt;&lt;br /&gt;You are now presented with two files/objects: a System diagram (*.sd) and an Application diagram (*.ad).&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_LdNeXsKHo20/SFbdCW6sVfI/AAAAAAAAAHc/b6q1UGco1F8/s400/System+Design+Defaults.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212596651309159922" /&gt;
&lt;/li&gt;
&lt;li&gt;Open up the Toolbox (or press Ctrl-Alt-X). You'll see a list of System Design and Application Design specific controls.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_LdNeXsKHo20/SFbfJK2tpHI/AAAAAAAAAHk/KfSkUBWAQoY/s400/System+Design+Toolbox.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212598967353582706" /&gt;&lt;/li&gt;
&lt;li&gt;This test system will consist of an ASP.NET Web Site, ASP.NET Web Service, and External Database, so drag and drop these application design types from the Toolbox onto the System Design (.sd) designer area.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_LdNeXsKHo20/SFbhgNG3XFI/AAAAAAAAAHs/XTYLMz7A268/s400/System+Design+Applications.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212601562118446162" /&gt;&lt;br /&gt;&lt;br /&gt;
Adding applications to the System Designer area will result in those applications also being added to the Application Design (.ad) area.&lt;/li&gt;
&lt;li&gt;Select WebApplication1, then click on the Diagram menu, then on Rename.&lt;/li&gt;
&lt;li&gt;Name it ASPNETApplication, then click on OK.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFbkckJ-h5I/AAAAAAAAAH0/RuRK0Uz6Ai4/s400/Rename+Application.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212604798120920978" /&gt;&lt;/li&gt;
&lt;li&gt;Select WebApplication2, then click on the Diagram menu, then on Rename.&lt;/li&gt;
&lt;li&gt;Name it ASPNETWebService, then click on OK.&lt;br /&gt;
&lt;li&gt;Select Database1, then click on the Diagram menu, then on Rename.&lt;/li&gt;
&lt;li&gt;Name it SQLServer2005, then click on OK.&lt;br /&gt;
&lt;li&gt;When you drag and drop applications onto the design area, default endpoints are automatically generated for each one. To ensure our system allows reusability via the ASP.NET Web Service (i.e., not only can the ASP.NET application leverage the web service, but so can a potential many other applications and services), the ASP.NET application will use this web service for all business logic and data tier services/functionality, so to define such a relationship logically and visually, we need to connect the applications/services accordingly. Endpoints are the means by which applications and services inter-communicate, so connections between them must be setup.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFbm6b6Pj3I/AAAAAAAAAH8/-UFEq32MZZY/s400/System+Design+Application+Endpoints.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212607510326775666" /&gt;&lt;/li&gt;
&lt;li&gt;We need to delete the useless Web Content Endpoint for the ASPNETApplication web application, so select the WebContent1 endpoint, then press Delete.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFbp3U_nkdI/AAAAAAAAAIE/e2l5i3QSOgw/s400/System+Design+Application+Endpoint+Detail.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212610755465548242" /&gt;
&lt;/li&gt;
&lt;li&gt;Since the ASPNETApplication application will be consuming the ASPNETWebService web service, we need to create a Web Service Consumer Endpoint on it. This endpoint is created automatically when a connection is made between the ASPNETApplication application and the ASPNETWebService web service. Right-click on the ASPNETApplication application, then click on Connect.&lt;/li&gt;
&lt;li&gt;In the Connect To area, ensure that the Application is ASPNETWebService and that the endpoint is WebService1.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_LdNeXsKHo20/SFcAKL1ek5I/AAAAAAAAAIM/HJAUxBiCMjU/s400/Create+Web+Service+Endpoint+Connections.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212635268680422290" /&gt;&lt;/li&gt;
&lt;li&gt;Now let's connect the ASPNETWebService to SQLServer2005 database. Right-click on the ASPNETWebService web service application, then click on Connect.&lt;/li&gt;
&lt;li&gt;Ensure that the Connect To Member is SQLServer2005 and that the Connect To Endpoint is SQLServer2005.&lt;/li&gt;
&lt;li&gt;Click on OK.&lt;/li&gt;
&lt;li&gt;In the Choose Data Source dialog box, in the Data Source drop-down list, select Microsoft SQL Server, then click on Continue.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_LdNeXsKHo20/SFfXGEG30SI/AAAAAAAAAIc/JRd-ddlYKKg/s400/Database+Choose+Data+Source.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212871592886391074" /&gt;
&lt;/li&gt;
&lt;li&gt;In the Connection Properties dialog box, specify all relevant SQL Server information. This is the SQL Server that the ASPNETWebService web service will connect it.&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SFfXGVX8MgI/AAAAAAAAAIk/uKzo4LT7um0/s400/Connection+Properties.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212871597521383938" /&gt;
&lt;/li&gt;
&lt;li&gt;Click on OK. The endpoint connections should now look like the following:&lt;br /&gt;
&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_LdNeXsKHo20/SFfYfxkK4SI/AAAAAAAAAIs/m9BiKEEMpz8/s400/Endpoints+Connected.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5212873134097228066" /&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-3188157578145852530?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/3188157578145852530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=3188157578145852530&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3188157578145852530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/3188157578145852530'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/06/ms-visual-studio-2008-new-features.html' title='MS Visual Studio 2008 - New Features - System Designer'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_LdNeXsKHo20/SFbbvygMToI/AAAAAAAAAHU/xU2JpJd9EbM/s72-c/New+System+Design+Project.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6550659761078238926</id><published>2008-02-05T14:11:00.000-08:00</published><updated>2008-02-05T14:24:26.240-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='t-sql'/><category scheme='http://www.blogger.com/atom/ns#' term='encrypt'/><category scheme='http://www.blogger.com/atom/ns#' term='decrypt'/><category scheme='http://www.blogger.com/atom/ns#' term='mssql'/><title type='text'>T-SQL 2005: Encrypting &amp; Decrypting Data</title><content type='html'>&lt;xmp&gt;-- Tested and compatible with SQL Server 2005

-- Encrypting a column using symmetric encryption:
-- Check for a DB Master Key; it has an ID of 101; if not, create it:
IF NOT EXISTS(select * from sys.symmetric_keys where symmetric_key_id = 101)
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'SDF*(U$IOJ$#U*(FEIDO';

-- Create a certificate used to encrypt the key:
IF NOT EXISTS(SELECT * FROM sys.certificates WHERE name = 'TestCert')
CREATE CERTIFICATE TestCert WITH SUBJECT = 'Test Certificate';

-- Create a key:
IF NOT EXISTS(select * from sys.symmetric_keys where name = 'TestKey')
CREATE SYMMETRIC KEY TestKey WITH ALGORITHM = DES
ENCRYPTION BY CERTIFICATE TestCert;

-- Open the symmetric key:
OPEN SYMMETRIC KEY TestKey
DECRYPTION BY CERTIFICATE TestCert;

-- Encrypt data
DECLARE @EncryptedData VARBINARY(255), @DecryptedData VARCHAR(255);
SET @EncryptedData = EncryptByKey(Key_GUID('TestKey'), 'My encypted data!');
SELECT @EncryptedData AS EncryptedData;

-- Decrypt encrypted data:
SELECT CAST(DecryptByKey(@EncryptedData) AS VARCHAR) AS DecryptedData;&lt;/xmp&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6550659761078238926?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6550659761078238926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6550659761078238926&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6550659761078238926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6550659761078238926'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/02/t-sql-2005-encrypting-decrypting-data.html' title='T-SQL 2005: Encrypting &amp; Decrypting Data'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-6794171924894007517</id><published>2008-02-05T08:41:00.000-08:00</published><updated>2008-02-27T17:05:30.503-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><category scheme='http://www.blogger.com/atom/ns#' term='myspace'/><title type='text'>MySpace to Launch Developer Site</title><content type='html'>&lt;p&gt;It's about time, too, as FaceBook has given developers the ability to create FaceBook applications for some time now. I can just imagine, though, what security issues will arise from spyware- and spam-developers.&lt;/p&gt;
&lt;p&gt;TO get there, go to developer.myspace.com.&lt;/p&gt;

&lt;p&gt;Here's the article:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;span style="font-family:arial;"&gt;Juan Carlos Perez, IDG News Service&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;MySpace will open the doors of its developer Web site on Tuesday and make available there the necessary tools to build applications for the world's most popular social-networking site.&lt;/p&gt;

&lt;p&gt;Developers will have about one month to familiarize themselves with the development tools and create and test applications before MySpace begins letting its members install them early in March.&lt;/p&gt;

&lt;p&gt;"Developers will be able to build applications, but they'll be in the sandbox environment where consumers won't be able to see them," said Kyle Brinkman, vice president and general manager of Platform for MySpace.

&lt;p&gt;With the opening of the developer Web site, MySpace gets closer to catching up to its main rival, Facebook, which opened its platform to external developers in May.

&lt;p&gt;For Facebook, despite some bumps along the way, opening its platform has been overwhelmingly positive. More than 14,000 applications have been created for the site, which in turn has increased its attractiveness to current and potential members.

&lt;p&gt;MySpace isn't alone in following Facebook's lead, as most major social-networking site operators have decided to open their platforms to external developers as well.

&lt;p&gt;In addition to the individual developer platforms, Google unveiled in November its OpenSocial project, which aims to provide a set of common APIs (application programming interfaces) for social-networking operators to adopt, so that applications built with those APIs will work across multiple sites.

&lt;p&gt;To make sure that the applications are safe to use, MySpace will test all of them before making them available to its members, Brinkman said.

&lt;p&gt;Developers will be able to generate revenue from their applications by placing advertising on their applications' "canvas" pages, where members manage the applications they install. Developers will get to keep 100 percent of the advertising revenue generated on canvas pages, Brinkman said.

&lt;p&gt;Developers can choose to run ads from third-party ad providers as long as the ads conform to MySpace policies, such as not containing pornographic content. Moreover, MySpace will let developers run ads from two new ad services that it is beta testing and that it plans to launch at a later date called HyperTargeting and SelfServe, Brinkman said.

&lt;p&gt;In addition to the canvas page, applications will also be featured on their own profile pages, where developers will be able to explain in detail what each application does and how it works. Moreover, there will be a gallery where the applications will be listed. Of course, the applications will also appear on the profiles of members who install them and on members' MySpace home pages.

&lt;p&gt;MySpace will make available three types of APIs to developers: Google's OpenSocial APIs with MySpace extensions for building applications in JavaScript and HTML; ActionScript to build Flash applications; and Representational State Transfer (REST) APIs for applications that require server-to-server connections.

&lt;p&gt;Applications will be able to make use of data on MySpace profiles, but they will be governed by existing privacy controls that apply to members.

&lt;p&gt;The MySpace Developer Platform site will also include documentation, sample code and discussion forums.

&lt;p&gt;Also on Tuesday, MySpace will launch a blog geared toward developers, where MySpace staffers will post relevant information and news about the program.&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-6794171924894007517?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/6794171924894007517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=6794171924894007517&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6794171924894007517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/6794171924894007517'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2008/02/myspace-to-launch-developer-site.html' title='MySpace to Launch Developer Site'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-115463540548164754</id><published>2006-08-03T13:00:00.000-07:00</published><updated>2006-08-03T13:04:47.126-07:00</updated><title type='text'>Check DriveInfo.IsReady Before Using DriveInfo Members</title><content type='html'>&lt;p&gt;I noticed that calling various members of the DriveInfo class will cause an error if the drive is not ready; therefore, check the IsReady property to determine if the drive is ready accordingly.&lt;/p&gt;

&lt;xmp style="font-size:10pt;background-color:#FFFFDD;"&gt;
foreach (DriveInfo drive in DriveInfo.GetDrives())
{
    if (drive.IsReady)
        this.txtStatus.Text += drive.Name + "; " + 
            drive.DriveFormat + "\r\n";
}
&lt;/xmp&gt;

&lt;p&gt;Also, all types of optical drives have a DriveType enumeration of CDRom.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-115463540548164754?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/115463540548164754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=115463540548164754&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115463540548164754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115463540548164754'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2006/08/check-driveinfoisready-before-using.html' title='Check DriveInfo.IsReady Before Using DriveInfo Members'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-115393376678237705</id><published>2006-07-26T10:06:00.000-07:00</published><updated>2006-07-26T10:17:09.866-07:00</updated><title type='text'>New .Net 2.0 Stream.Dispose Methods</title><content type='html'>&lt;p&gt;The System.IO.Stream abstract class now implements the IDisposable interface fully (explicitly and non-explicitly). What did it do before that?! Stream implemented the interface explicitly, making only interface instances able to call Dispose(). Before .Net 2.0, it was up to you to implement the IDisposable interface and clean up your derived class' resources via an interface object. You can now call Dispose() methods directly from an object that isn't cast to IDisposable.&lt;/p&gt;

&lt;b&gt;New method:&lt;/b&gt;
&lt;xmp style="background-color:#FFFFDD;font-size:10pt;"&gt;
FileStream fs = new FileStream(@"C:\boot.ini", FileMode.Open, FileAccess.Read)
fs.Dispose();

// or simply... - the better practice/pattern
using (FileStream fs = new FileStream(@"C:\boot.ini", FileMode.Open, FileAccess.Read))
{
    // code ...
}
&lt;/xmp&gt;

&lt;b&gt;Old method:&lt;/b&gt;
&lt;xmp style="background-color:#FFFFDD;font-size:10pt;"&gt;
FileStream fs = new FileStream(@"C:\boot.ini", FileMode.Open, FileAccess.Read)
IDisposable disp = (IDisposable) fs;
disp.Dispose();
&lt;/xmp&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-115393376678237705?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/115393376678237705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=115393376678237705&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115393376678237705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115393376678237705'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2006/07/new-net-20-streamdispose-methods.html' title='New .Net 2.0 Stream.Dispose Methods'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-115386759702939751</id><published>2006-07-25T15:20:00.000-07:00</published><updated>2006-07-25T16:00:16.053-07:00</updated><title type='text'>New .Net 2.0 Stream.ReadTimout and Stream.WriteTimout</title><content type='html'>The new .Net 2.0 Stream.ReadTimout and Stream.WriteTimout properties don't work with all derived classes, such as FileStream. Therefore, always ensure that you check the Stream.CanTimeout property before calling any of these new properties.

&lt;xmp style="background-color:#FFFFDD; font-size:10pt;"&gt;
using (FileStream fs = new FileStream(
    @"C:\boot.ini", 
    FileMode.Open, 
    FileAccess.Read))
{
    if (fs.CanTimeout)
    {
        fs.ReadTimeout = 1; // 1 millisecond
        fs.WriteTimeout = 1; // 1 millisecond
    }
    int intByte = fs.ReadByte();
    while (intByte &gt; -1)
    {
        this.txtStatus.Text += Encoding.ASCII.GetString(new byte[] {(byte)intByte});
        intByte = fs.ReadByte();
    }
}
&lt;/xmp&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-115386759702939751?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/115386759702939751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=115386759702939751&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115386759702939751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115386759702939751'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2006/07/new-net-20-streamreadtimout-and.html' title='New .Net 2.0 Stream.ReadTimout and Stream.WriteTimout'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-115344015037365584</id><published>2006-07-20T16:58:00.000-07:00</published><updated>2006-07-20T17:29:56.970-07:00</updated><title type='text'>Beware of the Stream.SetLength() Method</title><content type='html'>&lt;p&gt;The SetLength() method of the System.IO.Stream class, which is an abstract class for many derived classes, actually truncates a file or stream to the size, in bytes, specified by the argument passed to it whether or not you call the Write() or WriteByte() methods.&lt;/p&gt;

&lt;p&gt;The following code will truncate the file to 10 bytes.&lt;/p&gt;

&lt;xmp style="background-color:#FFFFDD;font-size:10pt;"&gt;
using (FileStream fs = new FileStream(@"C:\boot.ini", FileMode.Open))
{
    fs.SetLength(10); // Oops, we just truncated the boot.ini file to 10 characters!!!!!
    int intByte = fs.ReadByte();
    while (intByte &gt; -1)
    {
        this.txtStatus.Text += Encoding.ASCII.GetString(new byte[] {(byte)intByte});
        intByte = fs.ReadByte();
    }
}
&lt;/xmp&gt;

More information about the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.stream.setlength.aspx" target="_blank"&gt;System.IO.Stream.SetLength() method here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-115344015037365584?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/115344015037365584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=115344015037365584&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115344015037365584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/115344015037365584'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2006/07/beware-of-streamsetlength-method.html' title='Beware of the Stream.SetLength() Method'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-112708034664195788</id><published>2005-09-18T14:46:00.000-07:00</published><updated>2005-09-18T16:21:30.586-07:00</updated><title type='text'>Assemblies Notes</title><content type='html'>&lt;ul type="square"&gt;

&lt;li&gt;&lt;b&gt;Creating Resource Files&lt;/b&gt;: 
&lt;br /&gt;&lt;br /&gt;
&lt;ul&gt;
  &lt;a name="Creating Resx Files in VS.NET"&gt;&lt;/a&gt;
  &lt;li&gt;Creating Resx Files in VS.NET (embedding resources):&lt;br /&gt;&lt;br /&gt;
    &lt;ol&gt;
    &lt;li&gt; Right-click on the project to which you want to add a Resx file and click on &lt;b&gt;Add\Add New Item&lt;/b&gt;.
    &lt;li&gt; Choose &lt;b&gt;Assembly Resource File&lt;/b&gt;.
    &lt;li&gt; Click on &lt;b&gt;Open&lt;/b&gt;.
    &lt;li&gt;Select the &lt;b&gt;data&lt;/b&gt; in the left pane and then click on the &lt;b&gt;name&lt;/b&gt; column in the right pane.
    &lt;li&gt;Enter a &lt;b&gt;name&lt;/b&gt;.
    &lt;li&gt;Enter a &lt;b&gt;value&lt;/b&gt;.
    &lt;/ol&gt; 
    Note that this method embeds the resource file within the current project's assembly file. In a way, the assembly is a resource assembly; although you can use the project's assembly for more than just serving resources. Upon compilation, the contents of the resource file are embedded into the project's assembly MSIL.
    &lt;br /&gt;&lt;br /&gt;
    To access the resources via the same assembly: 1) Create an instance of ResourceManager 2) pass the constructor the following parmaters: a) "Namespace.ResourceFileNameNoExtension" and b) this.GetType().Assembly. 3) retrieve the resource itself via the ResourceManager.GetString() or ResourceManager.GetObject() method:
    &lt;xmp style="font-size:10pt; background-color:#FFFFDD"&gt;
    // Namespace = Test1
    // Resource file = TestResource.resx
    ResourceManager rm = new ResourceManager("Test1.TestResource", 
      this.GetType().Assembly);
    this.txtTest.Text = rm.GetString("test");
    &lt;/xmp&gt;
  &lt;li&gt;Creating Resource Assemblies:
    &lt;br /&gt;&lt;br /&gt;
    Creating a Resx resource assembly is pretty much the same as that outlined in &lt;a href="#Creating Resx Files in VS.NET"&gt;Creating Resx Files in VS.NET (embedding resources)&lt;/a&gt; above with the exception being the embedded resource is not part of the current project (the project accessing the resource(s)).&lt;br /&gt;&lt;br /&gt;
    &lt;ul&gt;

    &lt;li&gt;To create an assembly resource that uses a Resx file, use the steps outlined in &lt;a href="#Creating Resx Files in VS.NET"&gt;Creating Resx Files in VS.NET (embedding resources)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;
    To access the resources of the resource assembly: 1) Create an instance of ResourceManager 2) pass the constructor the following parmaters: a) "ResourceAssemblyNamespace.ResourceFileNameNoExtension" and b) this.GetType().Assembly. 3) retrieve the resource itself via the ResourceManager.GetString() or ResourceManager.GetObject() method:
    &lt;xmp style="font-size:10pt; background-color:#FFFFDD"&gt;
    // Namespace = ResourceAssembly
    // Resource file = TestResource.resx
    ResourceManager rm = new ResourceManager("ResourceAssembly.TestResource", 
      Assembly.LoadFile(Application.StartupPath + "\\ResourceAssembly.dll"));
    this.txtTest.Text = rm.GetString("test");
    &lt;/xmp&gt;

    &lt;li&gt;To create an assembly resource that uses a resources (binary) file: Use the steps outlined above, only instead of adding a Resx file, create a .resources file using the &lt;b&gt;ResEditor&lt;/b&gt; utility. You should be able to find this utility in "%PROGRAMFILES%\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Tutorials\resourcesandlocalization\reseditor".
    &lt;br /&gt;&lt;br /&gt;
    To access the resources of the resource assembly: perform the same steps as above.
    &lt;/ul&gt;
&lt;/ul&gt;

&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-112708034664195788?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/112708034664195788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=112708034664195788&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/112708034664195788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/112708034664195788'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/09/assemblies-notes.html' title='Assemblies Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111955551789994680</id><published>2005-06-23T12:38:00.000-07:00</published><updated>2005-06-25T08:05:13.030-07:00</updated><title type='text'>Role Based Security Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Impersontaing a User&lt;/b&gt;:

1) Setup the Platform Invoke DLL Function you'll be calling in step #2:&lt;pre style="font-size:10pt; background-color:#FFFFDD"&gt;
[System.Runtime.InteropServices.DllImport("advapi32.dll")]
public static extern bool LogonUser(
     String strUsername, 
     String strDomain, 
     String strPassword, 
     int intLogonType, 
     int intLogonProvider, 
     out IntPtr phToken);
&lt;/pre&gt;2) Retrieve the OS token for the user you want to impersonate:&lt;pre style="font-size:10pt; background-color:#FFFFDD"&gt;
IntPtr phToken = IntPtr.Zero;
LogonUser("username", "Domain", "password", 3, 0, out phToken);
&lt;/pre&gt;3) Create a new WindowsIdentity object and pass it the impersonation token:&lt;pre style="font-size:10pt; background-color:#FFFFDD"&gt;
WindowsIdentity ImpersonatedIdentity = new WindowsIdentity(phToken);
&lt;/pre&gt;4) Impersonate the identity:&lt;pre style="font-size:10pt; background-color:#FFFFDD"&gt;
WindowsImpersonationContext MyImpersonation = ImpersonatedIdentity.Impersonate();
&lt;/pre&gt;4) When impersonation is no longer needed, end it:&lt;pre style="font-size:10pt; background-color:#FFFFDD"&gt;
MyImpersonation.Undo();
&lt;/pre&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111955551789994680?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111955551789994680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111955551789994680&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111955551789994680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111955551789994680'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/role-based-security-notes.html' title='Role Based Security Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111867802821958284</id><published>2005-06-13T08:53:00.000-07:00</published><updated>2005-06-20T12:21:10.916-07:00</updated><title type='text'>C# Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Operator Overloading&lt;/b&gt;: the operator must be defined in the same type on which it performs the operation.&lt;pre style="background-color:#FFFFDD; font-size:10pt;"&gt;
private void btnStart_Click(object sender, System.EventArgs e)
{
 MyClass myClass1 = new MyClass();
 MyClass myClass2 = new MyClass();
 myClass1.MyStringField = "Hello ";
 myClass2.MyStringField = "World!";
 // Displays: Hello World!
 MessageBox.Show((myClass1 + myClass2).MyStringField);
 // Displays: Hello 1
 MessageBox.Show((myClass1 + 1).MyStringField);
}


public class MyClass 
{
 public String MyStringField = "";
 public static MyClass operator + (MyClass myClass1, MyClass myClass2) 
 {
  MyClass myClass = new MyClass();
  myClass.MyStringField = myClass1.MyStringField + myClass2.MyStringField;
  return myClass;
 }
 public static MyClass operator + (MyClass myClass, int Number) 
 {
  myClass.MyStringField += Number.ToString();
  return myClass;
 }
}
&lt;/pre&gt;
&lt;li&gt;&lt;b&gt;Making sure only an interface type can access an interface's members&lt;/b&gt;: &lt;pre style="background-color:#FFFFDD; font-size:10pt;"&gt;
  private void btnStart_Click(object sender, System.EventArgs e)
  {
   // MyMethod() not accessible from mc:
   MyClass mc = new MyClass();
   // MyMethod() is accessible from imc:
   IMyClass imc = new MyClass();
   imc.MyMethod();
  }

  private interface IMyClass 
  {
   void MyMethod();
  }

  private class MyClass : IMyClass
  {
   // This method only accessible via a IMyClass type:
   void IMyClass.MyMethod() {}
  }
&lt;/pre&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111867802821958284?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111867802821958284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111867802821958284&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111867802821958284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111867802821958284'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/c-notes.html' title='C# Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111816066870342268</id><published>2005-06-07T09:10:00.000-07:00</published><updated>2005-06-13T08:33:32.193-07:00</updated><title type='text'>Setup and Deployment Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Installing New Instances of an Application via the Microsoft Installer (MSI)&lt;/b&gt;: reset the ProductCode property of the Setup Project and then recompile the project.&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111816066870342268?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111816066870342268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111816066870342268&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111816066870342268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111816066870342268'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/setup-and-deployment-notes.html' title='Setup and Deployment Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111810138657307310</id><published>2005-06-06T16:42:00.000-07:00</published><updated>2005-06-17T17:25:11.126-07:00</updated><title type='text'>Windows Forms Controls Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Properly Updating Data Grid Bound Values&lt;/b&gt;: If you ever run into a situation where you have a Data Grid bound to a Data Source and another control, such as a TextBox or ComboBox, and it's bound to the same Data Source and modifying the bound value of that control does not immediately cause the modified value to appear in the Data Grid, I have the reason why: validation. 

Normally, when a situation like this occurs, simply tabbing through the controls causes the modified value to appear in the bound Data Grid. That's because the validation events are raised which in return call the control's Refresh() method. Refresh() causes the bound control(s) to invalidate their area and redraw. This includes, in this example, any data within a Data Grid.

In order for you to properly update a bound Data Grid's data whenever a bound control modifies it's values, you need to 1) first place the Focus() on the container that holds the Data Grid (a Form, GroupBox, etc.), 2) secondly, place the Focus() on the Data Grid itself and then 3) thirdly, call the Data Grid's Refresh() method.

&lt;li&gt;&lt;b&gt;Properly Handling KeyPress, KeyDown and KeyUp Events&lt;/b&gt;: always set the KeyPressEventArgs's Handled property to true whenever you want to AVOID the key pressed being sent to the application. For example, if you're checking a TextBox control to determine whether or not a user has entered a non-digit character and don't want that character to end up in the TextBox accordingly then set the Handled property to true: &lt;pre style="background-color:#FFFFDD; font-size:10pt;"&gt;
  private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
  {
   if (! Char.IsDigit(e.KeyChar)) 
   {
    MessageBox.Show("No non-digit characters allowed.");
    this.textBox1.Undo();
    e.Handled = true; // Key press will not be sent!
   }
   else
    e.Handled = false;
  }&lt;/pre&gt;
&lt;li&gt;&lt;b&gt;Tab Order&lt;/b&gt;: To enable this feature, 1) first select the form on which you want to set a tab order structure, 2) click on View and then Tab Order from the VS.NET menu and then 3) click on each control in the order in which you want tabbing flow to follow.
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111810138657307310?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111810138657307310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111810138657307310&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111810138657307310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111810138657307310'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/windows-forms-controls-notes.html' title='Windows Forms Controls Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111790674834501835</id><published>2005-06-04T10:38:00.000-07:00</published><updated>2005-06-06T16:42:40.946-07:00</updated><title type='text'>Windows Forms User Assistance Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Providing Windows Forms Help via the HelpProvider&lt;/b&gt;: 1) Drag and drop the HelpProvider control onto the form in which you want to provide help, 2) in the properties tab of the HelpProvider control, click on the ... button for HelpNamespace and enter the path to a Help File (*.htm, *.chm, *.col), 3) select a control on the form for which you want to provide help and then set the ShowHelp property to true, 4) set the HelpKeyword property for the control to the name of the HTML page that pertains to this topic and then 5) set the HelpNavigator property to Topic.

Note: after doing the preceding steps, select the control for which you want to see help and then press the F1 key. Set the HelpKeyword property to a keyword in the help file's Index and then set the HelpNavigator property to KeywordIndex to have the Index lookup the keyword specified. What you enter in HelpKeyword depends ENTIRELY on what you set the HelpNavigator property to.

&lt;li&gt;&lt;b&gt;Providing Windows Forms Pop-up Help via the HelpProvider&lt;/b&gt;: 1) Drag and drop the HelpProvider control onto the form in which you want to provide pop-up help, 2) select a control on the form for which you want to provide pop-up help and then set the ShowHelp property to true, 3) set the HelpString property to whatever you want the pop-up message to display, 4) select the parent form and then set HelpButton property to true and then 5) set the form's MaximizeBox and MinimizeBox to false.

Note: after doing the preceding steps, an extra button on the control area of the title bar of the form with a question mark in it should appear: click on this button and then click on the control for which you want to display the associated pop-up help for.
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111790674834501835?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111790674834501835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111790674834501835&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111790674834501835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111790674834501835'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/windows-forms-user-assistance-notes.html' title='Windows Forms User Assistance Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111774729580232275</id><published>2005-06-02T14:12:00.000-07:00</published><updated>2005-06-02T14:22:02.486-07:00</updated><title type='text'>ADO.NET Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Accessing a Deleted DataRow's Data&lt;/b&gt;: can be accessed by retrieving it's DataRowVersion.Original values; typically, access to data is retrieved through the DataRow using it's DataRowVersion.Current values. Added, Modified and Unchanged DataRows can have their values accessed via their DataRowVersion.Current versions.
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111774729580232275?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111774729580232275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111774729580232275&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111774729580232275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111774729580232275'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/adonet-notes.html' title='ADO.NET Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11292315.post-111766999150728636</id><published>2005-06-01T16:46:00.000-07:00</published><updated>2005-06-05T15:49:39.430-07:00</updated><title type='text'>Code Access Security Notes</title><content type='html'>&lt;ul type="square"&gt;&lt;li&gt;&lt;b&gt;Licensing Classes Using LicFileLicenseProvider&lt;/b&gt;:
 1) Add a LicenseProviderAttribute to the class (only classes are permitted) being protected by the file-based license: &lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
[System.ComponentModel.LicenseProviderAttribute(typeof(System.ComponentModel.LicFileLicenseProvider))]&lt;/div&gt; 2) In the constructor of the class you want to protect, call the LicenseManager's Validate method: &lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
System.ComponentModel.LicenseManager.Validate(typeof(MyClass));&lt;/div&gt; 3) Create a license file with the name of the format Namespace.Class.lic. Where Namespace.Class is the fully qualified class to be protected by the license. 
 4) In the license file, make sure the first line reads the following format: "Namespace.Class is a licensed component." (without the double-quotes). Care must be taken to ensure the exact sentence is written - even omitting the preiod at the end will cause the LicenseManager to throw an exception if it's not formatted perfectly.

&lt;li&gt;&lt;b&gt;SecurityAction.RequestOptional&lt;/b&gt;: isn't what it sounds like; requests the specified permission from the CLR and ALL others are implicitly refused; the specified permission is simply requested and not demanded (RequestMinimum). So, when running a Windows Forms application, [assembly: FileDialogPermission(SecurityAction.RequestOptional, Unrestricted=true)] will prevent the CLR from allowing the application to execute as ALL other permissions, including UIPermission, will be denied permission grants.

&lt;li&gt;&lt;b&gt;SecurityAction.RequestMinimum&lt;/b&gt;: demands that the CLR grant the specified permission to the application. If the run-time security policy disallows the specified permission, the application will not execute.

&lt;li&gt;&lt;b&gt;SecurityAction.RequestRefuse&lt;/b&gt;: the application lets the CLR know that the specified permission MUST NOT BE GRANTED ACCESS. If the CLR detected that the application is using the specified resource, it will now allow the application to execute.

&lt;li&gt;SecurityAction.RequestOptional, SecurityAction.RequestMinimum and SecurityAction.RequestRefuse can ONLY be used at the assembly scope.

&lt;li&gt;All permissions declaratively stated at the assembly scope are stored in the assembly's manifest.

&lt;li&gt;&lt;b&gt;Repeated Role-based Validation&lt;/b&gt;: Use the AppDomain.CurrentDomain's SetPrincipalPolicy method instead of the Thread's CurrentPrincipal property when consistent validation against the current principal is present. Supposedly, there's less overhead involved. The default is for the AppDomain to use the PrincipalPolicy.UnauthenticatedPrincipal policy.&lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
String strUsername = "";
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
strUserName = System.Threading.Thread.CurrentPrincipal.Identity.Name);
// strUsername will be 'DomainName\Username'

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.NoPrincipal);
strUserName = System.Threading.Thread.CurrentPrincipal.Identity.Name);
// A null reference exception will occur as no 
// principal object was automatically created

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.UnauthenticatedPrincipal);
strUserName = System.Threading.Thread.CurrentPrincipal.Identity.Name);
// strUsername will be '' (empty) even though an 
// IPrincipal object was automatically created
&lt;/div&gt;
&lt;li&gt;&lt;b&gt;Single-use Role-based Validation&lt;/b&gt;: When you're only going to validate a user one time, don't use the AppDomain's SetPrincipalPolicy method. Instead, set the thread's CurrentPrincipal to an instance of an IPrincipal object..&lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
GenericPrincipal gp = new GenericPrincipal(new GenericIdentity("mikeg"), new String[] {"Developer" });
System.Threading.Thread.CurrentPrincipal = gp;
&lt;/div&gt;
&lt;li&gt;&lt;b&gt;Replacing the IPrincipal Object&lt;/b&gt;: You will not have a problem replacing the thread's current principal with trusted code. However, semi-trusted code (Internet, Intranet zones, etc.) will cause a problem. In such a cases, make it known to the run-time that this is the permission you need for the semi-trusted code (the need to change the principal object from unmanaged code) by implementing the SecurityPermissionAttribute:..&lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
[assembly: System.Security.Permissions.SecurityPermissionAttribute(SecurityAction.RequestMinimum, ControlPrincipal = true)]&lt;/div&gt;
&lt;li&gt;&lt;b&gt;Validating the Current User&lt;/b&gt;: Use the PrincipalPermission object to validate the current thread's IPrincipal object/user.:&lt;div style="font-size:10pt; background-color:#FFFFDD"&gt;
//Declaratively:
[System.Security.Permissions.PrincipalPermission(SecurityAction.Demand, Name = "Username", Role = "Role1")]
// Imperatively:
System.Security.Permissions.PrincipalPermission pp = new System.Security.Permissions.PrincipalPermission("Username", "Role");
pp.Demand();
&lt;/div&gt;
&lt;li&gt;&lt;b&gt;Combining PrincipalPermission Objects&lt;/b&gt;: You can do this by creating two PrincipalPermission objects and joining them by using of the object's Union methods. The CLR uses an OR condition to determine whether a test succeeds. For example,.:&lt;div style="font-size:10pt; background-color:#FFFFDD"&gt; 
// Current user/principal must be part of either of 
// the following two roles/groups:
PrincipalPermission pp1 = new PrincipalPermission(null, "Administrators");
PrincipalPermission pp2 = new PrincipalPermission(null, "Domain Admins");

// Set the current user:
GenericPrincipal gp1 = new GenericPrincipal(new GenericIdentity("MikeG"), new String[] { "Administrators" });
System.Threading.Thread.CurrentPrincipal = gp1;

// User must be part of the Administrators group:
pp1.Union(pp2).Demand();
// The above statement will succeed as the current
// principal is part of the Administrators group.
&lt;/div&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11292315-111766999150728636?l=mtgcsharpguy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mtgcsharpguy.blogspot.com/feeds/111766999150728636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11292315&amp;postID=111766999150728636&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111766999150728636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11292315/posts/default/111766999150728636'/><link rel='alternate' type='text/html' href='http://mtgcsharpguy.blogspot.com/2005/06/code-access-security-notes.html' title='Code Access Security Notes'/><author><name>Michael G.</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
