I'm porting my C++ (EVC3) application from Sql CE 2.0 to Sql Mobile 3.0
(with OLE DB). To compact a 2.0 database, i used ISSCECompact interface.
But it doesn't exists with the new version. I've only found C#
and VB.Net samples in MSDN ...
So I started an SQL CE database for use inside a mobile application. I used SSMS to create a .sdf file (because if I let Visual Studio do it, SSMS can't open it because it will be version 3.5).
The reason I wanted to use SSMS is because I wanted to be able to design the database in design view, and populate it with initial information for the application to use. That means adding tables and rows.
The problem is, SSMS doesn't seem to have a design view available when working with CE databases. It also doesn't seem to have a feature for adding rows into tables. It's essentially as useless as VS2008 for designing my mobile database. It only lets me add tables, and I can't even do that visually in design view. I have to use those cumbersome forms.
Is there any way to design a CE database in design view? And add rows of data into tables? It feels like I'm overlooking something.
Note: I dont need to subscribe or publish the database. The mobile application just needs to use the database as a repository.
What really changed from SQL Mobile to SQL Compact besides allowing the database to run on any desktop? Is there a document somewhere explaining the differences, I did not see anything?
I just changed my development machine over to SP1 and wondered what code I should be changing.
I am filling the database from my C++ Desktop app using ADO using the OLEDB provider Microsoft.SQLSERVER.MOBILE.OLEDB.3.0 and using System.Data.SqlServerCe in my C# mobile app. Is that OLE provider valid with the new version or should it be *.COMPACT.3.1?
I thought there was now suppose to be some sort of automatic compaction, but I did not notice any new properties.
We currently use SQL Mobile and SQL Server 2005. We depend heavily on merge replication for data to the field handheld devices.
We are going to be starting some new projects and I was wondering about moving to SQL Compact Edition as the first step to migrating all of our applications.
I am concerned, however, about the server side and replication. If we simply deploy SQL Compact Edition will there need to be any changes to the server for replication?
I have not seen much info on this so I thought I would ask the forum. I have VS2005, no SP1 and SQL Mobile installed on my computer. I started developing an app for Windows Mobile 5 using RDA and it appears to work fine. Now I want to know what happens to SQL Mobile if I install SQL CE. Is it going to affect my app? Do I have to install the SQL CE merge replications tools for IIS again? I already have them for SQL Mobile? Will this affect the operation of my app? It looks like the installation procedures call for installing SQL CE tools to VS2005 before installing VS2005 SP1 then install VS2005 SP1 and finally install SQL CE tools for VS2005 SP1. Any help, thoughts or experiences involving this would be appreciated.
Just released small piece of software with SQL Compact Edition, version 3, dll files distributed with the application.
Now feedback from 2 people suffering an error message as follows: SQL Mobile usage is restricted on this platform. To use SQL Mobile, you must install SQL Server 2005, Visual Studio 2005, or the Tablet PC SKU.
Both using XP under Admin accounts.
My own testing did throw up this error prior to release, but only when I tried to run the program as a Limited User. I was unable to find out why. Running the program under an Administrator account never produced this error message.
The test-bed was a fresh install of XP, SP 2, running within VMware. An Administrator account was set up. No development software was installed, nor anything to do with SQL. I tried to make it a clean environment to be used by a non-technical user.
I am confused about the version numbers for SQL Server Compact/Mobile. It _looks_ like the versions went from CE 2.0 to Mobile 2005 to CE 3.0 (or 3.1). Is this correct? In fact, I found one location the specifically said Compact Edition is the next version of Mobile. In another location I saw Compact Edition referred to as 2005 CE.
This has got me going because I am creating a Mobile/CE app and I keep getting a "Initialize SQL Server Reconciler" and the best information I can find indicates a mismatch between the server component and the client component.
So, what are the current versions of Mobile/CE? Is there a location that lists all of the components and what version they should be?
I completed that example that I pasted in the subject part and when I try to synchronize my mobile database, the data from the server appear in my pocket pc; but when i refresh the data on my pocket pc they do not show on the server.
I've been trying to create an installer for a little .NET CF 3.5 app I've written for Windows Mobile. It uses SQL Server Compact 3.5. I've got the .NET CF and my program to deploy on the device using ini files and ceappmgr.exe, but when I try to do the same for SQLCE 3.5, it doesn't work (more on this in a sec).
I need my installer to install across lots of different CPU architectures, so I created an ceappmgr INI file that includes all the different cabs for the different CPU architectures. I'm trying to test the installer by making it install on my smartphone (ARM CPU). The problem is, when I install it I get an error message on the device "The installation file is not intended for this device.". I reckon this means ceappmgr is picking the wrong cab file and trying to make my phone install it!
I did a bit of testing and found out if I remove all the cabs from my ceappmgr INI file EXCEPT for the one that is appropriate for my smartphone, then it works fine! But as soon as I include a cab file that is not appropriate for my device (eg a different cpu architecture, or the ARM PPC cab file), it stops working and I get that "not intended for this device" message.
My INI file looks like this:
[CEAppManager] Version = 1.0 Component = SQL Server Compact 3.5
[SQL Server Compact 3.5] Description = Microsoft SQL Server Compact 3.5 CabFiles = sqlce.phone.wce5.armv4i.CAB,sqlce.wce5.armv4i.CAB,sqlce.ppc.wce5.armv4i.CAB,sqlce.wce5.mipsii.CAB,sqlce.wce5.mipsii_fp.CAB,sqlce.wce5.mipsiv.CAB,sqlce.wce5.mipsiv_fp.CAB,sqlce.wce5.sh4.CAB,sqlce.wce5.x86.CAB
Any idea why ceappmgr would be (seemingly) picking the wrong cab file and trying to make my device install it? Btw, my smartphone uses the "sqlce.phone.wce5.armv4i.CAB" cab file.
Hi, I can't seem to find which SQL Server Compact Edition version is pre-installed on the Windows Mobile 6 rom. I guess it is 3.0, but I'm not sure about it. Another question is, if I use SQL Server Compact Edition 3.5 by deploying the .dll files as part of my application's CAB installer, will this be a problem for Windows Mobile 5 or Windows Mobile 6? Thank you in advance,
I have a windows forms application that runs on my PC that populates a SQL Server Compact 2005 database and then transfers that .sdf file to my mobile device. The communication between the mobile device and PC is done using the Desktop RAPI class from OpenNetCF (http://www.opennetcf.com/FreeSoftware/DesktopCommunication/tabid/90/Default.aspx)
Anyway, I was previously using SQL Server Mobile 2005 and my populated .sdf was around 1.7 MB and I could transfer it to my mobile device in a minute. Once I switched to SQL Server Compact 2005, the transfer process began taking 3 minutes with a 1.5 MB .sdf file. The SSCE also got bloated more easily so I added in the Compact operation each time after I fully populate the SDF to keep the file size at 1.5 MB, but even then it still takes 3 minutes.
I've done a few tests where I simply switch between the two database versions and that simple switch of the version changes the transfer time. I am dumbfounded trying to figure out what the cause might be. Since it is just a file transfer, why would the version even matter unless somehow SSCE is really not compacting and lying about its actual size.
Has anyone run into anything similar to this or may have any ideas what might be going on?
Could someone give me the difference between "Sql Mobile 2005" and "Sql Compact 2005". At first I thought they were the same, that this was just something of the change in naming the server has had the last months. My first guess was that Mobile would be the new one, but I have 'accidently' downloaded the Compact and what seems the System.data.SqlServerCE.dll is newer.
So is there a difference? If yes, what are they. If not, is the "compact" then the latest version and the name to be used (since on the site only "mobile" is mentioned).
I'm a bit confused about the editions. Will SQL Server Compact v3.1 be a successor of SQL Server Mobile v3.0 (but with desktop and mobile targets) or will the two editions coexist with SQL Server Mobile on Smart Devices and SQL Server Compact on desktop PCs?
I'm drawing this conclusion because the CTP & now also the RC1 of SQL Server Compact are only compiled for desktops (and I've also seen that the .NET library is compiled against .NET Framework 2.0 desktop edition). If I'm wrong, why are no smart device CABs provided?
My second question: Is the file format of SQL Server Mobile & Compact the same? Can I create a SDF file with the Compact Edition on the desktop, move it to the smart device and use it there with the "older" Mobile Edition? I'm asking, because we are starting a project where we need to create a SDF on the desktop, because of performance reasons.
Hello, there are some limitations in SQL Server 2005 Mobile Edition - e.g. there is no TRUNCATE TABLE statement, the UPDATE .. FROM clause is not allowed etc. Are these limitations in Compact Edition too? Is T-SQL in these editions functionally equal or different? Is there any comparison of T-SQL features in both editions?
I'm currently looking at adding a database to my company's WinCE 4.2 -based device, running applications coded with embedded CE 4.0. We want to start tracking potentially large quantities of user data (10K-30K 500 byte records) and are looking at a database engine to support this. The database would reside on the device although we would potentially dump the data from the devices to a central workstation that would be used to pull reports about the data across multiple devices. SQL Server Compact Edition sounds like a possible solution, but I'm unclear if it's supported on CE 4.2 or how to install it if it is. It's clearly supported on CE 5.0, but it may be a while before we upgrade to CE 5.0 or 6.0. I've seen references that say that SQL Server Compact Edition is the same as SQL Server Mobile Edition, and references that Mobile Edition is supported on CE 4.2, but I'm unclear if I can install and use SQL Server Compact Edition on CE 4.2 or if I'm on a wild goose chase. If not, can I use SQL Server Mobile Edition and migrate to SQL Server Compact Edition when we upgrade CE to 5.0 or 6.0? If not Mobile Edition, what about Microsoft SQL Server CE 2.0? Is that going too far back in the archives? Thanks for any guidance/enlightenment you can offer.
I am still working on my project, but figured I would share my findings with the community, on how I imported my SQL Server database tables into a new SQL Compact Edition database. Unfortunately, I haven't figured a workaround to the IDENTITY_INSERT issue, but other than that, I will proceed.
1) I downloaded and played with the tool presented in the article "Generate SQL Insert statements for your SQL Server 2000 Database" I made the following modifications . (my modification can be found here) a) Disable scripting dependencies b) Add a filter for objects to script c) Prompt for each table from which to export data
2) From the scripts output by this tool, I had to (which I may integrate into the tool later... who knows) a) Remove 'On Primary' statements after the create table statements. b) Remove date defaults. c) Most other SQL generated by the tool seemed to work.
3) Execute each 'Create Table' statement individually.
4) For the Data Import, I had to add semi-colons to the end of each Insert Line.
5) I Have found no workaround for the IDENTITY_INSERT issue. If anyone has a good idea, I would love to hear it. In my case, I was importing the DotNetNuke core store module tables populated with about 2500 products and 20+ categories consisting of a simple categories table and products table. I imported the categories table into a fresh MS Access database file, and then ran the update query against the attached products table in the original SQL Database, then regenerated the insert statements, and imported the data generating fresh product ID's. This database will only be read only, so it didn't matter about maintaining the Product ID's, just the relationship between the products and categories.
Separately, I found a great blog article on how to embed a SQL script as a resource for your application and run it on your applications first run, so my steps above would provide a quick foundation for generating that sql script.
Dear All, i have a question abt winCE 4.2 and SQL server CE. i am using VB.net of Visual Studio 2005 My platform is using a PDA with winCE 4.2 and SQL server CE. The Host program is using dbf files on desktop side.
I got a problem of how to sync / read the sql CE data from a windows application.
so, i wanna ask,
1. any method to access the data from winCE data by windows application? or can i convert the sdf file to windows readable files? or any others?
2. Can i use a MDB to sync with SQL server CE? can i synchronize the mobile device which has a SQL Server CE database with the Access database on the desktop?
last question, 3. is that windows CE .net 4.2 not support pocket access (cdb) anymore?
Hi, I am wondering why a database that was 2Gb in size would come down to just 300Mb when I copy all the data from the origional database into a blank new one. I ran a database shrink on the origional database but that only reduced it from 2.1 Gb to 2Gb. I was shocked to see the size difference when I copied the data. As far as I can tell the copied database still contains all the records of the origional.
I remember that MSAccess had a Compact function that literally copied all the data from one databse into a new empty one - is there the equivalent for SQL?
I have problems in migrating. Here are the questions: 1. Is the ShrinkDatabase task the SSIS equivalent of this script? If so, I'm having problems creating a new connection since it is an mdb file stored on local computer and not on a server. Is there a workaround on this? 2. If I have to use the script task, I use this codes:
Set Engine = CreateObject("DAO.DBEngine.35") Engine.CompactDatabase "C:.path...database_UnCompress.mdb", "C:path... estdatabase.mdb" or
Set Engine = CreateObject("JRO.JetEngine") Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathdatabase.mdb", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathcompacted_database.mdb" Both produce the same error: Option Strict On disallows late binding. Any suggestions?
3. I also tried to use the Execute SQL Task, using dbcc shrinkdatabase. But I seem lost again in creating a connection. Should I consider "database_UnCompress.mdb" as flat file source?
I'm an Access man moving towards SQL Server and I'm interested in knowing if there is a utility for my SQL Server version 7 database that is similar to Access' Compact and Repair utility? I'd like a recommendation from a guru on what Prevenatative Maintenance measures I should be running daily/weekly/monthly etc...
I want to access to a SQL Compact database with an application develope with Visual Basic ans using ADO (not ADO .Net). Is it possible and how ? Thank You.
I am new to SQL Mobile developement and trying to developing a small device appliction. My C# code is shown below. My code is executing correctly, but i am not able to see the inserted records in to my SQL Compact database. What i am doing here? Please help.
FYI, I have added the database in to my solution. My solution and database resides in E:\some directory, where as the my assembly code base represents the datasource as \ProgramFilesMobExpTrackerMobExpTracker.sdf.
SqlCeConnection connection
{
get
{
if (_connection == null)
{
_connection = new SqlCeConnection(ConnectionString);
_connection.Open();
}
return _connection;
}
}
string CurrentFolder
{
get {return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
I got a SqlCe2.0 database here called JOB.sdf, size is 260K. When I tried to compact it, it took very long and that JOB.sdf.tmp was created with 27.7M!!!, I can still open table in the database, but I found that there is some invalid data (unreadable square boxes). It looks like database was corrupted. My application gave error:
Note: " " is displayed as "SOHSOH....." with black background.
Apart from compacting database, is there manual job or tool we can do/use to fix a corrupted database caused by power failure? (e.x: all data saved successfully before power failure)?
I have an application that uses a SQL Server Compact 3.5 database backend. Everytime the application starts I want to zero out my database, meaning remove all records and reseed all identities. This datatbase is then filled based on a directory structure. Once this DB is filled I then send the entire database to a Windows Mobile PPC device via 802.11g WIFI. Before sending the database I first create an MD5 checksum on both the server and client sides to see if the database actually needs to be transfered. If the checksums match I will not send it as the client already has the lastest copy.
My problem is that I can never count on the database identity values starting at the same number on any particular instance of the application so the checksums are usually different. To solve this problem I need to ensure that everytime I start my server application the database (and all identifiers) will always be the same, will always be as if I just creaed it. How do I do this?!?!?!? This seems like it would be a trivial operation as I can imagine its use in multiple situations. Anyone know how to zero out the database?
I need to create a desktop program on vb.net , based SQL compact edition. but I do not know how to connect to CE database. I already create the sdf file, but I can not connect it from the poject , is there any way to do it ?
I am currently working in VB.NET with SQL Mobile 2005. I am trying to compact a database, .sdf, using the SqlCeEngine Object compact(connectionstring). When I use this code to compact a small database, only about 300KB, it returns okay however when I try to compact a larger database, about 9MB, it returns with a SQL Error Code: 0, "The operation completed successfully" however with no compacted database. The code works however it only seems to work for smaller databases. Does anyone have any ideas on how to correct this error or tell me why it returns with that type of error.