SQL Server Compact ForumSQL Server Compact/Mobile Edition Technical Discussion© 2009 Microsoft Corporation. All rights reserved.Sun, 29 Nov 2009 19:23:07 Z2c3752d7-6550-4f74-85be-10395b003938http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/278f3f32-c75c-45f7-9f3e-3af97a7444b9http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/278f3f32-c75c-45f7-9f3e-3af97a7444b9JimDanDeehttp://social.msdn.microsoft.com/Profile/en-US/?user=JimDanDeeSQLCE Error while using UPDATE with WHERE PrimaryKey=<p>I have literally wasted 2 days of my life trying to find an answer to a problem that makes no sense to me. I'm receiving an error when I try to update a record in an SQLCE Database where the Primary Key (Identity) column is equal to a particular value.<br/><br/><strong>Here is the code I'm using:</strong><br/><br/>    Public Sub CloseRecordByKey(ByVal Key As Int32)<br/>        Dim conn As SqlCeConnection = Nothing<br/>        Dim cmd As SqlCeCommand = Nothing</p> <p>        Try<br/>            conn = New SqlCeConnection(My.Settings.Database1ConnectionString)<br/>            conn.Open()<br/>            cmd = New SqlCeCommand(&quot;UPDATE Entries Set TimeEnd=@p1 WHERE Key=@p2&quot;, conn)</p> <p>            Dim p1 As New SqlCeParameter(&quot;@p1&quot;, SqlDbType.DateTime, 8, &quot;TimeEnd&quot;)<br/>            p1.Value = Now<br/>            cmd.Parameters.Add(p1)</p> <p>            Dim p2 As New SqlCeParameter(&quot;@p2&quot;, SqlDbType.Int, 4, &quot;Key&quot;)<br/>            p2.Value = Key<br/>            cmd.Parameters.Add(p2)</p> <p>            cmd.Prepare()<br/>            cmd.ExecuteNonQuery() <strong><span style="text-decoration:underline">'THIS IS WHERE I GET THE ERROR<br/></span></strong>            cmd.Dispose()<br/>        Finally<br/>            conn.Close()<br/>        End Try<br/>    End Sub<br/><br/><strong>This is the error i received:<br/></strong>&quot;There was an error parsing the query. [ Token line number = 1,Token line offset = 38,Token in error = Key ]&quot;<br/><br/>Any help will be greatly appreciated.<br/>Thank you,<br/>Jim</p>Sun, 29 Nov 2009 00:12:11 Z2009-11-29T19:23:07Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/e5c32498-354e-4b75-9362-e55cd44afc26http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/e5c32498-354e-4b75-9362-e55cd44afc26stefancelmicsisfanthttp://social.msdn.microsoft.com/Profile/en-US/?user=stefancelmicsisfantcontent based image retrieval in sql server compacti want to give an image [jpeg] as an input to a query and retrieve yes if the image is in the db and not otherwise. is it possible to accomplish this using sql server compact? <div><br/></div> <div>thanks</div>Sun, 29 Nov 2009 15:55:28 Z2009-11-29T18:33:22Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/1ea3cf40-c5c1-4baf-8e9d-2f51e17e0e46http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/1ea3cf40-c5c1-4baf-8e9d-2f51e17e0e46John Burtonhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20BurtonUnable to load DLL 'sqlceme35.dll' - Vista 32 bit<font size=2><span style="font-family:Arial">The full message is </span></font><span id="_ctl0_MainContent_PostFlatView"><span class=forumName id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject">&quot;Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)&quot;<br><br>Various forums deal with this error and all solutions that I have seen say you should change the &quot;Any CPU&quot; to &quot;x86&quot; configuration because of a problem on 64 bit Windows systems.<br><br>But I am using a 32 bit Vista Home Premium system. I have MS Visual Studio Professional Edition (Education). Shortly after seeing the above message, VS </span></span><span id="_ctl0_MainContent_PostFlatView"><span class=forumName id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject">typically </span></span><span id="_ctl0_MainContent_PostFlatView"><span class=forumName id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject">crashes and restarts.<br><br>I have a &quot;Microsoft SQL Server Compact Edition&quot; folder in &quot;C:\Program Files\&quot; and of course </span></span><span id="_ctl0_MainContent_PostFlatView"><span class=forumName id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject">sqlceme35.dll is present</span></span> in the \v3.5\ folder.<br><span id="_ctl0_MainContent_PostFlatView"><span class=forumName id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject"><br>Any clues?<br></span></span>Tue, 24 Jun 2008 13:18:56 Z2009-11-27T21:53:33Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/8e113250-a5ba-4dfe-8354-e003ea2a5054http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/8e113250-a5ba-4dfe-8354-e003ea2a5054Kris Yoohttp://social.msdn.microsoft.com/Profile/en-US/?user=Kris%20YooCan i ask you something about how to use mdb file on wince 5.0 device??Hello.<br/><br/>I'm newbie on embedded development. <br/><br/>I'm working on wince 5.0 with Magic Eyes Board, MMSP2+,<br/><br/>I've been working seeing mdf file on wince 5.0 whole weeks. but still woking on it. <br/><br/>Even though i tried to search about mdb with wince, There's no  clear reference of mdb on internet.<br/><br/>taking up the main subject, as it were, <br/><br/>How can i open mdb file on wince 5.0?<br/><br/>If could not open mdb file, is it neeeded to convert mdb to like a cdb format?<br/><br/>In that case, are there any free conversion tool provided by microsoft? <br/><br/>If possible, can i read mdb file adding some module on platform build module in catalog? <br/><br/>I read i cannot access a .mdb file using any APIs on wincows CE. <br/><br/>here is the URL : <a href="http://www.pocketpcjunkies.com/Uwe/Forum.aspx/wince-vc/727/MDB-Operation">http://www.pocketpcjunkies.com/Uwe/Forum.aspx/wince-vc/727/MDB-Operation</a> <br/><br/>If that is true, no solution seeing mdf file on wince?<br/><br/>Any helps will be appreciate. thanks in advance <br/><br/><br/><br/><br/><br/><br/>Thu, 26 Nov 2009 11:16:24 Z2009-11-27T00:22:57Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/3fbded5b-1ab2-4c5b-9b03-803c35b2f04ahttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/3fbded5b-1ab2-4c5b-9b03-803c35b2f04aSanderbhttp://social.msdn.microsoft.com/Profile/en-US/?user=SanderbSQL Server Compact 3.5 SP1 Adding data to tableHello,<br/><br/>i'm adding data to the sql server compact edition database.  Everything when i add a row i call the commit function. But when suddely stop the application in visual studio with stop debugging the data is not stored in the database. The database is completed empty like it was before i started the application.  How come is that? When i let the program exit normal without press stop debugging the data is stored to the database.<br/><br/>gr,<br/><br/>SanderThu, 26 Nov 2009 18:11:21 Z2009-11-26T20:15:06Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cc738a71-ef52-4eb6-a8bc-bafe68a33a71http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cc738a71-ef52-4eb6-a8bc-bafe68a33a71Igor Kondrasovashttp://social.msdn.microsoft.com/Profile/en-US/?user=Igor%20KondrasovasGenerate DB from ScriptHello All,<br/><br/>After sucessfully generating a script for my sqlce db, using the great &quot;SQL Server Management Studio 2008 (Express) add-in &quot; from CodePlex, how can I create the database from this script.<br/><br/>I will do that at hte application initialisation, I'm looking for some sample code that creates the database and execute the commands on the script to generate all tabels, keys, etc.<br/><br/>Do I have no get every single instruction on the script and execute it one by one? In a single transaction?<br/><br/>Regards,<br/><br/>Igor<br/><hr class="sig">Project Manager at INOVATIVA Tecnologia www.inovativatec.comThu, 26 Nov 2009 13:40:12 Z2009-11-26T18:42:03Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/dc7617ad-a847-4cf1-9ab1-07ff757ffbbdhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/dc7617ad-a847-4cf1-9ab1-07ff757ffbbdSean Alford - Eagle Researchhttp://social.msdn.microsoft.com/Profile/en-US/?user=Sean%20Alford%20-%20Eagle%20ResearchSQL Server Compact Edition Device Deployment<p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Arial;font-size:x-small">We’re building a custom PC installation package to deploy our .NET Compact Framework 3.5 / SQL Server Compact Edition based application.  The installation package uses the <span style="font-size:x-small">System.Configuration.Install and calls <span style="font-size:x-small">Process.Start(ceAppPath, iniPath). </span></span>We are targeting ARM and x86 devices.<span style="">  </span>Specifically, which SQL Server Compact Edition cab files do we need to install/deploy for our application to run on the these device platforms?</span></p>Tue, 24 Nov 2009 16:27:22 Z2009-11-26T12:50:51Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c544acab-8761-43d7-a55b-87c684a525b5http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c544acab-8761-43d7-a55b-87c684a525b5Vishal_paihttp://social.msdn.microsoft.com/Profile/en-US/?user=Vishal_paiSQL CEI am new to SQL CE and C#.<br/><br/>I have two tables<br/>- Address<br/>- Customer<br/><br/>Customer table has a foreign key i.e. the AddressID which refers to the ID field of the address table.<br/><br/>What is the right way to:<br/>1. Generate ID for the address table. <br/>2. Insert the record in the address table.<br/>3. Get the ID of the record just inserted.<br/>4. Set this ID to the address field of the customer record.<br/>5. Insert the customer record into the database.<br/><br/>Assume that this is a console application.<br/><br/>Tue, 24 Nov 2009 16:07:37 Z2009-11-27T02:32:45Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/6bf8017c-fd89-41ee-a1f1-7002df18223ehttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/6bf8017c-fd89-41ee-a1f1-7002df18223eTomte123http://social.msdn.microsoft.com/Profile/en-US/?user=Tomte123SQL CE 3.5 as data source in Integration Services-project (BIDS)Hello,<br/> <br/> is there a way to use a SQL CE 3.5 SQL-database as a data flow source within an Integration Services-Project using Server Business Intelligence Studio 2008 and thus reducing a staging database? <br/> <br/> It is unbelievable that SQL Server Compact is currently only provided as a data flow destination-object.<br/> <br/> Kind regards,<br/> TomWed, 25 Nov 2009 11:26:00 Z2009-11-26T08:43:11Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/07fa25b6-8c30-491d-a7bf-76c6f675683ehttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/07fa25b6-8c30-491d-a7bf-76c6f675683eAmitGhttp://social.msdn.microsoft.com/Profile/en-US/?user=AmitGSQL Server Compact data source not available in VS 2005 but works in VS 2008Hi <div>I just downloaded and installed Sql Server Compact 3.5 (SSCERuntime-ENU-x86.msi). </div> <div><br/></div> <div>When I create a new application in VS2005 and try to add a new Data Source, I don't see &quot;Microsoft SQL Server Compact 3.5&quot; listed amongst the data sources. However, when I try this in VS2008 it does show. Is this not supposed to work with 2005?</div> <div><br/></div> <div>Thanks</div> <div>Amit</div>Wed, 25 Nov 2009 12:40:43 Z2009-11-25T13:30:25Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/68e3a4a5-f7df-4ab4-8aa3-d08a51d21ea4http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/68e3a4a5-f7df-4ab4-8aa3-d08a51d21ea4TheJacerhttp://social.msdn.microsoft.com/Profile/en-US/?user=TheJacerWhere to find sqlce35 and required dlls<p>I'm trying to find the sqlce35 cabs for installing the dlls.</p>Tue, 24 Nov 2009 19:53:58 Z2009-11-26T05:26:11Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/8edf712a-ee9e-4548-ba96-a5dded310473http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/8edf712a-ee9e-4548-ba96-a5dded310473JJChenhttp://social.msdn.microsoft.com/Profile/en-US/?user=JJChenSQL server 2008 compact edition: can we rename a sql table after saving it?We use SQL server 2008 compact edition. <br/>Is there a way we can rename the sql table after we save it?<br/>So far, in VS2008, we can not find a way to do it in the Server Explorer.<br/>thx!<br/>Tue, 24 Nov 2009 22:35:36 Z2009-11-26T06:11:13Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cceb0dbd-4e80-47ed-93bf-4033ff33da07http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cceb0dbd-4e80-47ed-93bf-4033ff33da07Sean Alford - Eagle Researchhttp://social.msdn.microsoft.com/Profile/en-US/?user=Sean%20Alford%20-%20Eagle%20ResearchSQL Server Compact Edition - Pocket PC - Unspecified Error<p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Arial;font-size:x-small">I’m getting an </span><span style="line-height:115%;font-family:'Courier New';font-size:8pt">&quot;Unspecified error&quot; </span><span style="font-size:x-small"><span style="font-family:Arial">when </span><span style="line-height:115%;font-family:'Courier New'">SqlCeConnection.Open is called on a Microsoft Pocket PC Version 4.20.0 (Build 14053) device.</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">I’ve tested this code on the following platforms and it works fine.</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">Microsoft Windows Mobile 5.0 OS 5.1.195 (Build 14928.2.2.0)</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">Microsoft Windows Mobile 6.1 Professional CE OS 5.2.19972 (Build 19972.1.2.7)</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">Microsoft Windows Mobile 6.1 Classic CE OS 5.2.19581 (Build 19581.1.1.1)</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">The problem child Microsoft Pocket PC Version 4.20.0 (Build 14053) device has the following components installed.</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">Microsoft .NET CF 3.5 EN-String Resource</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">Microsoft .NET CF 3.5</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">SQLServerComact 3.5 Core</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="line-height:115%;font-family:'Courier New'"><span style="font-size:x-small">The Unspecifid Error message is not all that helpful.<span>  </span>Any ideas?<br/><br/>NOTE: I'm using VS 2008 and I used InstallShield to deploy the .NET Framework 3.5 and SQL Server Compact Edition.<br/></span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Arial;font-size:x-small"><br/>Thanks,</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Arial;font-size:x-small">Sean</span></p>Tue, 24 Nov 2009 21:19:54 Z2009-11-26T06:02:58Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c7d37efb-4257-4048-b36e-cfeba199d846http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c7d37efb-4257-4048-b36e-cfeba199d846Nitramafvehttp://social.msdn.microsoft.com/Profile/en-US/?user=NitramafveSQL CE stopped to flush to disk?I'm bundling SQL CE 3.5 SP1 with an Windows application. The application has been installed in roughly 30000 locations. In one of these locations, it seems like SQL CE stopped flushing changes to disk and that the changes made to the database after that was made only in memory - and not on disk - resulting in loss of data.<br/> <br/> The user running the software reported the following:<br/> - The software had been up and running on a computer for 30 days.<br/> - Windows rebooted, due to an automatic install of a Windows update.<br/> - After the reboot, all changes he had made in the software the last 30 days were gone. The changes made prior to that were still there.<br/> - Several users at his location noticed this. The users access the database via a Windows service (my application). Among other things, the database contains username/password hashes. Several users noticed that the password were reverted to old values, and that the information they had stored the last 30 days were was lost. The problem seems to affect all users in the installation (&gt;10).<br/> <br/> Entries made to the Windows Event log the last 30 days is still there. At first, I was guessing that maybe the entire partition on the hard drive was restored from backup / restore point / whatever but apparently this does not seem to be the case. The logs from my application for the last 30 days is still available as well. My application has an application log which records all application events and errors, and no errors were reported from SQL CE at the time the problem started to occur (when the flush'ing stopped). <br/> <br/> The next thing I thought was that he had restored a backup of the database. But apparently, the company had not set up backup routines for the database so this wasn't the issue either. <br/> <br/> The connection string I'm using is as follows:<br/> <br/> <em>Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=%s;SSCE:Database Password=%s;SSCE:Max Database Size=4000;SSCE:Flush Interval=10;</em> <br/> <br/> I have a few questions:<br/> <br/> <ul> <li>Of course, is this a known issue? I'm guessing not, since I haven't found any info on it.</li> <li>I assume SQL CE has a background thread running which flushes the changes to disk. What happens if this thread dies for any reason? Will the thread terminate the process?</li> <li>If the background thread has problems writing to the disk, for instance due to hardware or driver problems, what will happen? Since it's a background thread, the only reasonable thing I can think of is that SQL CE terminates the process.</li> </ul>Fri, 20 Nov 2009 17:01:55 Z2009-11-24T18:49:36Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/4a11e0e1-0366-4a93-8648-2b7c11772d89http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/4a11e0e1-0366-4a93-8648-2b7c11772d89Stevebob55http://social.msdn.microsoft.com/Profile/en-US/?user=Stevebob55Getting an access not allowed message when trying to create a DB connection to the Northwind DB in VB Studio 2008<p align=left><font face=Arial size=2>I recently installed VB Studio Express 2008, which also installed SQL Server Compact Edition.  I was going thro the online tutorial from Microsoft, which tells you to create a connection to the Northwind DB.  But, when I tried to connect, I get an error message saying access is not allowed.  Note that the is running under Vista Home Premium.  I have tried searching for an answer to this question, but have not found an answer that solves my problem.  The closest was a similar problem for a C# application running in Internet Explorer, and the answer for that one was to change security settings in IE.  But, for this demo, IE was not involved.</font></p>Mon, 04 Feb 2008 04:50:31 Z2009-11-24T15:10:38Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/a7d463ff-eae5-4b9b-8c38-518391d59d6chttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/a7d463ff-eae5-4b9b-8c38-518391d59d6cSanderbhttp://social.msdn.microsoft.com/Profile/en-US/?user=SanderbQuery problemHello,<br/><br/>I have query that i can't write in Sql CE. The  SQL CE contains around 30.000 rows. It gives the error that it can't do a group by on ntext or image columns (and i need the columns in the result): <br/><br/>SELECT TSA.sa_id,TSA.&quot;priceout__price&quot;, TSA.&quot;priceout__price2&quot;, TSA.&quot;desc__title&quot;, TSA.&quot;desc__title2&quot;, TSA.&quot;worddoc__typeid&quot;, TSA.&quot;worddoc__typeid2&quot;, TSA.&quot;salenote__staffel&quot;, TSA.&quot;salenote__staffel2&quot;, TSA.&quot;webinfo__productcontent&quot;, TSA.&quot;webinfo__productcontent2&quot;, TSA.&quot;lpicture__imagesmall&quot;, TSA.&quot;lpicture__imagesmall2&quot;, TSA.&quot;picture__image&quot;, TSA.&quot;picture__image2&quot;, TSA.&quot;inactive{showgbaweb__hide&quot;, TSA.&quot;inactive{showgbaweb__hide2&quot;, TSA.&quot;pk_prodid__productid&quot;, TSA.&quot;pk_prodid__productid2&quot;, TSA.&quot;prodid__number&quot;, TSA.&quot;prodid__number2&quot;, COUNT(T1.&quot;pk_prodid__productid&quot;) AS pk_prodid__productid_CNT, COUNT(T2.&quot;pk_prodid__productid2&quot;) AS pk_prodid__productid2_CNT  <br/>FROM SA TSA  <br/>INNER JOIN SA T1 ON T1.&quot;pk_prodid__productid&quot; = TSA.&quot;pk_prodid__productid&quot; <br/>INNER JOIN SA T2 ON T2.&quot;pk_prodid__productid2&quot; = TSA.&quot;pk_prodid__productid2&quot; <br/>GROUP BY TSA.sa_id,TSA.&quot;priceout__price&quot;, TSA.&quot;priceout__price2&quot;, TSA.&quot;desc__title&quot;, TSA.&quot;desc__title2&quot;, TSA.&quot;worddoc__typeid&quot;, TSA.&quot;worddoc__typeid2&quot;, TSA.&quot;salenote__staffel&quot;, TSA.&quot;salenote__staffel2&quot;, TSA.&quot;webinfo__productcontent&quot;, TSA.&quot;webinfo__productcontent2&quot;, TSA.&quot;lpicture__imagesmall&quot;, TSA.&quot;lpicture__imagesmall2&quot;, TSA.&quot;picture__image&quot;, TSA.&quot;picture__image2&quot;, TSA.&quot;inactive{showgbaweb__hide&quot;, TSA.&quot;inactive{showgbaweb__hide2&quot;, TSA.&quot;pk_prodid__productid&quot;, TSA.&quot;pk_prodid__productid2&quot;, TSA.&quot;prodid__number&quot;, TSA.&quot;prodid__number2&quot;, T1.&quot;pk_prodid__productid&quot;, T2.&quot;pk_prodid__productid2&quot;<br/>ORDER BY TSA.SA_ID<br/><br/><br/><br/>Well i rewriten the query to but it takes more then 10 minues to execute the query:<br/><br/>SELECT TSA.sa_id,TSA.&quot;priceout__price&quot;, TSA.&quot;priceout__price2&quot;, TSA.&quot;desc__title&quot;, TSA.&quot;desc__title2&quot;, TSA.&quot;worddoc__typeid&quot;, TSA.&quot;worddoc__typeid2&quot;, TSA.&quot;salenote__staffel&quot;, TSA.&quot;salenote__staffel2&quot;, TSA.&quot;webinfo__productcontent&quot;, TSA.&quot;webinfo__productcontent2&quot;, TSA.&quot;lpicture__imagesmall&quot;, TSA.&quot;lpicture__imagesmall2&quot;, TSA.&quot;picture__image&quot;, TSA.&quot;picture__image2&quot;, TSA.&quot;inactive{showgbaweb__hide&quot;, TSA.&quot;inactive{showgbaweb__hide2&quot;, TSA.&quot;pk_prodid__productid&quot;, TSA.&quot;pk_prodid__productid2&quot;, TSA.&quot;prodid__number&quot;, TSA.&quot;prodid__number2&quot;, &quot;pk_prodid__productid_CNT&quot;, &quot;pk_prodid__productid2_CNT&quot;  <br/>FROM SA TSA  <br/>INNER JOIN (SELECT &quot;pk_prodid__productid&quot;, COUNT(&quot;pk_prodid__productid&quot;) AS &quot;pk_prodid__productid_CNT&quot; FROM SA T1 GROUP BY &quot;pk_prodid__productid&quot;) <br/>T1 ON T1.&quot;pk_prodid__productid&quot; = TSA.&quot;pk_prodid__productid&quot; <br/>INNER JOIN (SELECT &quot;pk_prodid__productid2&quot;, COUNT(&quot;pk_prodid__productid&quot;) AS &quot;pk_prodid__productid2_CNT&quot; FROM SA T2 GROUP BY &quot;pk_prodid__productid2&quot;) <br/>T2 ON T2.&quot;pk_prodid__productid2&quot; = TSA.&quot;pk_prodid__productid2&quot; <br/>ORDER BY TSA.SA_ID<br/><br/>Can somebody help me out?Sat, 21 Nov 2009 11:04:59 Z2009-11-24T12:23:58Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/4be43c76-b820-4961-8ed0-c71c17461bb9http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/4be43c76-b820-4961-8ed0-c71c17461bb9DigitalFusionhttp://social.msdn.microsoft.com/Profile/en-US/?user=DigitalFusionPrepare: CommandText property has not been initialized<font size=2><span style="font-family:Arial">I have a form that I drug a &quot;details&quot; list into from the data sources pane.  When I click the save button I get that non-descript error and I cannot figure out why.<br><br>    Private Sub ButtonSaveUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveUser.Click<br>        Me.Validate()<br>        Me.UsersBindingSource.EndEdit()<br>        Me.UsersTableAdapter.Update(Me.UsersDS.Users)<br>    End Sub<br></span></font>Mon, 27 Oct 2008 16:50:52 Z2009-11-24T11:17:02Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/bfff5f80-0e81-4bdd-81b5-f73eb8b2b66dhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/bfff5f80-0e81-4bdd-81b5-f73eb8b2b66dManshy51http://social.msdn.microsoft.com/Profile/en-US/?user=Manshy51OLEDB Perormance problems with SQL CEHi Everybody,<br/><br/>I am acing big problem and i will appreciate if any one could help me. I am developing MFC smart device application which i need to retreive a huge number of records from sql ce database.<br/>I have made sample application to test data access performance of OLEDB then something wired happens.<br/>I am looping on table in my database to read all records from this table(5000 records)<br/> <pre lang=x-cpp>CString wGetStmt = L&quot;Select * From HH_Item&quot;; CDatabaseConnection * db = getDB(); db-&gt;Close(); if(db != NULL) { for(int i=0; i&lt;147; i++) { CString LogString; LogString.Format(_T(&quot;\\Storage card\\LogFiles\\%i.txt&quot;),i); CMessageLogger* Logger = new CMessageLogger(LogString); db-&gt;ReOpen(); CERecordset* rs = db-&gt;ExecSql(wGetStmt); int noFields = rs-&gt;GetFieldCount()-5; int counter = 0; while(!rs-&gt;IsEOF()) { counter++; for(int j=0;j&lt; noFields; j++) { s = rs-&gt;GetFieldValueString(j); } rs-&gt;MoveNext(); } rs-&gt;Close(); db-&gt;Close(); if(rs != NULL) { delete rs ; rs = NULL ; } if(Logger) { delete Logger; Logger = NULL; } } } db-&gt;Close(); </pre> The strange thing that happens is that some loops finish in 3 min and other loops takes 10 min (which is extremly long time).<br/><br/>The Code I used for CRecordSet Class is <br/> <pre lang=x-cpp>CERecordset::CERecordset(IDBCreateSession *pIDBCreateSession) { COLUMN_ALIGNVAL = 8; VariantInit(&amp;rowsetprop[0].vValue); m_pIDBCreateSession = pIDBCreateSession; HRESULT hr; if (NULL == m_pIDBCreateSession) { hr = E_POINTER; } // Create a session object hr = m_pIDBCreateSession-&gt;CreateSession(NULL, IID_IOpenRowset, (IUnknown**) &amp;pIOpenRowset); } CERecordset::~CERecordset() { VariantClear(&amp;rowsetprop[0].vValue); if (prgBinding) { CoTaskMemFree(prgBinding); delete [] prgBinding; prgBinding = NULL; } if (pDBColumnInfo) { CoTaskMemFree(pDBColumnInfo); delete [] pDBColumnInfo; pDBColumnInfo = NULL; } if (pStringsBuffer) { CoTaskMemFree(pStringsBuffer); delete [] pStringsBuffer; pStringsBuffer = NULL; } if (pData) { CoTaskMemFree(pData); delete pData; pData = NULL; } if(pIAccessor) { pIAccessor-&gt;ReleaseAccessor(hAccessor, NULL); pIAccessor-&gt;Release(); delete pIAccessor; pIAccessor = NULL; } if (pIColumnsInfo) { pIColumnsInfo-&gt;Release(); delete pIColumnsInfo; pIColumnsInfo = NULL; } if(pIRowset) { pIRowset-&gt;Release(); delete pIRowset; pIRowset = NULL; } if(pIOpenRowset) { pIOpenRowset-&gt;Release(); delete pIOpenRowset; pIOpenRowset = NULL; } } BOOL CERecordset::Close() { ulNumCols = 0 ; VariantClear(&amp;rowsetprop[0].vValue); if (prgBinding) { CoTaskMemFree(prgBinding); delete [] prgBinding; prgBinding = NULL; } if (pDBColumnInfo) { CoTaskMemFree(pDBColumnInfo); delete []pDBColumnInfo; pDBColumnInfo = NULL; } if (pStringsBuffer) { CoTaskMemFree(pStringsBuffer); delete [] pStringsBuffer; pStringsBuffer = NULL; } if (pData) { CoTaskMemFree(pData); //delete pData; pData = NULL; } if (pIAccessor) { if (hAccessor) pIAccessor-&gt;ReleaseAccessor(hAccessor, NULL) ; pIAccessor-&gt;Release() ; delete pIAccessor; pIAccessor = NULL ; } if (pIColumnsInfo) { pIColumnsInfo-&gt;Release(); delete pIColumnsInfo; pIColumnsInfo = NULL; } if (prghRows) { if (*prghRows) pIRowset-&gt;ReleaseRows(cRowsObtained, prghRows, NULL, NULL, NULL) ; } if (pIRowset) { pIRowset-&gt;Release() ; delete pIRowset; pIRowset = NULL ; } if(pIOpenRowset) { pIOpenRowset-&gt;Release(); delete pIOpenRowset; pIOpenRowset = NULL; } m_fIsOpen = false; return TRUE; } BOOL CERecordset::IsBOF() { return m_BOF; } BOOL CERecordset::IsEOF() { if(m_fIsOpen) { HRESULT hr = pIRowset-&gt;GetNextRows(DB_NULL_HCHAPTER, 0, 1, &amp;cRowsObtained, &amp;prghRows); if(DB_S_ENDOFROWSET == hr) return TRUE; else return FALSE; } else return FALSE; } BOOL CERecordset::MoveNext() { HRESULT hr = pIRowset-&gt;ReleaseRows(1, prghRows, NULL, NULL, NULL); if(FAILED(hr)) { return FALSE; } // Fetches next row. hr = pIRowset-&gt;GetNextRows(DB_NULL_HCHAPTER, 0, 1, &amp;cRowsObtained, &amp;prghRows); return TRUE; } LPCTSTR CERecordset::GetFieldName(int iField) { if(m_fIsOpen) { return (LPCTSTR)(pStringsBuffer[iField]); } return NULL; } LPCTSTR CERecordset::GetFieldValueString(int iField) { memset(pData, 0, dwOffset); // Fetch actual data HRESULT hr = pIRowset-&gt;GetData(prghRows[0], hAccessor, pData); // If return a null value, ignore the contents of the value and length parts of the buffer. // if (DBSTATUS_S_ISNULL != *(DBSTATUS *)(pData+prgBinding[iField].obStatus)) { return (WCHAR*)(pData+prgBinding[iField].obValue); } return NULL; } BOOL CERecordset::Delete() { if(!m_fIsOpen) { return FALSE; } HRESULT hr; hr = pIRowset-&gt;ReleaseRows(1, prghRows, NULL, NULL, NULL); return !FAILED(hr); } BOOL CERecordset::Update() { HRESULT hr = pIRowset-&gt;QueryInterface(IID_IColumnsInfo, (void **)&amp;pIColumnsInfo); if(FAILED(hr)) { goto Exit; } // Get the column metadata // if (pDBColumnInfo) { CoTaskMemFree(pDBColumnInfo); pDBColumnInfo = NULL; } hr = pIColumnsInfo-&gt;GetColumnInfo(&amp;ulNumCols, &amp;pDBColumnInfo, &amp;pStringsBuffer); if(FAILED(hr) || 0 == ulNumCols) { goto Exit; } WCHAR** pwszEmployees = new WCHAR*[ulNumCols]; for(int i=0; i &lt; ulNumCols; i++) { pwszEmployees[i] = pDBColumnInfo[i].pwszName; } // Create a DBBINDING array. // // dwBindingSize = sizeof(pwszEmployees)/sizeof(pwszEmployees[0]); dwBindingSize = ulNumCols; prgBinding = (DBBINDING*)CoTaskMemAlloc(sizeof(DBBINDING)*dwBindingSize); if (NULL == prgBinding) { hr = E_OUTOFMEMORY; goto Exit; } // Set initial offset for binding position // dwOffset = 0; // Prepare structures to create the accessor // for (dwIndex = 0; dwIndex &lt; dwBindingSize; ++dwIndex) { if (!GetColumnOrdinal(pwszEmployees[dwIndex], &amp;dwOrdinal)) { hr = E_FAIL; goto Exit; } prgBinding[dwIndex].iOrdinal = dwOrdinal; prgBinding[dwIndex].dwPart = DBPART_VALUE | DBPART_STATUS | DBPART_LENGTH; prgBinding[dwIndex].obLength = dwOffset; prgBinding[dwIndex].obStatus = prgBinding[dwIndex].obLength + sizeof(ULONG); prgBinding[dwIndex].obValue = prgBinding[dwIndex].obStatus + sizeof(DBSTATUS); prgBinding[dwIndex].wType = pDBColumnInfo[dwIndex].wType; prgBinding[dwIndex].pTypeInfo = NULL; prgBinding[dwIndex].pObject = NULL; prgBinding[dwIndex].pBindExt = NULL; prgBinding[dwIndex].dwMemOwner = DBMEMOWNER_CLIENTOWNED; prgBinding[dwIndex].dwFlags = 0; prgBinding[dwIndex].bPrecision = pDBColumnInfo[dwOrdinal].bPrecision; prgBinding[dwIndex].bScale = pDBColumnInfo[dwOrdinal].bScale; switch(prgBinding[dwIndex].wType) { case DBTYPE_WSTR: prgBinding[dwIndex].cbMaxLen = sizeof(WCHAR)*(pDBColumnInfo[dwOrdinal].ulColumnSize + 1); // Extra buffer for null terminator break; default: prgBinding[dwIndex].cbMaxLen = pDBColumnInfo[dwOrdinal].ulColumnSize; break; } // Calculate the offset, and properly align it // dwOffset = prgBinding[dwIndex].obValue + prgBinding[dwIndex].cbMaxLen; dwOffset = ROUND_UP(dwOffset, COLUMN_ALIGNVAL); } // Get IAccessor // hr = pIRowset-&gt;QueryInterface(IID_IAccessor, (void**)&amp;pIAccessor); if(FAILED(hr)) { goto Exit; } // Create the accessor // hr = pIAccessor-&gt;CreateAccessor(DBACCESSOR_ROWDATA, dwBindingSize, prgBinding, 0, &amp;hAccessor, NULL); if(FAILED(hr)) { goto Exit; } pData = (BYTE*)CoTaskMemAlloc(dwOffset); if (NULL == pData) { hr = E_OUTOFMEMORY; goto Exit; } m_fIsOpen = true; return true ; Exit: // Clear Variants // VariantClear(&amp;rowsetprop[0].vValue); // Free allocated DBBinding memory // if (prgBinding) { CoTaskMemFree(prgBinding); prgBinding = NULL; } // Free allocated column info memory // if (pDBColumnInfo) { CoTaskMemFree(pDBColumnInfo); pDBColumnInfo = NULL; } // Free allocated column string values buffer // if (pStringsBuffer) { CoTaskMemFree(pStringsBuffer); pStringsBuffer = NULL; } // Free data record buffer // if (pData) { CoTaskMemFree(pData); pData = NULL; } // Release interfaces // if(pIAccessor) { pIAccessor-&gt;ReleaseAccessor(hAccessor, NULL); pIAccessor-&gt;Release(); } if (pIColumnsInfo) { pIColumnsInfo-&gt;Release(); } if(pIRowset) { pIRowset-&gt;Release(); } if(pIOpenRowset) { pIOpenRowset-&gt;Release(); } m_fIsOpen = false; return m_fIsOpen; } BOOL CERecordset::GetColumnOrdinal( WCHAR* pwszColName, DWORD* pOrdinal) { for(DWORD dwCol = 0; dwCol&lt; ulNumCols; ++dwCol) { if(NULL != pDBColumnInfo[dwCol].pwszName) { if(0 == _wcsicmp(pDBColumnInfo[dwCol].pwszName, pwszColName)) { *pOrdinal = pDBColumnInfo[dwCol].iOrdinal; return TRUE; } } } return FALSE; }</pre> so can anybody helps me to know what i am doing wrong. I really need to increase the perormance and thats why i am using OLEDB.<br/><br/>Thanks in advaceTue, 24 Nov 2009 08:45:56 Z2009-11-25T09:52:32Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/513320ab-1a1c-489e-a599-a934388a8426http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/513320ab-1a1c-489e-a599-a934388a8426steven ellishttp://social.msdn.microsoft.com/Profile/en-US/?user=steven%20ellisSQL Server Compact recreates the indexes on PPC device<span style="font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:#333333;line-height:16px">SQL Server Compact recreates the indexes on PPC device since the NLS version of Vista and PPC are different on first connection.  Has this been resolved in 3.5 SP2? If not, is there any work around?</span> <div><span style="font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:#333333;line-height:16px"><br/></span></div> <div><span style="font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:#333333;line-height:16px">Best, </span></div> <div><span style="font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:#333333;line-height:16px">Steven Ellis</span></div>Mon, 23 Nov 2009 22:31:17 Z2009-11-25T07:59:21Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/e64d6a02-7e5b-47e4-b6bb-94c346d5034chttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/e64d6a02-7e5b-47e4-b6bb-94c346d5034cTpa Programmerhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tpa%20ProgrammerThere was an error parsing the queryI'm attempting to insert string data into SQL Server Compact Edition 3.5 from a .NET 3.5 C# application using SqlCeConnection, SqlCeCommand, and SqlCeParameter objects.  I've followed the steps outlined by numerous examples and posts I've seen online, but nothing seems to work.  Below is a snippet of code:<br/>  string strSQL = &quot;INSERT INTO Clients(LastName, FirstName) &quot; +<br/>                         &quot;VALUES(@LastName, @FirstName)&quot;;<br/>  cmd.CommandType = CommandType.Text;<br/>  cmd.CommandText = strSQL;<br/>  SqlCeParameter paramLN = new SqlCeParameter(&quot;@LastName&quot;, SqlDbType.NVarChar, 60, &quot;LastName&quot;);<br/>  paramLN.Value = this.mLastName;  //NOTE: this.mLastName.Replace(&quot;'&quot;, &quot;''&quot;) does NOT work!<br/>  cmd.Parameters.Add(paramLN);<br/>  //FirstName<br/>  SqlCeParameter paramFN = new SqlCeParameter(&quot;@FirstName&quot;, SqlDbType.NVarChar, 40, &quot;FirstName&quot;);<br/>  paramFN.Value = this.mFirstName;<br/>  cmd.Parameters.Add(paramFN);<br/>  //Prepare the command<br/>  cmd.Prepare();<br/>  // INSERT Client Data<br/>  cmd.ExecuteNonQuery();<br/><br/>What am I missing?<br/>Mon, 23 Nov 2009 23:35:28 Z2009-11-25T08:36:27Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/88f72d8f-20c0-4f8e-82fb-8a4a7c18b584http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/88f72d8f-20c0-4f8e-82fb-8a4a7c18b584Makeithttp://social.msdn.microsoft.com/Profile/en-US/?user=MakeitIs it possible to use a class derived from CAccessor to bind columns in .sdf file?<p>Hi. (I don't know english well. Please consider it. Thanks.)</p> <p>I just want to use my old codes of MDB accessed in native C++.<br/>But when I tried to use that code just with change of the connection string, I got an error message something like below.</p> <p>____________________________________________________________________________<br/>(with dbpropset)<br/>OLE DB Error Record dump for hr = 0x80040e21<br/>_CrtDbgReport: String too long or IO ErrorOLE DB Error Record dump end</p> <p>(w/o dbpropset)<br/>Binding entry 12 failed. Status: 2<br/>OLE DB Error Record dump for hr = 0x80040e21<br/>Row #:    0 Source: &quot;Microsoft SQL Server Compact OLE DB Provider&quot; Description: &quot;Errors occurred. [,,,,,]&quot; Help File: &quot;(null)&quot; Help Context:    0 GUID: {0C733A8C-2A1C-11CE-ADE5-00AA0044773D}<br/>OLE DB Error Record dump end<br/>----------------------------------------------------------------------------------------------------------</p> <p>So I use a CDynamicAccessor class instead of CAccessor derived class, and I got the data. But it is too difficult and code is too long to get the data.<br/>Is there an easy way to get the data? (I want to use CAccessor derived class if possible.)</p> <p>Thanks.</p> <p> </p> <p>Here's my code.<br/>-------------------<br/> CString strConnectionString = _T(&quot;Provider = Microsoft.SQLSERVER.CE.OLEDB.3.5; Data Source = D:\\Temp\\SQLCE_Test\\test.sdf&quot;);<br/> CDataSource ds;<br/> HRESULT hr = ds.OpenFromInitializationString( strConnectionString );<br/> if ( SUCCEEDED( hr ) )<br/> {<br/>  CSession session;<br/>  if ( SUCCEEDED( session.Open( ds ) ) )<br/>  {<br/>    CDBPropSet dbPropSet( DBPROPSET_ROWSET );<br/>    dbPropSet.AddProperty( DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL );<br/>    dbPropSet.AddProperty( DBPROP_CANSCROLLBACKWARDS, true, DBPROPOPTIONS_OPTIONAL );<br/>    //dbPropSet.AddProperty( DBPROP_IRowsetChange,  true, DBPROPOPTIONS_OPTIONAL );<br/>    dbPropSet.AddProperty( DBPROP_UPDATABILITY,   DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );</p> <p>    CLucionDBv1_StudyTable table;<br/>    //hr = table.Open( session, NULL, &amp;dbPropSet );<br/>    hr = table.Open( session, NULL, NULL );<br/>    if ( SUCCEEDED( hr ) )<br/>    {<br/>     table.Close();<br/>    }<br/>    else<br/>    {<br/>     AtlTraceErrorRecords( hr );<br/>    }<br/>   }<br/>  }<br/> }</p>Tue, 24 Nov 2009 00:15:41 Z2009-11-25T08:37:34Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/6fe369ff-752c-46b3-b893-164baab01069http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/6fe369ff-752c-46b3-b893-164baab01069GoRoutehttp://social.msdn.microsoft.com/Profile/en-US/?user=GoRouteUsing SQL server compact edition 3.0 with Sql server 2008Is is possible to use sqlce 3.0 with sql server 2008?  For example, would it be possible to install the sqlce 3.0 server tools on top of sql 2008 3.5 install in order to synchronize the handheld application?  Upgrading all of the handheld apps in the field to 3.5 would be a very costly expense for my customers and I was wondering if there is a way to phase it in.  Most of the handhelds in the field come with sqlece 3.0 pre installed and it does make sense to install 3.5 on top of that.  Any experience or suggestions would be appreciated. Mon, 23 Nov 2009 18:59:40 Z2009-11-25T07:05:53Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/974677ac-3af3-4235-8159-57f9e0b447a5http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/974677ac-3af3-4235-8159-57f9e0b447a5BENNNNNNhttp://social.msdn.microsoft.com/Profile/en-US/?user=BENNNNNNCompact Edition .NET application instal error on Vista (works on XP pro)<span style="font-size:10pt;font-family:'Verdana','sans-serif'"> <p>Question what is the best way to use and install Compact Edition accross Windows Vista, XP and 7?<br/><br/>These are the files I install with the program so that the user will not be required to install SQL server Compact Edition 3.5<br/><span lang=EN></span><br/><br/>Application was developed on Microsoft .NET Framework 3.5 SP1 (Visual Studio 2008 Pro Edition Version 9.0.21022.9 RTM)<br/>My connection and location code is this:<br/>My.Settings.MyConnectionString = Data Source=|DataDirectory|\My.sdf;Password=MyPassword;Persist Security Info=True;mode='Read Write'</p> <p>sqlceca35.dll</p> <p>sqlcecompact35.dll</p> <p>sqlceer35EN.dll</p> <p>sqlceme35.dll</p> <p>sqlceoledb35.dll</p> <p>sqlceqp35.dll</p> <p>sqlcese35.dll</p> <p>My.Settings.MyConnectionStringAlt = Data Source=AltDirectory\My.sdf;Password=MyPassword;Persist Security Info=True;mode='Read Write'</p> <pre>Imports System.Data Imports System.Data.Common Imports System.Data.SqlServerCe Imports System.IO Imports System.Deployment.Application Private _connection As SqlCeConnection ' I do this because when my application changes without changes to the database then the Compact Edition doesn't copy over Private Sub setupConnection() _connection = New SqlCeConnection _connection.ConnectionString = My.Settings.MyConnectionString.ToString() If Not System.IO.File.Exists(_connection.Database) Then Dim DataDirectory As String = AppDomain.CurrentDomain.GetData(&quot;DataDirectory&quot;).ToString Dim NewDataDirectory = DataDirectory + &quot;History&quot; Dim AltSetting As String = My.Settings.MyConnectionStringAlt Dim NewConnectionString As String = Replace(AltSetting, &quot;AltDirectory&quot;, NewDataDirectory) _connection.ConnectionString = NewConnectionString Try System.IO.File.Copy(_connection.Database, DataDirectory + &quot;\My.sdf&quot;) Catch ex As Exception End Try End If End Sub </pre> <p>Error Details:<br/>Error in System.Data.SqlServerCe.dll<br/>An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)<br/>Exception.Type: System.BadImageFormatException<br/>Exception Source: System.Data.SqlServerCe<br/>Declaring Type: System.Data.SqlServerCe.NativeMethods<br/>Method: Int32 DllAddRef()<br/>Stack Trace:    at System.Data.SqlServerCe.NativeMethods.DllAddRef()</p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:10pt;font-family:'Verdana','sans-serif'">Operating System: Microsoft® Windows Vista™ Home Premium <br/>Operating System Platform: Win32NT<br/>OS Version: 6.0.6001.65536</span><span style=""></span></p> <br/></span><hr class="sig">BMon, 23 Nov 2009 15:25:22 Z2009-11-25T05:44:28Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f5d61aa2-6aae-4c58-be48-b3dc3eaaf0afhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f5d61aa2-6aae-4c58-be48-b3dc3eaaf0afPCPamhttp://social.msdn.microsoft.com/Profile/en-US/?user=PCPamError MessageHow do I prevent the error message from continuously popping up on my computer?<br/><strong><span style="font-size:x-small;font-family:Arial">&quot;Windows Search.exe - unable to locate component. This application has failed to start because uncdms.dll was not found. Re-installing the application may fix the problem.&quot;</span></strong>Mon, 23 Nov 2009 16:11:22 Z2009-11-23T16:16:50Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/54d2fbbf-66fd-48c0-96e0-35e79f09a4f5http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/54d2fbbf-66fd-48c0-96e0-35e79f09a4f5Trysthttp://social.msdn.microsoft.com/Profile/en-US/?user=TrystDetermining if a SqlCeDataReader has returned data from a SELECT statementHi all,<br><br>is there no a way to determine if a <span style="font-weight:bold">SqlCeDataReader </span>has managed to return data (rows) from an executed SQL SELECT statement? I ask this because I have the following problem where I first need to determine if data (rows) are returned, if so, cycle through them and get the data out. But if I do the test to determine if data is returned (like I have in my code below) then the <span style="font-weight:bold">Reader.Read()</span> is classed as reading a row, so when I do my '<span style="font-weight:bold">while (Reader.Read())</span>' this will then only work with data in the 2nd row.<br><br style="font-weight:bold"><span style="font-weight:bold">if (Reader.Read())</span><br style="font-weight:bold"><span style="font-weight:bold">{</span><br style="font-weight:bold"><span style="font-weight:bold">    while (Reader.Read())</span><br style="font-weight:bold"><span style="font-weight:bold">    {</span><br style="font-weight:bold"><span style="font-weight:bold">        //Get data from rows</span><br style="font-weight:bold"><span style="font-weight:bold">    }</span><br style="font-weight:bold"><span style="font-weight:bold">}</span><br><br>I recall having this issue before as there doesn't seem to be a standard way of testing for data returned from a SELECT statement. I hope you can shed some light on this for me.<br><br>Thanks<br>Tue, 26 Sep 2006 17:52:48 Z2009-11-23T09:34:30Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c9105e2f-2cc9-406e-bf57-7ec3fa9af22dhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/c9105e2f-2cc9-406e-bf57-7ec3fa9af22dMikeGalehttp://social.msdn.microsoft.com/Profile/en-US/?user=MikeGaleUsing Sql CE with a tool that uses dbo.TableName in the generated code<p>I'm using SQL CE to test an application that will be deployed on SQL Server. (CE is very useful for that.)</p> <p>I was originally using LinqToEntityFramework in the project but dropped that in favour of LinqToSQL (the older technology).</p> <p>During test I'm getting Table does not exist exceptions because the generated code using the dbo.TableName syntax.</p> <p>I can fix that in test by altering the generated code and everything just works.</p> <p>I guess others have faced this issue.</p> <p>What strategies work for you to use both CE and a production SQL Server database with the same code base?</p>Fri, 21 Aug 2009 00:50:22 Z2009-11-23T04:30:00Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/3ea5940a-5ac4-4e15-b428-b7113da85f8bhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/3ea5940a-5ac4-4e15-b428-b7113da85f8begmkang.wanghttp://social.msdn.microsoft.com/Profile/en-US/?user=egmkang.wangSqlCeCommand.Dispose() ErrorMy application use SQL CE  3.5(in the Visual  Studio 2008).And The Application (of Mine) had Crashed Randomly.<br/> This is the Stack Message :<br/> <pre lang="x-c#">NativeMethods.SafeRelease(IntPtr&amp; ppUnkown) SqlCeCommand.ReleaseNativeInterfaces() SqlCeCommand.Dispose(Boolean disposing) SqlCeCommand.Finalize()</pre> And this is other  message :<br/> <pre lang="x-c#">OffSet: 0x008cdb0 Error Model: sqlceqp35.dll Read: 0x00000000 Exception Address : 0x427bcdb0 Exception Code: 0x00000007</pre> For I'm a Chinese ,and the Itranslated the Message in English ,this is the original message if you can read Chinese:<br/>   <pre lang=x-cpp>偏移: 0x008cdb0 出错模块: sqlceqp35.dll 读取: 0x00000000 异常地址: 0x427bcdb0 异常代码: 0x00000007</pre> <br/> I Have found a Link ,which said the Bug has been fixed in SQL CE 3.5.<br/> Please Help Me,Thank You Very Much.Fri, 20 Nov 2009 12:41:52 Z2009-11-23T09:24:09Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b41cf706-b977-46c3-bc35-984a18c2284ehttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b41cf706-b977-46c3-bc35-984a18c2284emicheldphttp://social.msdn.microsoft.com/Profile/en-US/?user=micheldpSQL Server Compact 3.5 vs clickonceHello,<br/><br/>I develop a business application deployed through clickonce. Till now, we were using MSAccess as local DB but having read many times MSAccess is not the right tool for prod, we decided to migrate to SQL Server Compact 3.5. We are not yet using VS2010. We are still using VS2008.<br/>I am struggling with 2 issues:<br/>- having added SQL Server Compact 3.5 as new pre-requisite is not detected for upgrade. An uninstall is first necessary<br/>- on Vista, even after uninstall/re-install, we get the error:System.DllNotFoundException: Unable to load 'sqlceme35.dll'<br/>Could anyone help on this ? Could SQLCE 3.5 SP2 Beta help for this ? If yes, is it sensible to go in prod with this Beta version ?<br/>Thanks<br/><br/>MichelSun, 22 Nov 2009 17:04:22 Z2009-11-24T11:02:50Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/83821937-3929-4901-a78e-b675cf8a70cahttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/83821937-3929-4901-a78e-b675cf8a70caGabe Coverthttp://social.msdn.microsoft.com/Profile/en-US/?user=Gabe%20CovertHow to send a null value as a parameter?I am writing an application to retrieve some data via a third-party API, and consume the XML it provides and populate a SQL CE Database.<br/> <br/> I have the following code:<br/> <br/> <div style="color:Black;background-color:White"> <pre>SqlCeCommand InsertVol = <span style="color:Blue">new</span> SqlCeCommand(<span style="color:#a31515">&quot;insert into volumes(id, name, publisher, start_year)&quot;</span> + <span style="color:#a31515">&quot; values(@id, @name, @publisher, @start_year)&quot;</span> , _Conn); <br/> InsertVol.Parameters.Add(<span style="color:Blue">new </span> SqlCeParameter(<span style="color:#a31515">&quot;@id&quot;</span> , thisVol.ID)); InsertVol.Parameters.Add(<span style="color:Blue">new</span> SqlCeParameter(<span style="color:#a31515">&quot;@name&quot;</span> thisVol.Name)); InsertVol.Parameters.Add(<span style="color:Blue">new</span> SqlCeParameter(<span style="color:#a31515">&quot;@publisher&quot;</span> , thisVol.Publisher));<br/> InsertVol.Parameters.Add(<span style="color:Blue">new</span> SqlCeParameter(<span style="color:#a31515">&quot;@start_year&quot;</span> , thisVol.Start_Year)); InsertVol.ExecuteNonQuery(); </pre> </div> The data has some null values in the Publisher property, and when I attempt to execute the SQL, I get an error: &quot;Parameterized query 'insert into volumes(id, name, publisher, start_year) values(@id, @name, @publisher, @start_year)' expects a parameter value which was not supplied.<br/> Parameter name: @publisher&quot;<br/> <br/> The publisher field in my database is a nullable int, so a null value should be accepted.<br/> <br/> I've also tried:<br/> <div style="color:Black;background-color:White"> <pre>InsertVol.Parameters.Add(<span style="color:Blue">new</span> SqlCeParameter(<span style="color:#a31515">&quot;@publisher&quot;</span> , (thisVol.Publisher != <span style="color:Blue">null</span> ) ? thisVol.Publisher: DBNull.Value)); </pre> </div> but that gives &quot;Type of conditional expression cannot be determined because there is no implicit conversion between 'int?' and 'System.DBNull'&quot;<br/> <br/> How do I send this parameter in as null?<br/> <br/> Thanks!<br/> <br/> GabeFri, 20 Nov 2009 14:22:40 Z2009-11-23T09:24:30Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/73f642f6-feaa-4831-8cf6-03a4ac1ad628http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/73f642f6-feaa-4831-8cf6-03a4ac1ad628David Lenhttp://social.msdn.microsoft.com/Profile/en-US/?user=David%20LenInsufficient memory to continue the execution of the program<p align=left><font face=Arial size=2>Hi</font></p> <p align=left> </p> <p align=left>I'm using VS'08, developing in VB.NET, using an SQL'05 DB and a local sync DB (3.5)</p> <p align=left> </p> <p align=left>When attempting to append a record to the SQL CE DB's local sync'd table I get the error &lt;&lt;Insufficient memory to continue the execution of the program&gt;&gt;, the same record gets appended to the SQL'05 DB without error.</p> <p align=left> </p> <p align=left>Ideas?</p> <p align=left> </p> <p align=left>David L.</p>Thu, 07 Feb 2008 14:25:10 Z2009-11-21T00:08:38Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/45a4b2a3-6c42-4493-aacd-67fc6fd71a8ahttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/45a4b2a3-6c42-4493-aacd-67fc6fd71a8ampiontek2221http://social.msdn.microsoft.com/Profile/en-US/?user=mpiontek2221SQL Server CE database losing dataI'm creating a desktop app in VB 2008 Express with SSCE 3.5 SP1.  The .sdf database was originally created in Management Studio and frontloaded with data using insert queries.  My app opens the database, populates some controls with data, accepts any changes and saves just fine.  The app can be run any number of times with no problems.  The data is all there.  The trouble comes if I open the database in management studio.  It never shows any of the updated data.  Then when I run my app again, any data I added is gone but the original data is still there.  I have a feeling that I'm just missing something and this is not a bug.  <div>Any help would be appreciated.</div>Thu, 12 Nov 2009 19:24:05 Z2009-11-20T17:52:35Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/319761fc-427b-4cc3-963e-defc87d17325http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/319761fc-427b-4cc3-963e-defc87d17325Bastiank6http://social.msdn.microsoft.com/Profile/en-US/?user=Bastiank6SQL CE doesnt updateHi, <br/> I am working on a small app with SQL CE DB and a form with datagridview binded to it,<br/> when I insert a new record to the relevant table (through c# code) I see the new record in the datagridview <br/> (after writing this.pilesTableAdapter.Fill(this.coalLocalDataSet.Piles);)<br/> <br/> but when I look at the table data through VS server explorer I dont see the new record and it is also being deleted from the DB.<br/> <br/> Am I doing something wrong here? (The same thing worked 100% with SQL Express)<br/> Any clue is highly appreciated,<br/> best regards,<br/> BastianThu, 19 Nov 2009 20:54:42 Z2009-11-23T12:35:56Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/40d9e654-d392-49be-951a-b673a339c483http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/40d9e654-d392-49be-951a-b673a339c483htsaihttp://social.msdn.microsoft.com/Profile/en-US/?user=htsaiSqlCE 3.5SP1 Extremely slow database accessHi all,<br/><br/>I am currently stumped on the performance of my mobile device and was wondering if there was anyone that had any ideas as to why the database access is performing so poorly.<br/><br/>While developing a database access program for a Windows Mobile 6.1 device, I was encountering extremely horrendous database performance while just performing a simple table read.<br/><br/>I decided to write a very simple and basic test program to see if it was my code or the device itself. <br/><br/>I created a very basic database with the follow schema<br/>- One table<br/>- One Primary Key in table<br/>- Table consists of 3 columns:<br/>    - ID (primary key)<br/>    - Name (Indexed)<br/>    - Data (type int)<br/>- One row in table<br/><br/>Using that database, I created a very basic mobile form to test the performance of simply accessing the database using basic SELECT statements<br/><br/>the entirely of the code is:<br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><br/>string </span></span></span></span><span style="font-size:x-small">query = </span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">@&quot;SELECT * FROM TestingTable1 WHERE ( TestingTable1ID = 1 ) &quot;</span></span><span style="font-size:x-small">;<span style="font-size:x-small"> <br/></span></span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af"><br/>Stopwatch</span></span><span style="font-size:x-small"> sw = </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">new</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Stopwatch</span></span><span style="font-size:x-small">();<br/></span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><br/>using</span></span><span style="font-size:x-small"> (</span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">SqlCeConnection</span></span><span style="font-size:x-small"> connection = </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">new</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">SqlCeConnection</span></span><span style="font-size:x-small">(_connectionString))<br/>{<br/>connection.Open();<br/></span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af"><br/>SqlCeCommand</span></span><span style="font-size:x-small"> cmd = </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">new</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">SqlCeCommand</span></span><span style="font-size:x-small">();<br/><br/>cmd.Connection = connection;<br/>cmd.CommandText = query;<br/>cmd.CommandType = </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">CommandType</span></span><span style="font-size:x-small">.Text;<br/><br/>sw.Start();<br/></span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">SqlCeDataReader</span></span><span style="font-size:x-small"> reader = cmd.ExecuteReader();<br/>sw.Stop();<br/></span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><br/>if</span></span><span style="font-size:x-small"> (reader == </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">null</span></span><span style="font-size:x-small">)<br/>    WriteToTextbox(</span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;There was an error running query&quot;</span></span><span style="font-size:x-small">);<br/></span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">else</span></span><span style="font-size:x-small"><br/>    WriteToTextbox(</span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">string</span></span><span style="font-size:x-small">.Format(</span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;The query finished in {0} milliseconds.&quot;</span></span><span style="font-size:x-small">, sw.ElapsedMilliseconds));<br/>}<br/><br/>Using that code, I've been altering the Query string and clocking the time each query takes on the actual device where I actually measure (in milliseconds) the second run through in order to compensate for any code that must be Just-In-Time compiled.<br/>Results:<br/><br/>Query for Name column (matching)<br/>~ 13873 ms (second run through)</span> <p><span style="font-size:x-small">Query for Name column (mismatching)<br/>~ 13816 ms (second run through)</span></p> <p><span style="font-size:x-small">Query for ID column (matching)<br/>~ 13749 ms (second run through)</span></p> <p><span style="font-size:x-small">Query for ID column (mismatching)<br/>~ 13931 ms (second run through)<br/><br/>With those results, my question is:<br/>Is there something drastically wrong with my approach or is the device merely too underpowered to handle the platform?<br/>Is there another more efficient way to access the database?<br/><br/>Platform:<br/>.NetCF 3.5<br/>SqlCE 3.5SP1<br/>Windows Mobile 6.1 Professional<br/>400-MHz Qualcomm MSM7500 processor<br/>112MB of internal storage<br/>84MB of total RAM<br/>47MB free for user programs<br/><br/>Thanks in advance for any help you guys can give!</span></p>Fri, 13 Nov 2009 02:31:13 Z2009-11-20T05:15:08Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b25b2e68-0314-4954-8551-2b0f6d173166http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b25b2e68-0314-4954-8551-2b0f6d173166KhurramAzizhttp://social.msdn.microsoft.com/Profile/en-US/?user=KhurramAzizSQL Server Compact Edition Binaries<p>I am maintaining an application which was deployed using ClickOnce. Its recent version required SQL CE; and we placed the SQL CE dlls along the application and every thing was working fine.</p> <p>Now some people are reporting issues like at one place the user is getting the following exception. He has Visual Studio 2010 Beta 2 installed</p> <div style="font:100% 'Courier New', Courier, monospace;background-color:white;color:black"> <pre>File version mismatch detected between ADO.NET Provider and native binaries of SQL Server Compact which could result <span style="color:blue">in</span> an incorrect functionality. This could be due to the presence of multiple instances of SQL Server Compact of different versions. Please install SQL Server Compact binaries of matching version [ADO.NET Provider File Version = 8044, Native Binary File Version = 5692] at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion) at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries() at System.Data.SqlServerCe.SqlCeConnection..ctor() at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)</pre> </div> <p>At the other place the user is getting the following exception.</p> <div style="font:100% 'Courier New', Courier, monospace;background-color:white;color:black"> <pre>System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception <span style="color:blue">from</span> HRESULT: 0x8007000B) at System.Data.SqlServerCe.NativeMethods.DllAddRef() at System.Data.SqlServerCe.SqlCeConnection..ctor() at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)</pre> </div> <p>How to bundle our application while keeping SQL CE dlls local to the application? It would be very hard to ask everyone to uninstall and reinstall with newer ClickOnce setup having package dependency on SQL CE</p> <hr class=sig> KhurramThu, 29 Oct 2009 06:51:17 Z2009-11-19T20:08:16Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f3e3de3b-08f2-43b0-a622-828e15e80526http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f3e3de3b-08f2-43b0-a622-828e15e80526Igor Kondrasovashttp://social.msdn.microsoft.com/Profile/en-US/?user=Igor%20KondrasovasDeployment Strategy for Schema UpdatesHello,<br/><br/>I would like to hear from you what do you consider the best option for this specific scenario.<br/><br/>I must deploy a sqlce database on client computers, and eventually perform updates on the db schema when the user performs a version upgrade (keeping the user data).<br/><br/>I'm thinking about writting a custom installer class that will check for the current db version installed (using a simple table on db to keep the shema version) and perform the necessary updates acordingly to current version.<br/><br/>I would like to know if you think that I should keep the db creation scripts and update scripts &quot;hard-coded&quot; on my installer classes, or use a separated file (.sql or .sqlce)? If so, is there any way to get rid of this scripting files so the user will not know my db structure?<br/><br/><br/>What do you think?<br/><br/>Regards,<br/><br/>Igor<hr class="sig">Project Manager at INOVATIVA Tecnologia www.inovativatec.comWed, 18 Nov 2009 17:11:02 Z2009-11-19T19:48:04Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f097f971-a4ce-429a-936a-259387e8e80ehttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/f097f971-a4ce-429a-936a-259387e8e80eZero_gthttp://social.msdn.microsoft.com/Profile/en-US/?user=Zero_gtGetting Error Message "The 'Microsoft.SQLSERVER.CE.OLEDB.3.5' provider is not registered on the local machine."Hello, I have asked this question in another forum, but wasn't able to fully solve it. I have been developing a Windows Forms application using XP on a compute and I recently moved the project to a Windows 7 PC that is 64-bit. For some reason I cannot build or run the published version of the app on this new computer, however it works fine on another PC running the 32-bit version of Windows 7. Basically, I am having trouble isolating what the problem is. I have tried installing various version of SQL server compact/Express and had no luck getting it to run.Wed, 18 Nov 2009 02:33:23 Z2009-11-19T04:28:23Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/7a6783b0-fbab-4b8f-b244-2b0a0cfc1312http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/7a6783b0-fbab-4b8f-b244-2b0a0cfc1312Magnus L Karlssonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Magnus%20L%20KarlssonHow secure is Encryption?Is there any known applications that can &quot;recover&quot; the password from an encrypted .sdf file? <div>The reason I ask is because I'm thinking of adding encryption on some of the more sensitive fields of some of the tables. Is it worth the effort, or is the built in encryption strong enough? </div> <div><br/></div> <div>Regards </div> <div><br/></div> <div>Magnus</div>Wed, 18 Nov 2009 07:02:19 Z2009-11-20T10:32:09Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/2abef504-76a6-4404-898b-acefe6d99bbfhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/2abef504-76a6-4404-898b-acefe6d99bbftballardhttp://social.msdn.microsoft.com/Profile/en-US/?user=tballardADOCE3.5?<p>I have an old app that has ADOCE 3.1 Header files:<br/><br/>adoce31.h, many other files named adoce31: idl, tlb; etc, as well as oledb.h and oledb26x.h.<br/><br/>In my SQL Compact 3.5 SP1 directory, include directory, I only have the oledb stuff:<br/><br/>C:\&gt;dir &quot;c:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Include&quot;<br/> Volume in drive C has no label.<br/> Volume Serial Number is 3CF6-5B57</p> <p> Directory of c:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Include</p> <p>08/27/2008  08:53 AM    &lt;DIR&gt;          .<br/>08/27/2008  08:53 AM    &lt;DIR&gt;          ..<br/>05/14/2008  02:28 PM           143,144 sqlce_err.h<br/>05/14/2008  02:28 PM           567,433 sqlce_oledb.h<br/>10/08/2007  12:08 PM           137,573 sqlce_sync.h<br/>               3 File(s)        848,150 bytes<br/><br/>Is there ADOCE headers for SQL Compact 3.5?<br/><br/>Thanks.</p>Tue, 17 Nov 2009 15:16:49 Z2009-11-18T14:24:48Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/a7788f09-37d8-41d1-b64a-9e465aa1f4c1http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/a7788f09-37d8-41d1-b64a-9e465aa1f4c1hi dbhttp://social.msdn.microsoft.com/Profile/en-US/?user=hi%20dbhelp with the my Emulaterhi all<br/>i use pc 2003 Emulater with vstudio8, with Emulater option i give a shared folder, who can i reach the shared folder with my code program.<br/>i see it in the Emulater as a Storage card but i can define it with my code...<br/>help me pleace<br/>Tue, 17 Nov 2009 19:11:06 Z2009-11-20T09:08:29Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cf50df8d-fc31-4f20-92dc-92620a7c64f7http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/cf50df8d-fc31-4f20-92dc-92620a7c64f7SergioTorreshttp://social.msdn.microsoft.com/Profile/en-US/?user=SergioTorresSQL CE 3.5.1 unique index and null values conflictI have a clients table with an identity column as PK.<br/><br/>The table includes a column &quot;passport number&quot; that I have defined as unique and allow null true.<br/><br/>When I try to add a second record with the &quot;passport number&quot; null value I receive an error message:<br/><br/>No row was updated<br/>The data in row 4 was not commited.<br/>Error Source: SQL Server Compact ADO.NET Data provider.<br/>Error Message: A Duplicate value cannot be inserted into a unique<br/>index. [Table Name: Clients, Constraint name = <br/>UQ__Clients_0000000000000038]<br/><br/>Correct the errors and retry or press ESC to cancel the change(s).<br/><br/>As far as I know this is a standard functionality of unique indexes (null values are not considered duplicate).<br/><br/>What can I do? Not all my clients will provide their passport number (hence, the need for the allow null true), but I need to enforce unique values for those who provide it (unique index).<br/><br/>Thank you for your help.Tue, 17 Nov 2009 17:47:06 Z2009-11-18T05:31:26Z