<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Dan Miser - Compact Framework</title>
    <link>http://www.distribucon.com/blog/</link>
    <description>Thoughts from Dan Miser</description>
    <language>en-us</language>
    <copyright>Dan Miser</copyright>
    <lastBuildDate>Thu, 22 Mar 2007 16:16:48 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>dmiser@distribucon.com</managingEditor>
    <webMaster>dmiser@distribucon.com</webMaster>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=f12f69c6-5647-44a7-9c27-717c5d953da6</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,f12f69c6-5647-44a7-9c27-717c5d953da6.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,f12f69c6-5647-44a7-9c27-717c5d953da6.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f12f69c6-5647-44a7-9c27-717c5d953da6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">The following application shows a subtle
difference in dealing with enums using Enum class methods and when using reflection.
In this sample, I am looking to find the number of elements in the enum. <a href="http://msdn2.microsoft.com/en-us/library/system.enum.getvalues.aspx" target="_new">Enum.GetValues</a> and <a href="http://msdn2.microsoft.com/en-us/library/system.enum.getnames.aspx" target="_new">Enum.GetNames</a> are
not implemented in the .NET Compact Framework, so I cannot use those methods. 
<p>
By using reflection, I figured I would gain the upper hand and take control of my
enum woes. Unfortunately, calling <a href="http://msdn2.microsoft.com/en-us/library/ch9714z3.aspx" target="_new">GetFields</a> on
an enum type adds an extra entry named "value__" to the returned list. After browsing
through the decompilation of Enum, I found that value__ is just a special instance
field used by the enum to hold the value of the selected member. I also noticed that
the actual enum members are really marked as static. So, to get around this problem,
all you need to do is call GetFields with the BindingFlags set to only retrieve the
public, static fields (see the code example below). 
</p><p><code><pre><!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Reflection;\par ??\par ??\cf1 namespace\cf0  EnumReflection\par ??\{\par ??    \cf1 class\cf0  \cf4 Program\par ??\cf0     \{\par ??        \cf1 enum\cf0  \cf4 Test\par ??\cf0         \{\par ??            One,\par ??            Two,\par ??            Three\par ??        \}\par ??\par ??        \cf1 static\cf0  \cf1 void\cf0  Main(\cf1 string\cf0 [] args)\par ??        \{\par ??            \cf4 Type\cf0  enumType = \cf1 typeof\cf0 (\cf4 Test\cf0 );\par ??\par ??            \cf5 //The following prints 3, but we can't use this method in .NET CF\par ??\cf0             \cf4 Console\cf0 .WriteLine(\cf4 Enum\cf0 .GetValues(enumType).Length);\par ??\par ??            \cf4 FieldInfo\cf0 [] infos;\par ??            infos = enumType.GetFields();\par ??\par ??            \cf5 //The following prints 4! There is an extra, unrelated Int32 entry named "value__" \par ??\cf0             \cf5 //at the zeroth element of the info array.\par ??\cf0             \cf4 Console\cf0 .WriteLine(infos.Length);\par ??\par ??            \cf5 //The following prints 3. The value__ field is removed by specifying we only want the public, static fields.\par ??\cf0             infos = enumType.GetFields(\cf4 BindingFlags\cf0 .Public | \cf4 BindingFlags\cf0 .Static);\par ??            \cf1 foreach\cf0  (\cf4 FieldInfo\cf0  fi \cf1 in\cf0  infos)\par ??            \{\par ??                \cf4 Console\cf0 .WriteLine(fi.Name);\par ??            \}\par ??        \}\par ??    \}\par ??\}}
--><div style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"><p style="MARGIN: 0px"><span style="COLOR: blue">using</span> System;
</p><p style="MARGIN: 0px"><span style="COLOR: blue">using</span> System.Reflection;
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px"><span style="COLOR: blue">namespace</span> EnumReflection
</p><p style="MARGIN: 0px">
{
</p><p style="MARGIN: 0px">
    <span style="COLOR: blue">class</span><span style="COLOR: #2b91af">Program</span></p><p style="MARGIN: 0px">
    {
</p><p style="MARGIN: 0px">
        <span style="COLOR: blue">enum</span><span style="COLOR: #2b91af">Test</span></p><p style="MARGIN: 0px">
        {
</p><p style="MARGIN: 0px">
            One,
</p><p style="MARGIN: 0px">
            Two,
</p><p style="MARGIN: 0px">
            Three
</p><p style="MARGIN: 0px">
        }
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px">
        <span style="COLOR: blue">static</span><span style="COLOR: blue">void</span> Main(<span style="COLOR: blue">string</span>[]
args)
</p><p style="MARGIN: 0px">
        {
</p><p style="MARGIN: 0px">
            <span style="COLOR: #2b91af">Type</span> enumType
= <span style="COLOR: blue">typeof</span>(<span style="COLOR: #2b91af">Test</span>);
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px">
            <span style="COLOR: green">//The
following prints 3, but we can't use this method in .NET CF</span></p><p style="MARGIN: 0px">
            <span style="COLOR: #2b91af">Console</span>.WriteLine(<span style="COLOR: #2b91af">Enum</span>.GetValues(enumType).Length);
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px">
            <span style="COLOR: #2b91af">FieldInfo</span>[]
infos;
</p><p style="MARGIN: 0px">
            infos = enumType.GetFields();
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px">
            <span style="COLOR: green">//The
following prints 4! There is an extra, unrelated Int32 entry named "value__" </span></p><p style="MARGIN: 0px">
            <span style="COLOR: green">//at
the zeroth element of the info array.</span></p><p style="MARGIN: 0px">
            <span style="COLOR: #2b91af">Console</span>.WriteLine(infos.Length);
</p><p style="MARGIN: 0px">
 
</p><p style="MARGIN: 0px">
            <span style="COLOR: green">//The
following prints the 3 enum elements. The value__ field is removed by </span></p><p style="MARGIN: 0px"><span style="COLOR: green">            //specifying
we only want the public, static fields.</span></p><p style="MARGIN: 0px">
            infos = enumType.GetFields(<span style="COLOR: #2b91af">BindingFlags</span>.Public
| <span style="COLOR: #2b91af">BindingFlags</span>.Static);
</p><p style="MARGIN: 0px">
            <span style="COLOR: blue">foreach</span> (<span style="COLOR: #2b91af">FieldInfo</span> fi <span style="COLOR: blue">in</span> infos)
</p><p style="MARGIN: 0px">
            {
</p><p style="MARGIN: 0px">
                <span style="COLOR: #2b91af">Console</span>.WriteLine(fi.Name);
</p><p style="MARGIN: 0px">
            }
</p><p style="MARGIN: 0px">
        }
</p><p style="MARGIN: 0px">
    }
</p><p style="MARGIN: 0px">
}
</p></div></pre></code><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=f12f69c6-5647-44a7-9c27-717c5d953da6" /></p></body>
      <title>Getting members of an Enum via reflection</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,f12f69c6-5647-44a7-9c27-717c5d953da6.aspx</guid>
      <link>http://www.distribucon.com/blog/GettingMembersOfAnEnumViaReflection.aspx</link>
      <pubDate>Thu, 22 Mar 2007 16:16:48 GMT</pubDate>
      <description>The following application shows a subtle difference in dealing with enums using Enum class methods and when using reflection. In this sample, I am looking to find the number of elements in the enum. &lt;a href="http://msdn2.microsoft.com/en-us/library/system.enum.getvalues.aspx" target=_new&gt;Enum.GetValues&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/library/system.enum.getnames.aspx" target=_new&gt;Enum.GetNames&lt;/a&gt; are
not implemented in the .NET Compact Framework, so I cannot use those methods. 
&lt;p&gt;
By using reflection, I figured I would gain the upper hand and take control of my
enum woes. Unfortunately, calling &lt;a href="http://msdn2.microsoft.com/en-us/library/ch9714z3.aspx" target=_new&gt;GetFields&lt;/a&gt; on
an enum type adds an extra entry named "value__" to the returned list. After browsing
through the decompilation of Enum, I found that value__ is just a special instance
field used by the enum to hold the value of the selected member. I also noticed that
the actual enum members are really marked as static. So, to get around this problem,
all you need to do is call GetFields with the BindingFlags set to only retrieve the
public, static fields (see the code example below). 
&lt;p&gt;
&lt;code&gt;&lt;pre&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Reflection;\par ??\par ??\cf1 namespace\cf0  EnumReflection\par ??\{\par ??    \cf1 class\cf0  \cf4 Program\par ??\cf0     \{\par ??        \cf1 enum\cf0  \cf4 Test\par ??\cf0         \{\par ??            One,\par ??            Two,\par ??            Three\par ??        \}\par ??\par ??        \cf1 static\cf0  \cf1 void\cf0  Main(\cf1 string\cf0 [] args)\par ??        \{\par ??            \cf4 Type\cf0  enumType = \cf1 typeof\cf0 (\cf4 Test\cf0 );\par ??\par ??            \cf5 //The following prints 3, but we can't use this method in .NET CF\par ??\cf0             \cf4 Console\cf0 .WriteLine(\cf4 Enum\cf0 .GetValues(enumType).Length);\par ??\par ??            \cf4 FieldInfo\cf0 [] infos;\par ??            infos = enumType.GetFields();\par ??\par ??            \cf5 //The following prints 4! There is an extra, unrelated Int32 entry named "value__" \par ??\cf0             \cf5 //at the zeroth element of the info array.\par ??\cf0             \cf4 Console\cf0 .WriteLine(infos.Length);\par ??\par ??            \cf5 //The following prints 3. The value__ field is removed by specifying we only want the public, static fields.\par ??\cf0             infos = enumType.GetFields(\cf4 BindingFlags\cf0 .Public | \cf4 BindingFlags\cf0 .Static);\par ??            \cf1 foreach\cf0  (\cf4 FieldInfo\cf0  fi \cf1 in\cf0  infos)\par ??            \{\par ??                \cf4 Console\cf0 .WriteLine(fi.Name);\par ??            \}\par ??        \}\par ??    \}\par ??\}}
--&gt;
&lt;div style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;
&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; System;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; System.Reflection;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&lt;span style="COLOR: blue"&gt;namespace&lt;/span&gt; EnumReflection
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
{
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Program&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;enum&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Test&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; One,
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Two,
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Three
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Main(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;[]
args)
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; enumType
= &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;Test&lt;/span&gt;);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//The
following prints 3, but we can't use this method in .NET CF&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: #2b91af"&gt;Enum&lt;/span&gt;.GetValues(enumType).Length);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: #2b91af"&gt;FieldInfo&lt;/span&gt;[]
infos;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; infos = enumType.GetFields();
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//The
following prints 4! There is an extra, unrelated Int32 entry named "value__" &lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//at
the zeroth element of the info array.&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(infos.Length);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//The
following prints the 3 enum elements. The value__ field is removed by &lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&lt;span style="COLOR: green"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//specifying
we only want the public, static fields.&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; infos = enumType.GetFields(&lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.Public
| &lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.Static);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;FieldInfo&lt;/span&gt; fi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; infos)
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(fi.Name);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
}
&lt;/p&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/code&gt;&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=f12f69c6-5647-44a7-9c27-717c5d953da6" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,f12f69c6-5647-44a7-9c27-717c5d953da6.aspx</comments>
      <category>.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=43dc99a1-fca9-4428-9574-39f18ecb3c30</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,43dc99a1-fca9-4428-9574-39f18ecb3c30.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,43dc99a1-fca9-4428-9574-39f18ecb3c30.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=43dc99a1-fca9-4428-9574-39f18ecb3c30</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">A while back, I wrote about <a href="http://www.distribucon.com/blog/PermaLink,guid,1655.aspx" taget="_new">how
to use the Data Access Application Block (DAAB) in the Compact Framework</a>. While
this code works just fine, it turns out that <a href="http://www.codeplex.com/entlib" target="_new">Enterprise
Library 3.0</a> will support this natively. I really like the TableExists method that
they added, too. 
<p>
David Hayden wrote a couple of articles about this <a href="http://codebetter.com/blogs/david.hayden/archive/2007/02/02/Enterprise-Library-3.0-DAAB-Improvements-To-Date.aspx" target="_new">here</a> and <a href="http://davidhayden.com/blog/dave/archive/2007/01/02/SqlCeDatabaseDataAccessApplicationBlock.aspx" target="_new">here</a>.<img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=43dc99a1-fca9-4428-9574-39f18ecb3c30" /></p></body>
      <title>Enterprise Library 3.0 provides MSSQL Compact Edition support</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,43dc99a1-fca9-4428-9574-39f18ecb3c30.aspx</guid>
      <link>http://www.distribucon.com/blog/EnterpriseLibrary30ProvidesMSSQLCompactEditionSupport.aspx</link>
      <pubDate>Wed, 21 Feb 2007 23:23:26 GMT</pubDate>
      <description>A while back, I wrote about &lt;a href="http://www.distribucon.com/blog/PermaLink,guid,1655.aspx" taget="_new"&gt;how
to use the Data Access Application Block (DAAB) in the Compact Framework&lt;/a&gt;. While
this code works just fine, it turns out that &lt;a href="http://www.codeplex.com/entlib" target="_new"&gt;Enterprise
Library 3.0&lt;/a&gt; will support this natively. I really like the TableExists method that
they added, too. 
&lt;p&gt;
David Hayden wrote a couple of articles about this &lt;a href="http://codebetter.com/blogs/david.hayden/archive/2007/02/02/Enterprise-Library-3.0-DAAB-Improvements-To-Date.aspx" target="_new"&gt;here&lt;/a&gt; and &lt;a href="http://davidhayden.com/blog/dave/archive/2007/01/02/SqlCeDatabaseDataAccessApplicationBlock.aspx" target="_new"&gt;here&lt;/a&gt;.&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=43dc99a1-fca9-4428-9574-39f18ecb3c30" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,43dc99a1-fca9-4428-9574-39f18ecb3c30.aspx</comments>
      <category>.NET</category>
      <category>ADO.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=97de3fd9-1421-44c9-ba18-e54fdaf4ad12</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,97de3fd9-1421-44c9-ba18-e54fdaf4ad12.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,97de3fd9-1421-44c9-ba18-e54fdaf4ad12.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=97de3fd9-1421-44c9-ba18-e54fdaf4ad12</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I just went through the very lengthy process
of moving from MSSQLCE beta to MSSQLCE release. The good news is that after I was
done, all of my code still worked, so at least I have that going for me. :-) 
<p>
The biggest time sink for me was uninstalling applications. Uninstalling the patch
from VS2005 Pro was not all that straight-forward. First, I had to re-download and
burn the ISO image since I couldn't find my original DVD. I then noticed that I had
another entry in my Add/Remove Programs called "Microsoft Visual Studio 2005 Permier
Partner Edition - ENU" that had the VS.NET SP1 Beta applied to it. I had no idea how
this program got installed, and that took quite a bit of spelunking to figure out.
I came across a blog entry from <a href="http://blogs.msdn.com/heaths/articles/pab.aspx" target="_new">Heath
Stewart</a> that explained how to look into the patch database to figure out which
MS patches were applied to which products. After installing that, it needed a Windows
Installer Patch (msp) file, but I couldn't find that. I ended up searching my system,
and got the VS.NET msp file and opened it in Heath's utility. From there, I got the
GUID of the Premier Partner Edition, and searched my registry. In the end, it turned
out to be MSSQL 2005 Developer Edition that installed that program. I finally located
that DVD, pointed the uninstaller to the right msi file, and I was able to uninstall
the patch. However, after completing all of this, I couldn't install the MSSQL Server
2005 Compact Edition Tools for VS 2005 SP1. I received the same error as I did last
time (see the above link for details), but I couldn't solve it by doing a Repair on
VS.NET, and I couldn't dig anything up in Filemon or Regmon to find out why it was
failing so I ended up completely uninstalling and reinstalling VS.NET. Not exactly
very user-friendly. 
</p><p>
Installing the release of MSSQLCE is very similar to the post I made earlier on <a href="http://www.distribucon.com/blog/PermaLink,guid,1658.aspx" target="_new">how
to install MSSQLCE</a>. The difference is the links to the new files, which can be
found here: 
</p><p></p><ul><li><a href="http://msdn.microsoft.com/vstudio/support/vs2005sp1/" target="_new">Visual
Studio 2005 Service Pack 1 (SP1)</a></li><li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=877c0adc-0347-4a47-b842-58fb71d159ac&amp;displaylang=en&amp;tm" target="_new">Microsoft
SQL Server 2005 Compact Edition Tools for Visual Studio 2005 Service Pack 1 </a></li><li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=85e0c3ce-3fa1-453a-8ce9-af6ca20946c3&amp;displaylang=en&amp;tm" target="_new">Microsoft
SQL Server 2005 Compact Edition</a></li><li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=e9aa3f8d-363d-49f3-ae89-64e1d149e09b&amp;displaylang=en&amp;tm" target="_new">Microsoft
SQL Server 2005 Compact Edition Developer Software Development Kit </a></li><li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=4e45f676-e69a-4f7f-a016-c1585acf4310&amp;displaylang=en&amp;tm" target="_new">Microsoft
SQL Server 2005 Compact Edition Server Tools </a></li></ul><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=97de3fd9-1421-44c9-ba18-e54fdaf4ad12" /></body>
      <title>MSSQL Compact Edition released</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,97de3fd9-1421-44c9-ba18-e54fdaf4ad12.aspx</guid>
      <link>http://www.distribucon.com/blog/MSSQLCompactEditionReleased.aspx</link>
      <pubDate>Tue, 16 Jan 2007 16:45:46 GMT</pubDate>
      <description>I just went through the very lengthy process of moving from MSSQLCE beta to MSSQLCE release. The good news is that after I was done, all of my code still worked, so at least I have that going for me. :-) 
&lt;p&gt;
The biggest time sink for me was uninstalling applications. Uninstalling the patch
from VS2005 Pro was not all that straight-forward. First, I had to re-download and
burn the ISO image since I couldn't find my original DVD. I then noticed that I had
another entry in my Add/Remove Programs called "Microsoft Visual Studio 2005 Permier
Partner Edition - ENU" that had the VS.NET SP1 Beta applied to it. I had no idea how
this program got installed, and that took quite a bit of spelunking to figure out.
I came across a blog entry from &lt;a href="http://blogs.msdn.com/heaths/articles/pab.aspx" target=_new&gt;Heath
Stewart&lt;/a&gt; that explained how to look into the patch database to figure out which
MS patches were applied to which products. After installing that, it needed a Windows
Installer Patch (msp) file, but I couldn't find that. I ended up searching my system,
and got the VS.NET msp file and opened it in Heath's utility. From there, I got the
GUID of the Premier Partner Edition, and searched my registry. In the end, it turned
out to be MSSQL 2005 Developer Edition that installed that program. I finally located
that DVD, pointed the uninstaller to the right msi file, and I was able to uninstall
the patch. However, after completing all of this, I couldn't install the MSSQL Server
2005 Compact Edition Tools for VS 2005 SP1. I received the same error as I did last
time (see the above link for details), but I couldn't solve it by doing a Repair on
VS.NET, and I couldn't dig anything up in Filemon or Regmon to find out why it was
failing so I ended up completely uninstalling and reinstalling VS.NET. Not exactly
very user-friendly. 
&lt;p&gt;
Installing the release of MSSQLCE is very similar to the post I made earlier on &lt;a href="http://www.distribucon.com/blog/PermaLink,guid,1658.aspx" target=_new&gt;how
to install MSSQLCE&lt;/a&gt;. The difference is the links to the new files, which can be
found here: 
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/vstudio/support/vs2005sp1/" target=_new&gt;Visual
Studio 2005 Service Pack 1 (SP1)&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=877c0adc-0347-4a47-b842-58fb71d159ac&amp;amp;displaylang=en&amp;amp;tm" target=_new&gt;Microsoft
SQL Server 2005 Compact Edition Tools for Visual Studio 2005 Service Pack 1 &lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=85e0c3ce-3fa1-453a-8ce9-af6ca20946c3&amp;amp;displaylang=en&amp;amp;tm" target=_new&gt;Microsoft
SQL Server 2005 Compact Edition&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=e9aa3f8d-363d-49f3-ae89-64e1d149e09b&amp;amp;displaylang=en&amp;amp;tm" target=_new&gt;Microsoft
SQL Server 2005 Compact Edition Developer Software Development Kit &lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=4e45f676-e69a-4f7f-a016-c1585acf4310&amp;amp;displaylang=en&amp;amp;tm" target=_new&gt;Microsoft
SQL Server 2005 Compact Edition Server Tools &lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=97de3fd9-1421-44c9-ba18-e54fdaf4ad12" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,97de3fd9-1421-44c9-ba18-e54fdaf4ad12.aspx</comments>
      <category>.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=1676</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,1676.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,1676.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1676</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">When <a href="http://blogs.borland.com/johnk/" target="_new">John
Kaster</a> of CodeGear (formerly Borland) came to Milwaukee last year, he showed a
demo of some software running on a Pocket PC (PPC). The cool part was he was working
on the actual PPC device itself but broadcasting the PPC screen to the overhead projector
through his laptop. 
<p>
I checked with him this week as I'm doing more work in this area now, and he told
me that the free tool to get this done is called ActiveSync Remote Display. It is
part of the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=74473fd6-1dcc-47aa-ab28-6a2b006edfe9&amp;displaylang=en" target="_new">Windows
Mobile Developer Power Toys</a>, available from Microsoft. I also tested it this week,
and I can report that it still works with Active Sync 4.2.
</p><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1676" /></body>
      <title>Remote Display for PPC Devices</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,1676.aspx</guid>
      <link>http://www.distribucon.com/blog/RemoteDisplayForPPCDevices.aspx</link>
      <pubDate>Tue, 12 Dec 2006 14:36:00 GMT</pubDate>
      <description>When &lt;a href="http://blogs.borland.com/johnk/" target=_new&gt;John Kaster&lt;/a&gt; of CodeGear
(formerly Borland) came to Milwaukee last year, he showed a demo of some software
running on a Pocket PC (PPC). The cool part was he was working on the actual PPC device
itself but broadcasting the PPC screen to the overhead projector through his laptop. 
&lt;p&gt;
I checked with him this week as I'm doing more work in this area now, and he told
me that the free tool to get this done is called ActiveSync Remote Display. It is
part of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=74473fd6-1dcc-47aa-ab28-6a2b006edfe9&amp;amp;displaylang=en" target=_new&gt;Windows
Mobile Developer Power Toys&lt;/a&gt;, available from Microsoft. I also tested it this week,
and I can report that it still works with Active Sync 4.2.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1676" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,1676.aspx</comments>
      <category>.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=1659</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,1659.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,1659.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1659</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Rory Blyth has a couple of good videos
on MSDN TV, showing how to use MSSQL Mobile Edition on a CF device. They are older,
so they don't cover all the new nomenclature (and probably newer features), but there
are a couple of good tips and tricks in there, and it contains good coverage of <a href="http://msdn2.microsoft.com/en-us/library/ms172029.aspx" target="_new">Remote
Data Access</a>, a technology that will help synchronize data to/from MSSQL Compact
Edition. 
<p>
Links:<br /></p><ul><li><a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060831MobileRB/manifest.xml" target="_new">Introduction
to Data-Aware Windows Mobile Applications, Pt. 1</a></li><li><a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060907MobileRB/manifest.xml" target="_new">Introduction
to Data-Aware Windows Mobile Applications, Pt. 2</a></li><li><a href="http://oakleafblog.blogspot.com/2006/11/adonet-sync-framework-for-occasionally.html" target="_new">ADO.NET
Sync Framework for Occasionally Connected Systems</a>, which also has links to webcasts
and screencasts that explore the topics in more detail. 
</li></ul><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1659" /></body>
      <title>Training material for MSSQL CE</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,1659.aspx</guid>
      <link>http://www.distribucon.com/blog/TrainingMaterialForMSSQLCE.aspx</link>
      <pubDate>Fri, 08 Dec 2006 15:56:00 GMT</pubDate>
      <description>Rory Blyth has a couple of good videos on MSDN TV, showing how to use MSSQL Mobile Edition on a CF device. They are older, so they don't cover all the new nomenclature (and probably newer features), but there are a couple of good tips and tricks in there, and it contains good coverage of &lt;a href="http://msdn2.microsoft.com/en-us/library/ms172029.aspx" target=_new&gt;Remote
Data Access&lt;/a&gt;, a technology that will help synchronize data to/from MSSQL Compact
Edition. 
&lt;p&gt;
Links:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060831MobileRB/manifest.xml" target=_new&gt;Introduction
to Data-Aware Windows Mobile Applications, Pt. 1&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060907MobileRB/manifest.xml" target=_new&gt;Introduction
to Data-Aware Windows Mobile Applications, Pt. 2&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://oakleafblog.blogspot.com/2006/11/adonet-sync-framework-for-occasionally.html" target=_new&gt;ADO.NET
Sync Framework for Occasionally Connected Systems&lt;/a&gt;, which also has links to webcasts
and screencasts that explore the topics in more detail. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1659" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,1659.aspx</comments>
      <category>.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=1658</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,1658.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,1658.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1658</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Here's my experience getting this combination
of tools to work properly. At times, it was extremely frustrating, and other times
it was confusing. MS has not helped much what with obsolete, out-dated, mis-named,
and near impossible to find products. Hopefully the RTM version will have everything
stitched together nicely so all you have to do is double click a setup file. It would
be even better to have log information easily and readily available for the installs.
If you want to develop with these technologies, give these steps a try. I don't claim
that they are authoritatve or complete, but I documented as much as I could capture. 
<p></p><ol><li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=7269173A-28BF-4CAC-A682-58D3233EFB4C&amp;displaylang=en" target="_new">ActiveSync
Setup 4.2</a> - required for several other installs later on. 
</li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=83A52AF2-F524-4EC5-9155-717CBE5D25ED&amp;displayLang=en" target="_new">Windows
Mobile 5.0 PPC SDK</a> - adds new platform targets and emulators to support PPC development
with WM 5.0. There is also a <a href="http://www.microsoft.com/downloads/details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&amp;displaylang=en" target="_new">Windows
Mobile 5.0 SDK for Smartphone</a> download available if you prefer that instead. 
</li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8D702463-674B-4978-9E22-C989130F6553&amp;displaylang=en" target="_new">VS.NET
2005 SP1 Beta</a> - I couldn't get to this page from the MS site anywhere, but I was
able to find a link to take me to the download location. I can't swear that this is
entirely required, as I installed the other tools without it on one PC, and it seemed
to work OK. 
</li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=61289b5d-af86-45dd-8962-e7dcc5221796&amp;displaylang=en" target="_new">Microsoft
SQL Server 2005 Everywhere Edition Tools for Visual Studio 2005 Service Pack 1 Beta</a> -
This install specifically states that VS.NET SP1 Beta is required. As you can see
from the title, it also mentions SqlServer Everywhere, but ignore that inconsistency.
The MSSQL team <a href="http://blogs.msdn.com/sqlservereverywhere/archive/2006/11/06/sql-server-compact-edition-rc1-release.aspx" tartget="_new">has
renamed the product to SQL Server Compact Edition</a>. This naming problem is supposed
to be fixed by the time MS releases MSSQL Compact Edition. 
<p>
I also ran into a problem when uninstalling this application. I would get the following
error when trying to reinstall it:<br /></p><pre><code> The upgrade patch cannot be installed by the Windows Installer service
because the program to be upgraded may be missing, or the upgrade path may update
a different version of the program. Verify that the program to be upgraded exists
on your computer and that you have the correct upgrade patch </code></pre><br />
I finally did a Repair install on VS.NET, and I was able to install the tools again. 
<p>
However, even with all of that, I would recommend installing this because it allows
for things like Server Explorer to be used on SDF files. 
</p></li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=85E0C3CE-3FA1-453A-8CE9-AF6CA20946C3&amp;displaylang=en" target="_new">Microsoft
SQL Server 2005 Compact Edition RC1</a> - This installs MSSQL Compact Edition. Note
that there are numerous naming changes throughout the web (Mobile, Everywhere, Compact),
but Compact Edition is going to be the final answer - allegedly. 
</li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=83A52AF2-F524-4EC5-9155-717CBE5D25ED&amp;displayLang=en" target="_new">Windows
Mobile 5.0 SDK for Pocket PC</a> - This install will give you some more power within
the IDE, e.g. it will bring up the Data Configuration Wizard to generate DataSets
when adding an SDF to your project. It also installs the latest version of Northwind.sdf
for you to play with. By default, it gets installed to C:\Program Files\Microsoft
Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\northwind.sdf. 
</li><li>
(Semi-optional) <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E6BC81E8-175B-46EA-86A0-C9DACAA84C85&amp;displaylang=en" target="_new">SQL
Server 2005 Compact Edition Books Online Community Technology Preview (CTP)</a> -
Reference information is always good, right? 
</li></ol><p>
Additional notes: 
</p><ul><li>
You can manage an SDF file from your desktop machine, by using Server Explorer within
VS.NET, or by selecting SQL Server Mobile as the Database Type in <a href="http://community.bartdesmet.net/blogs/bart/archive/2006/08/26/4272.aspx" target="_new">SQL
Server Management Studio</a>. On the PPC device, you can use QueryAnalyzer (located
at /Program Files/SQL Mobile/EN/isqlw30.exe), or open the sdf file on the PPC device. 
</li><li>
To deploy an SDF to the PPC, just add it to your solution and it will get deployed
to the PPC device automatically. 
</li></ul><p>
Good luck, and I hope this helps someone through the corn field maze that is CF and
MSSQL CE installation.
</p><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1658" /></body>
      <title>Recipe: CF 2.0 and MSSQL Compact Edition 3.1 installations</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,1658.aspx</guid>
      <link>http://www.distribucon.com/blog/RecipeCF20AndMSSQLCompactEdition31Installations.aspx</link>
      <pubDate>Thu, 07 Dec 2006 14:59:00 GMT</pubDate>
      <description>Here's my experience getting this combination of tools to work properly. At times, it was extremely frustrating, and other times it was confusing. MS has not helped much what with obsolete, out-dated, mis-named, and near impossible to find products. Hopefully the RTM version will have everything stitched together nicely so all you have to do is double click a setup file. It would be even better to have log information easily and readily available for the installs. If you want to develop with these technologies, give these steps a try. I don't claim that they are authoritatve or complete, but I documented as much as I could capture. 
&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=7269173A-28BF-4CAC-A682-58D3233EFB4C&amp;amp;displaylang=en" target=_new&gt;ActiveSync
Setup 4.2&lt;/a&gt; - required for several other installs later on. 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=83A52AF2-F524-4EC5-9155-717CBE5D25ED&amp;amp;displayLang=en" target=_new&gt;Windows
Mobile 5.0 PPC SDK&lt;/a&gt; - adds new platform targets and emulators to support PPC development
with WM 5.0. There is also a &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&amp;amp;displaylang=en" target=_new&gt;Windows
Mobile 5.0 SDK for Smartphone&lt;/a&gt; download available if you prefer that instead. 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8D702463-674B-4978-9E22-C989130F6553&amp;amp;displaylang=en" target=_new&gt;VS.NET
2005 SP1 Beta&lt;/a&gt; - I couldn't get to this page from the MS site anywhere, but I was
able to find a link to take me to the download location. I can't swear that this is
entirely required, as I installed the other tools without it on one PC, and it seemed
to work OK. 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=61289b5d-af86-45dd-8962-e7dcc5221796&amp;amp;displaylang=en" target=_new&gt;Microsoft
SQL Server 2005 Everywhere Edition Tools for Visual Studio 2005 Service Pack 1 Beta&lt;/a&gt; -
This install specifically states that VS.NET SP1 Beta is required. As you can see
from the title, it also mentions SqlServer Everywhere, but ignore that inconsistency.
The MSSQL team &lt;a href="http://blogs.msdn.com/sqlservereverywhere/archive/2006/11/06/sql-server-compact-edition-rc1-release.aspx" tartget="_new"&gt;has
renamed the product to SQL Server Compact Edition&lt;/a&gt;. This naming problem is supposed
to be fixed by the time MS releases MSSQL Compact Edition. 
&lt;p&gt;
I also ran into a problem when uninstalling this application. I would get the following
error when trying to reinstall it:&lt;br&gt;
&lt;pre&gt;&lt;code&gt; The upgrade patch cannot be installed by the Windows Installer service
because the program to be upgraded may be missing, or the upgrade path may update
a different version of the program. Verify that the program to be upgraded exists
on your computer and that you have the correct upgrade patch &lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
I finally did a Repair install on VS.NET, and I was able to install the tools again. 
&lt;p&gt;
However, even with all of that, I would recommend installing this because it allows
for things like Server Explorer to be used on SDF files. 
&lt;/p&gt;
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=85E0C3CE-3FA1-453A-8CE9-AF6CA20946C3&amp;amp;displaylang=en" target=_new&gt;Microsoft
SQL Server 2005 Compact Edition RC1&lt;/a&gt; - This installs MSSQL Compact Edition. Note
that there are numerous naming changes throughout the web (Mobile, Everywhere, Compact),
but Compact Edition is going to be the final answer - allegedly. 
&lt;li&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=83A52AF2-F524-4EC5-9155-717CBE5D25ED&amp;amp;displayLang=en" target=_new&gt;Windows
Mobile 5.0 SDK for Pocket PC&lt;/a&gt; - This install will give you some more power within
the IDE, e.g. it will bring up the Data Configuration Wizard to generate DataSets
when adding an SDF to your project. It also installs the latest version of Northwind.sdf
for you to play with. By default, it gets installed to C:\Program Files\Microsoft
Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\northwind.sdf. 
&lt;li&gt;
(Semi-optional) &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E6BC81E8-175B-46EA-86A0-C9DACAA84C85&amp;amp;displaylang=en" target=_new&gt;SQL
Server 2005 Compact Edition Books Online Community Technology Preview (CTP)&lt;/a&gt; -
Reference information is always good, right? 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Additional notes: 
&lt;ul&gt;
&lt;li&gt;
You can manage an SDF file from your desktop machine, by using Server Explorer within
VS.NET, or by selecting SQL Server Mobile as the Database Type in &lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2006/08/26/4272.aspx" target=_new&gt;SQL
Server Management Studio&lt;/a&gt;. On the PPC device, you can use QueryAnalyzer (located
at /Program Files/SQL Mobile/EN/isqlw30.exe), or open the sdf file on the PPC device. 
&lt;li&gt;
To deploy an SDF to the PPC, just add it to your solution and it will get deployed
to the PPC device automatically. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Good luck, and I hope this helps someone through the corn field maze that is CF and
MSSQL CE installation.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1658" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,1658.aspx</comments>
      <category>.NET</category>
      <category>Compact Framework</category>
    </item>
    <item>
      <trackback:ping>http://www.distribucon.com/blog/Trackback.aspx?guid=1655</trackback:ping>
      <pingback:server>http://www.distribucon.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.distribucon.com/blog/PermaLink,guid,1655.aspx</pingback:target>
      <dc:creator>Dan Miser</dc:creator>
      <wfw:comment>http://www.distribucon.com/blog/CommentView,guid,1655.aspx</wfw:comment>
      <wfw:commentRss>http://www.distribucon.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1655</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I've been working on a .NET Compact Framework
(CF) 2.0 application, and one thing that this applciation needed was access to a local
database on the PDA. In addition, I was hoping to leverage some of the MS Application
Blocks, specifically the Data Access Application Block, to make things easier and
more uniform for the developers. 
<p>
I came across a library that ported the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/daab.asp" target="_new">.NET
1.1 version of the Data Access Application Block</a> to CF: <a href="http://www.businessanyplace.net/?p=daabcf" target="_new">Data
Access Application Block for .NET CF</a>. It was pretty good, but there were several
things that needed fixing for my situation, namely: removal of OpenNetCF, upgrade
to .NET CF 2.0, upgrade to Windows Mobile 5.0, and upgrade of the Northwind.sdf database
to the latest version provided by Microsoft. 
</p><p><a href="http://www.distribucon.com/download/dotnet/daabcf2.zip" target="_new">Here</a> is
my port of the original work. I'll post updates (like upgrades to <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5A14E870-406B-4F2A-B723-97BA84AE80B5&amp;displaylang=en" target="_new">Enterprise
Library for .NET Framework 2.0, January 2006</a>) to the blog here, and my web site.
</p><img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1655" /></body>
      <title>Data Access Application Block, CF version</title>
      <guid isPermaLink="false">http://www.distribucon.com/blog/PermaLink,guid,1655.aspx</guid>
      <link>http://www.distribucon.com/blog/DataAccessApplicationBlockCFVersion.aspx</link>
      <pubDate>Wed, 06 Dec 2006 15:50:00 GMT</pubDate>
      <description>I've been working on a .NET Compact Framework (CF) 2.0 application, and one thing that this applciation needed was access to a local database on the PDA. In addition, I was hoping to leverage some of the MS Application Blocks, specifically the Data Access Application Block, to make things easier and more uniform for the developers. 
&lt;p&gt;
I came across a library that ported the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/daab.asp" target=_new&gt;.NET
1.1 version of the Data Access Application Block&lt;/a&gt; to CF: &lt;a href="http://www.businessanyplace.net/?p=daabcf" target=_new&gt;Data
Access Application Block for .NET CF&lt;/a&gt;. It was pretty good, but there were several
things that needed fixing for my situation, namely: removal of OpenNetCF, upgrade
to .NET CF 2.0, upgrade to Windows Mobile 5.0, and upgrade of the Northwind.sdf database
to the latest version provided by Microsoft. 
&lt;p&gt;
&lt;a href="http://www.distribucon.com/download/dotnet/daabcf2.zip" target=_new&gt;Here&lt;/a&gt; is
my port of the original work. I'll post updates (like upgrades to &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5A14E870-406B-4F2A-B723-97BA84AE80B5&amp;amp;displaylang=en" target=_new&gt;Enterprise
Library for .NET Framework 2.0, January 2006&lt;/a&gt;) to the blog here, and my web site.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.distribucon.com/blog/aggbug.ashx?id=1655" /&gt;</description>
      <comments>http://www.distribucon.com/blog/CommentView,guid,1655.aspx</comments>
      <category>ADO.NET</category>
      <category>Compact Framework</category>
    </item>
  </channel>
</rss>