<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dennis&#039; blog &#187; .Net</title>
	<atom:link href="http://dennispiccioni.com/wordpress/archives/category/coding/net/feed" rel="self" type="application/rss+xml" />
	<link>http://dennispiccioni.com/wordpress</link>
	<description></description>
	<lastBuildDate>Mon, 19 Apr 2010 22:54:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>First Impressions of Visual Studio 2010</title>
		<link>http://dennispiccioni.com/wordpress/archives/347</link>
		<comments>http://dennispiccioni.com/wordpress/archives/347#comments</comments>
		<pubDate>Mon, 08 Feb 2010 03:28:47 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Visual DataFlex]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://dennispiccioni.com/wordpress/?p=347</guid>
		<description><![CDATA[I played with Visual Studio 2010 Beta 2 over the weekend and I really like many of the improvements.
My favorites are new features to make code navigation simpler:

Call Hierarchy: being able to see in design mode what method calls and is called by other methods is brilliant! This is only available for C# in this [...]]]></description>
			<content:encoded><![CDATA[<p>I played with Visual Studio 2010 Beta 2 over the weekend and I really like many of the improvements.</p>
<p>My favorites are new features to make code navigation simpler:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/dd409859%28VS.100%29.aspx" target="_blank">Call Hierarchy</a>: being able to see in design mode what method calls and is called by other methods is brilliant! This is only available for C# in this revision, but that&#8217;s really the only .Net language I code in anyway.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/4sadchd3%28VS.100%29.aspx" target="_blank">Navigate To</a>: an easy way to type any part of an identifier name and find it anywhere in the current solution.</li>
</ul>
<p>I&#8217;m really happy about this. One of the most cumbersome things when working in Visual Studio has been navigating through code.</p>
<p>I still miss one of the best features of Visual DataFlex Studio, <a href="http://www.visualdataflex.com/features.asp?pageid=827" target="_blank">Code Explorer</a>, in Visual Studio. While I appreciate the improvements for making code easier to find in VS 2010, I always have Code Explorer open in the Visual DataFlex Studio. Code Explorer is a docking panel that displays the structure of the current code file. This makes it very easy to locate a class, object or method with a click.</p>
<p><a title="Click for full size image" href="http://dennispiccioni.com/wordpress/wp-content/uploads/2010/02/VDFStudioCodeExplorer.jpg" target="_blank"><img src="http://dennispiccioni.com/wordpress/wp-content/uploads/2010/02/VDFStudioCodeExplorer.jpg" alt="VDF Studio Code Explorer 'Locate in Editor'" width="1021" height="841" /></a></p>
<p>Class View at first appears somewhat similar, but the way it&#8217;s implemented, it still takes a lot more steps to find something.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennispiccioni.com/wordpress/archives/347/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caching SQL Server Tables Locally with SQL Server Compact Edition</title>
		<link>http://dennispiccioni.com/wordpress/archives/322</link>
		<comments>http://dennispiccioni.com/wordpress/archives/322#comments</comments>
		<pubDate>Sat, 19 Dec 2009 16:15:56 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server CE]]></category>

		<guid isPermaLink="false">http://dennispiccioni.com/wordpress/?p=322</guid>
		<description><![CDATA[When connecting from Visual Studio 2008 to an SQL Server 2008 database, Visual Studio allows you to enable local database caching by creating a local copy of the database as a SQL Server Compact Edition (CE) database. This database becomes an embedded database in your project.
This is great; it allows you to develop and run [...]]]></description>
			<content:encoded><![CDATA[<p>When connecting from Visual Studio 2008 to an SQL Server 2008 database, Visual Studio allows you to enable local database caching by creating a local copy of the database as a SQL Server Compact Edition (CE) database. This database becomes an embedded database in your project.</p>
<p>This is great; it allows you to develop and run a database application without requiring a connection to an SQL Server or even installing SQL Server on the client PC that runs the application. You can then use this as a standalone single user application or synchronize data between the application&#8217;s local cache and a running SQL Server database.</p>
<p>When you create a new strongly typed DataSet in the Studio via Data &gt; Add New Data Source, if the data source is an SQL Server database, you get the option to &#8220;Enable local database caching&#8221;. If checked, Visual Studio will automatically create a Local Database Cache (.sync) file and add it to your project. The code in your DataSet is created using System.Data.SqlServerCe.SqlCexx so that your code can connect to the SQLCE database. It also creates the local SQLCE database (a .sdf file), and adds it to your project.</p>
<p>The key piece in this process is the Local Database Cache (.sync) file. This is what allows you to configure which tables can be cached in your local SQLCE database. If you bring up the Configure DataSet Wizard to either create or edit a DataSet and it won&#8217;t allow you to select some tables to be cached locally, you can create or edit the .sync file. The <a href="http://msdn.microsoft.com/en-us/library/cc714038.aspx" target="_blank">How to: Configure Data Synchronization to Use SQL Server Change Tracking</a> page shows you how to create this file from scratch.</p>
<p>If you already have a .sync file, you can configure it by right-clicking on the file in Solution Explorer and choosing View Designer from the context menu. It&#8217;s kind of hidden, but if you click the Add button to add a table (provided there are more tables available in your database that can be added), you will see a link to <a href="http://msdn.microsoft.com/en-us/library/bb763049.aspx" target="_blank">Learn more about which tables can be cached&#8230;</a>, which explains the rules determining which tables can be cached.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennispiccioni.com/wordpress/archives/322/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing Amazon Web Services with C#</title>
		<link>http://dennispiccioni.com/wordpress/archives/309</link>
		<comments>http://dennispiccioni.com/wordpress/archives/309#comments</comments>
		<pubDate>Mon, 26 Oct 2009 00:59:03 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://dennispiccioni.com/wordpress/?p=309</guid>
		<description><![CDATA[I have been working on a personal C#.Net project that uses Amazon&#8217;s Web Services for a couple of years now. It&#8217;s been working quite well. I use this project as a personal database and learning tool for .Net.
Quite recently (August 2009) Amazon once again changed the name of their web services API and also the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on a personal C#.Net project that uses Amazon&#8217;s Web Services for a couple of years now. It&#8217;s been working quite well. I use this project as a personal database and learning tool for .Net.</p>
<p>Quite recently (August 2009) Amazon once again changed the name of their web services API and also the rules for making call to it, now requiring cryptographic signature authentication. While Amazon provides code samples, for some odd reason the only (yet new) C# SOAP sample provided by Amazon uses the dated and likely soon obsolete Web Services Enhancements (WSE) class library instead of Windows Communication Foundation (WCF). I assume this sample is for developers still using .Net 2.0, but a sample using more current technology would have been appropriate, as well.</p>
<p>I searched the web for a suitable sample to implement the signature authentication using .Net 3.5 and eventually came across a very appropriately titled blog entry: <a href="http://flyingpies.wordpress.com/2009/08/01/17/" target="_blank">Signing Amazon Product Advertising API requests — the missing C# WCF sample</a>, by <a href="http://flyingpies.wordpress.com/author/orentrutner/" target="_blank">Oren Trutner</a>. Attached to Oren&#8217;s very appropriately titled blog entry are 3 samples that make implementing the calls using WCF very straightforward.</p>
<p>Great work and thanks, Oren!</p>
]]></content:encoded>
			<wfw:commentRss>http://dennispiccioni.com/wordpress/archives/309/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Encapsulating Code for Easier Maintenance</title>
		<link>http://dennispiccioni.com/wordpress/archives/274</link>
		<comments>http://dennispiccioni.com/wordpress/archives/274#comments</comments>
		<pubDate>Sat, 08 Aug 2009 16:41:54 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[encapsulation]]></category>

		<guid isPermaLink="false">http://dennispiccioni.com/wordpress/?p=274</guid>
		<description><![CDATA[Code encapsulation simplifies maintenance. The more abstracted and isolated a routine is from a larger code base, the easier it will be to adjust, test, and if needed, replace later.
This came to mind recently when I wrote a short routine that determines if a mapped drive is a local drive:
[DllImport("mpr.dll")]
static extern uint WNetGetConnection(string lpLocalName, StringBuilder [...]]]></description>
			<content:encoded><![CDATA[<p>Code encapsulation simplifies maintenance. The more abstracted and isolated a routine is from a larger code base, the easier it will be to adjust, test, and if needed, replace later.</p>
<p>This came to mind recently when I wrote a short routine that determines if a mapped drive is a local drive:</p>
<pre>[DllImport("mpr.dll")]
static extern uint WNetGetConnection(string lpLocalName, StringBuilder lpRemoteName, ref int lpnLength);

// returns whether the current drive is local
internal static bool IsLocalDrive(String driveName)
{
    bool isLocal = true;  // assume local until disproved

    // strip trailing backslashes from driveName
    driveName = driveName.Substring(0, 2);

    int length = 256; // to be on safe side
    StringBuilder networkShare = new StringBuilder(length);
    uint status = WNetGetConnection(driveName, networkShare, ref length);

    // does a network share exist for this drive?
    if (networkShare.Length != 0)
    {
        // now networkShare contains a UNC path in format \\MachineName\ShareName
        // retrieve the MachineName portion
        String shareName = networkShare.ToString();
        string[] splitShares = shareName.Split('\\');
        // the 3rd array element now contains the machine name
        if (Environment.MachineName == splitShares[2])
            isLocal = true;
        else
            isLocal = false;
    }

    return isLocal;
}</pre>
<p>There is a <a href="http://stackoverflow.com/questions/1088752/how-to-programmatically-discover-mapped-network-drives-on-system-and-their-server/1224167" target="_blank">post on stackoverflow</a> asking how to do this, and, like many others, it has several answers showing several ways to do this. So, is my method correct? This code seems to work, but I&#8217;ve been programming long enough to know that code that &#8220;seems to work&#8221; doesn&#8217;t necessarily work in every circumstance and could have other negatives, such as performance issues.</p>
<p>So, knowing that this code I may have to tweak or replace at some future point in time, I will try to encapsulate it as much as possible to make it easier to work with in an isolated manner later. By keeping the code in a separate method, I can easily use a unit test to try it in various test scenarios without affecting any other code.</p>
<p>Of course, this is a very simple scenario, which made it perfect for this post. It can be much tougher to abstract and isolate more complex code, but that doesn&#8217;t mean we shouldn&#8217;t strive to do so whenever possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennispiccioni.com/wordpress/archives/274/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Austin Code Camp 2009</title>
		<link>http://dennispiccioni.com/wordpress/archives/135</link>
		<comments>http://dennispiccioni.com/wordpress/archives/135#comments</comments>
		<pubDate>Wed, 03 Jun 2009 17:23:44 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ADNUG]]></category>
		<category><![CDATA[Austin]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://dennispiccioni.com/wordpress/?p=135</guid>
		<description><![CDATA[Last Saturday I attended Austin Code Camp 2009. This was the second year I attended and I&#8217;m already looking forward to next year! Austin Code Camp is an annual event of a full Saturday of .Net-related classes and presentations, all completely free to attendees like myself.
My biggest problem was picking which sessions to attend, or worse, [...]]]></description>
			<content:encoded><![CDATA[<p>Last Saturday I attended Austin Code Camp 2009. This was the second year I attended and I&#8217;m already looking forward to next year! Austin Code Camp is an annual event of a full Saturday of .Net-related classes and presentations, all completely free to attendees like myself.</p>
<p>My biggest problem was picking which sessions to attend, or worse, which ones not to attend. <img src='http://dennispiccioni.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>I eventually chose to attend <em>Sneak peek at C# 4.0</em> by <a href="http://www.lostechies.com/blogs/jimmy_bogard/" target="_blank">Jimmy Bogard</a>, who gave a similar session about C# 3.0 at last year&#8217;s camp, and 2 excellent 2 hour SQL Server sessions by <a href="http://anildesai.net" target="_blank">Anil Desai</a>, <em>SQL Server Reporting Services: Report Creation and Deployment</em> and <em>SQL Server Performance Monitoring &amp; Optimization</em>. All 3 sessions were awesome, thanks guys!</p>
<p>Thanks to <a href="http://geekswithblogs.net/johnteague/Default.aspx" target="_blank">John Teague</a>, all presenters, the <a href="http://www.adnug.org/" target="_blank">Austin .Net Users Group</a>, the sponsors and everyone else who helped make this event happen!</p>
]]></content:encoded>
			<wfw:commentRss>http://dennispiccioni.com/wordpress/archives/135/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
