Hello,
Was wondering if its possible with VS 2005 to create and populate a SQL Server Ce database on the desktop
Reason why I'm asking is it takes a very long time (~40 minutes) to process xml and insert the values into the sdf database on the Pocket PC. I would assume it is much quicker to create the database and insert records on the desktop. Any suggestions would be appreciated.
Thanks

sql mobile database connection on a desktop application
Koen Willemsen
SQLMobile is supported only on devices and on the Tablet PC. I'm afraid you can't use it for normal desktop applications.
Thanks,
Sriram Krishnan
Program Manager- Visual Studio for Devices
danielpitz
i try to make a connection on a sql mobile database (*.sdf) from a desktop application made with VS2005 Beta 2 but i didn't manage. I dont' know where is my problem....
Is it possible or have I done something wrong
thanks.
Dotcom
ZackL
http://blogs.msdn.com/smartclientdata/archive/2005/07/15/439008.aspx
Steve
jch_00
Scarlett Lee MSFT
It is technically possible to run SqlMobile against the desktop, you do have to do a bit of work though. There is a topic on this in the Sql Server Mobile topics of SqlServer (the title is "How To: Build and Deploy a Windows Application (SQL Server Mobile)"). Here's the contents of the topic:
To build and deploy a SQL Server Mobile Windows application
Open Windows Explorer and locate the following directory:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
Select and copy the following files:
sqlceca30.dll
The SQL Server Mobile Client Agent. Required for applications that connect to SQL Server by using replication or remote data access.
sqlcecompact30.dll
Provides the compact database functionality. Required if your application will use compaction.
sqlceer30[language].dll
Contains error strings for SQL Server Mobile-generated errors. Required for all SQL Server Mobile applications.
sqlceme30.dll
Contains code required by the System.Data.SqlServerCe.dll file. Required for all SQL Server Mobile applications.
sqlceoledb30.dll
Provides OLE DB connectivity to SQL Server Mobile databases. Required only if your application uses OLE DB to connect to the SQL Server Mobile database.
sqlceqp30.dll
The SQL Server Mobile Query Processor. Required for all SQL Server Mobile applications.
sqlcese30.dll
The SQL Server Mobile Engine. Required for all SQL Server Mobile applications.
System.Data.SqlServerCe.dll
Contains the SQL Server Mobile namespace, which you reference in your application code. Required for all SQL Server Mobile applications.
Note that while this is technically possible to do and it's likely ok to do this for a little test app during your development, when Visual Studio 2005 ships you will have to make sure that you conform to the terms of the SqlMobile licensing agreements if you ever plan on distributing a desktop application that uses SqlMobile.
Hope this helps!
Neil
ChristopheGalli
But it would be better for me if i can directly update a sql database which would be located on the mobile device.... and i didn't manage...
thanks.
Nicol
Neil
Paul Hood
but thank you for answering me.
Kooldino
Hi to all in this forum. have been involved in this discussion for over 3 weeks now and here is the perspective from what I now understand.
MS does NOT support direct management of Mobile SQL:data on the desktop EXCEPT for the following
You have an SQL Server product (NOT SQL Server Express)
0r.
You have a Tablet PC
HOWEVER
You can manage your data on the desktop by right clicking the relevant table within Server Explorer at development stage with your smart device application but this is only on a record by record basis. There is no bulk cut and paste facility.
A POSSIBLE SOLUTION
is to use the system.io object to export your data to a text file and read this in to your Mobile SQL application.
I agree this is not a very satisfactory solution.
Regards
David
Jonrio
The error tell me that i must have vs2005, sql server 2005 ot tablet PC SKU to make it work... Is it the only solution
Thanks, Julien
Ruden
Julien,
When you deploy the solution, make sure you include SQL Server 2005 Express Edition Beta as a prerequisite. Once I did that and included the dll in the application path, I could use a SQL Mobile database on the desktop.
Regards,
Peter
Simmy7
Thanks for your response Jung,
I was able to create a .sdf database and insert records on the desktop. The key was to place the following dll in the application executable directory.
sqlceca30.dll
sqlcecompact30.dll
sqlceer30en.dll
sqlceme30.dll
sqlceoledb30.dll
sqlceqp30.dll
sqlcese30.dll
Only concern now is I could not add a reference to these dll's in VB.net and when I tried to install the application on another computer (without VS 2005), the application failed to generate the .sdf files.
Any advice on how/what files are needed for distribution
Thanks
Peter
JarLin
Hello...
yes, you can manage SQL Mobile Database on your desktop through the
SQL Server Management Studio.
you may need to install SQL Server Mobile Serer Tools:
location:
drive>:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE folder, double-click Sqlce30setupen.msi
or from ms download:
http://www.microsoft.com/downloads/details.aspx FamilyId=0A6174A4-C009-4768-8284-698C32EC84E3&displaylang=en
from MSDN:
===============================
You can create or connect to a Microsoft SQL Server 2005 Mobile Edition (SQL Server Mobile) database on a device or on a desktop computer.
A SQL Server Mobile database is stored in a file with the .sdf extension. The file contains the complete contents of the database and can be up to 4 GB. SQL Server Mobile can access and modify the database file, both on a smart device and on a Tablet PC. It also supports use on desktop computers by using SQL Server Management Studio and other tools.
By using either SQL Server Management Studio or Transact-SQL statements, you can connect to an existing database on a desktop. You can also create and modify databases from a desktop. You can then view the design of that database in a tree hierarchy by using the object tree. Each node has a shortcut menu with commands for modifying the database or retrieving information about the database.
Some of the functions you can perform in a SQL Server Mobile database include the following:
You can use Transact-SQL commands, including data manipulation language (DML), data definition language (DDL), and functions, with the SQL Server Mobile database.
You can also use replication or RDA with a database that is exposed through native and managed APIs.
===============================
Maryello
I want to do this from a Web app on the same computer, so I tried something similar for the Web app, referenced the mentioned DLL. At first I ran it without the additional DLLs (only with the reference) and it gave an error as expected.
I then added the additional DLLs to the "bin" folder of the Web app, and this time it came up with with the following error:
"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".
Do you know of a work-around for this, if not, will I screw my SQL 2000 installation with an SQL 2005 installation
Thanks.