<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Laxmi's Blog : Troubleshooting</title><link>http://blogs.msdn.com/laxmi/archive/tags/Troubleshooting/default.aspx</link><description>Tags: Troubleshooting</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SqlCeException on application's first use of SQL CE</title><link>http://blogs.msdn.com/laxmi/archive/2008/10/27/sqlceexception-on-application-s-first-use-of-sql-ce.aspx</link><pubDate>Mon, 27 Oct 2008 03:57:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9017297</guid><dc:creator>laxminro</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/laxmi/comments/9017297.aspx</comments><wfw:commentRss>http://blogs.msdn.com/laxmi/commentrss.aspx?PostID=9017297</wfw:commentRss><wfw:comment>http://blogs.msdn.com/laxmi/rsscomments.aspx?PostID=9017297</wfw:comment><description>&lt;p align="justify"&gt;We discussed how SQL CE get's into trouble of failing to load SQL CE DLLs in an earlier blog article &amp;quot;&lt;a target="_blank" href="http://blogs.msdn.com/sqlservercompact/archive/2007/10/26/troubleshooting-can-t-load-sqlce-dll.aspx"&gt;Can't load SQLCE DLL&lt;/a&gt;&amp;quot;.&amp;#160; As you can see this occurs when SQL CE is trying to load the native engine.&amp;#160; Note that, SQL CE delay loads the DLLs and hence the trouble.&amp;#160; Hence, we suggested in the earlier blog article to pre-load all required SQL CE DLLs so that you give chance to load SQL CE DLLs when there is memory.&amp;#160; &lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;This issue shows up on the following instances:&lt;/p&gt;  &lt;p align="justify"&gt;1) Application is trying to fill the datagrid using SqlCeDataAdapter.Fill (or DbDataAdapter.Fill)&lt;/p&gt;  &lt;p align="justify"&gt;2) Application is trying to do merge replication with the backend server using SqlCeReplication.Synchronize&lt;/p&gt;  &lt;p align="justify"&gt;3) Application is trying to perform RDA operations with the backedn server using SqlCeRemoteDataAccess.Pull, SqlCeRemoteDataAccess.Push, or SqlCeRemoteDataAccess.SubmitSQL&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;With that context, and coming to what is different from our earlier versions is being discussed in this article.&amp;#160; As said in the above articles, application developers are requested to pre-load SQL CE DLL.&amp;#160; If you have chosen to go with pre-load approach and did a LoadLibrary(&amp;quot;sqlcese30.dll&amp;quot;) earlier, then it requires a little change.&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;SQL CE v3.0 released before we moved onto desktop.&amp;#160; Once we moved to desktop (in addition to device) with SQL CE v3.1 release, lot of customers started developing applications that work both on device and desktop.&amp;#160; One of the differences our customers came back was the installation model.&amp;#160; On desktops, we install under %ProgramFiles%\Microsoft SQL Server Compact Edition\v3.1 and on device we install under \Windows\.&amp;#160; We worked on that feedback and unified our installation in SQL CE v3.5.&amp;#160; That is, with SQL CE v3.5 onwards you can see that we always install under Program Files irrespective of the platform.&amp;#160; However, at the same time we did not want our customers to hardcode the installation folders.&amp;#160; So, we unified our registry keys too.&amp;#160; With SQL CE v3.5 &lt;strong&gt;SP1&lt;/strong&gt;, you can use the registry key &amp;quot;HKLM\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\InstallDir&amp;quot; to find the install location.&amp;#160; &lt;/p&gt;  &lt;p align="justify"&gt;Now coming back to troubleshooting, earlier Load Library calls with out path qualification worked on devices as we were under \Windows and hence the path probe was successful.&amp;#160; Now with our unification, we moved to a non-standard path and hence path probe would have failed and so was your LoadLibrary.&amp;#160; Hence, we request application developers to update their code to read registry and then use Load Library with full path so that you never worry about our changing install locations.&amp;#160; We strongly recommend you to use the registry to find the installation location as sometimes we may need to be under (\Windows) especially when going IN-ROM hence registry is always realiable model than hardcoded installation path.&amp;#160; I agree that you are hardcoding registry path than directory path, but we guaranty that registry path remains static for a version,&amp;#160; but not installation folder.&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;Thanks,&lt;/p&gt;  &lt;p align="justify"&gt;Laxmi Narsimha Rao Oruganti&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9017297" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/laxmi/archive/tags/Compatibility/default.aspx">Compatibility</category><category domain="http://blogs.msdn.com/laxmi/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item></channel></rss>