Microsoft KB Archive/301217

= HOW TO: Prebuild a Database in SQL Server CE =

Article ID: 301217

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Windows CE Edition
 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 2000 64-bit Edition

-



This article was previously published under Q301217



IN THIS TASK
SUMMARY
 * Requirements
 * Prebuilding a SQL Server CE Database
 * Registering the SQL Server CE Components on the Device

REFERENCES



SUMMARY
If you have a large quantity of data in your back-end Microsoft SQL Server database, it can be resource-intensive to have every Microsoft Windows CE device download all of the data by using a replication synchronization process. You can &quot;prebuild&quot; a Microsoft SQL Server CE copy of the database, and download it onto each device with the application. This article provides the steps necessary to complete this task.

back to the top

Requirements
The following items describe the recommended hardware, software, network infrastructure, skills, knowledge, and service packs you will need:
 * A Windows CE device
 * SQL Server 2000 Windows CE Edition
 * SQL Server 2000

back to the top

Prebuilding a SQL Server CE Database
To prebuild your SQL Server CE database:
 * 1) Set up one Windows CE device with the application.
 * 2) Use replication to connect the application to the back-end SQL Server database to create the SQL Server CE .sdf file on the device, and then synchronize all of the data.
 * 3) Stop the application, and use ActiveSync to connect to the device. Use the ActiveSync Explorer function to copy the .sdf file from the Windows CE device to the development system, and then store it with the rest of the application.

NOTE: Whenever you copy the SQL Server CE application you should also copy the .sdf file at the same time.
 * 1) The SQL Server CE database includes move-copy code that detects when a database has been moved to a new device, and it automatically gets a new ID for the user. The first time that the .sdf file is used by your SQL Server CE application on a new device it gets a new ID, and the .sdf file is updated with only the changes made in the back-end SQL Server database after the copy was made.

back to the top

Registering the SQL Server CE Components on the Device
DllRegister.exe registers the components on the device and warns you about optional components that are missing from the device:
 * 1) Select the appropriate version of DllRegister.exe based on the processor type of your device.
 * 2) Copy DllRegister.exe from your development system to your Windows CE device and run it.NOTES:

On Palm-size PCs or Pocket PCs, you can copy DllRegister.exe to the \Windows\Start menu folder, and then run it from the Start menu on the device.

You can find DllRegister.exe in the \Program Files\Microsoft SQL Server CE\Device\Processor Family\Processor Type folder.

back to the top

