1/21/2008 11:00:24 AM

The most up-to-date version of this file is available online at the Microsoft Download Center.

The SQL Server documentation team welcomes your documentation feedback. We view and investigate all documentation issues but do not answer technical support questions here. For help with technical issues not related to documentation, see Getting Assistance with SQL Server Compact . If it is possible, submit feedback to us in English.

Contents

1.0 Introduction

Microsoft® SQL Server™ Compact 3.5 is the next version of SQL Server Compact Edition (version 3.1). This product includes the following versions.

  1. Version 3.5: Microsoft SQL Server Compact 3.5
  2. Version 3.1: Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition)
  3. Version 3.0: Microsoft SQL Server 2005 Mobile Edition (SQL Server Mobile)
  4. Version 2.0: Microsoft SQL Server 2000 Windows CE Edition 2.0 (SQL Server CE)

SQL Server Compact 3.5 can be used to develop Windows desktop, and Windows Mobile applications. The development support for SQL Server Compact 3.5 is provided by Visual Studio 2008. Database administration support will be provided by SQL Server 2008. SQL Server Compact 3.5 components are available in Microsoft Windows Installer (.msi) files as follows:

  • SQL Server Compact 3.5 Design Tools (SSCEVSTools-ENU.msi): This file installs the SQL Server Compact 3.5 design-time components with Visual Studio 2008. The design-time components are the user interface, dialog boxes, and design-time environment, which are used to write applications for SQL Server Compact 3.5. The SQL Server Compact 3.5 design-time components include design-time environment dialogs under the Server Explorer to design applications that use SQL Server Compact 3.5. SQL Server Compact 3.5 header files (for native development) are installed under %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Include.
  • SQL Server Compact 3.5 (SSCERuntime-ENU.msi): This file installs the SQL Server Compact 3.5 runtime components for Windows desktop computers in a central folder: %Program Files%\Microsoft SQL Server Compact Edition\v3.5. The SQL Server Compact 3.5 desktop runtime components are required for developing applications in Visual Studio and for running SQL Server Compact 3.5-based applications on the desktop. This .msi file also installs Microsoft Synchronization Services for ADO.NET components for x86. The Synchronization Services for ADO.NET components are installed at %Program Files%\Microsoft Synchronization Services\ADO.NET\v1.0.
  • SQL Server Compact 3.5 for Devices (SSCEDeviceRuntime-ENU.msi): This file installs the SQL Server Compact 3.5 devices runtime components in %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices. The runtime components are required for developing Windows Mobile and Windows CE device-based applications in Visual Studio and for deploying the applications on Windows Mobile devices. SQL Server Compact 3.5 and SQL Server Compact 3.5 for Devices msi files install with Visual Studio 2008 and also available as a Web download. SQL Server Compact 3.5 Design Tools MSI installs only with Visual Studio 2008. SQL Server Compact 3.5 for Devices MSI is installed if the Smart Device Programmability option is selected when you run Visual Studio 2008 setup. The following .msi files will also be available as a Web download:
    • SQL Server Compact 3.5 Server Tools (SSCEServerTools-ENU.msi): SQL Server Compact 3.5 Server Tools MSI is installed on the server that is running IIS. Installation of this .msi file is required to replicate data between SQL Server Compact 3.5 and SQL Server, by using Merge replication or remote data access (RDA). SQL Server Compact 3.5 Server Tools also supports data replication between SQL Server 2005 Compact Edition or SQL Server 2005 Mobile Edition and SQL Server.
    • SQL Server Compact 3.5 Books Online (SSCEBOL-ENU.msi): The Books Online MSI installs the SQL Server Compact 3.5 documentation locally on the computer.

[Top]

1.1New Features in SQL Server Compact 3.5

SQL Server Compact 3.5 introduces the following features for software developers.

Installation and Database File Upgrade

  1. Support for side-by-side installation together with the previous version (3.1) on Windows desktop computers. If you try to open database files created by using earlier versions, SQL Server Compact 3.5 will give you a message that the file cannot be opened. To open it, the database file first must be upgraded by using the Upgrade to SQL Server Compact 3.5 Database dialog box in Visual Studio 2008. To access the Upgrade to SQL Server Compact 3.5 Database dialog box, click Data, click Add New Data Source, and then click Add Connection. When you try to open an earlier version of the database file, you receive a message. By selecting OK, the Upgrade to SQL Server Compact 3.5 Database dialog box appears. The file name extension of SQL Server Compact 3.5 is *.sdf, which is the same as that of the earlier versions (SQL Server Compact Edition, v. 3.1, and SQL Server 2005 Mobile Edition, v. 3.0). After a database file is upgraded to SQL Server Compact 3.5, you will no longer be able to open the database file by using earlier versions of SQL Server Compact. Database files created by the earlier versions of SQL Server Compact 3.5 can be programmatically upgraded by using the SqlCeEngine.Upgrade API. Refer to the documentation for more information.
  2. To support older operating systems, with older encryption algorithms, and newer, more secure encryption, SQL Server Compact 3.5 supports backward-compatible encryption modes. The encryption modes available in the Upgrade to SQL Server Compact 3.5 Database dialog box are as described in the following list.
    Platform Default: When you create or upgrade SQL Server Compact databases, Encryption mode will select the default encryption for the operating system. If you create a database on one of the newer platforms shown here, older platforms (such as Windows CE 4.2 or Windows Mobile 2003) will be unable to open encrypted SQL Server Compact files. The older platforms do not support the newer encryption algorithms.
    • Windows CE 5.0
    • Windows CE 6.0
    • Windows Mobile 5.0
    • Windows Mobile 6.0
    • Windows XP
    • Windows Server 2003
    • Windows Vista

    For example, if the database is created on Windows XP, it will select encryption for Windows XP. The encrypted database created on Windows XP with the Platform Default option cannot be opened on Windows CE 4.2 or Windows Mobile 2003 for Pocket PC.

    Engine Default: By default, the encryption mode for the SQL Server Compact 3.5 database file will not work on Windows CE 4.2 or Windows Mobile 2003 Software for Pocket PC. This encryption mode will work on all newer SQL Server Compact 3.5 supported platforms.
    • Windows CE 5.0
    • Windows CE 6.0
    • Windows Mobile 5.0
    • Windows Mobile 6.0
    • Windows XP
    • Windows Server 2003
    • Windows Vista
    PPC2003 Compatibility: While less secure, this option can be used to support older and newer operating systems including:
    • Windows CE 4.2
    • Windows Mobile 2003 Software for Pocket PC
    • Windows CE 5.0
    • Windows CE 6.0
    • Windows Mobile 5.0
    • Windows Mobile 6.0
    • Windows XP
    • Windows Server 2003
    • Windows Vista

Tools Support

  1. The Visual Basic Express Edition and Visual C# Express Edition of Visual Studio 2008 now fully support SQL Server Compact 3.5-based applications for Windows desktop computers.
  2. Enhanced SQL Server Compact 3.5 Table Designer in Visual Studio 2008 provides a user interface for creating primary key and foreign key relationships between tables.

Core Database Functionality

  1. Implements the timestamp (rowversion) data type.
  2. Support for Transact-SQL statements has been extended as follows:
    • Nested query in FROM clause
    • CROSS APPLY and OUTER APPLY
    • CAST and DECIMAL
    • TOP
    • SET IDENTITY INSERT

Data Synchronization

  1. SQL Server Compact 3.5 now includes a new developer oriented, componentized synchronization model by using Synchronization Services for ADO.NET, available for Windows desktop computers only.
  2. Server Tools for configuring Merge Replication and RDA by using SQL Server Compact 3.5 can be downloaded from the Microsoft Download Center. Note that SQL Server Compact 3.5 Server Tools cannot be installed side-by-side with earlier versions of Server Tools on the computer that is acting as the IIS server. SQL Server Compact 3.5 Server Tools can replicate data between SQL Server Compact 3.5 and SQL Server 2005 and later versions. The Server tools can also support synchronization between SQL Server 2005 and SQL Server Compact 3.1. SQL Server Compact 3.5 Server Tools also supports data replication between SQL Server 2005 Compact Edition or SQL Server 2005 Mobile Edition and SQL Server 2005 and later versions.

Programmability

  1. Supports local TransactionScope on Windows desktop computers.
  2. SQL Server Compact 3.5 supports LINQ to SQL. LINQ to SQL is a component of the LINQ project. It provides a run-time infrastructure for managing relational data as objects, without giving up the ability to query. It translates language-integrated queries into Transact-SQL for execution by SQL Server Compact 3.5, and then translates the tabular results back into the objects as defined by the application developer. There is no designer support for SQL Server Compact 3.5 in LINQ to SQL. The SqlMetal.exe utility must be used for SQL Server Compact 3.5. For more information, see the documentation.

[Top]

1.2 Obtaining SQL Server Compact 3.5

1.3 SQL Server Compact 3.5 Books Online

SQL Server Compact 3.5 Books Online provides detailed information about the development, administration, and deployment of SQL Server Compact 3.5 on Windows desktop computers, and on Windows Mobile devices. SQL Server Compact 3.5 Books Online is available for download at the Microsoft Download Center.

After you install SQL Server Compact Books Online, it is available on the Start menu as a stand-alone Help collection. To access this collection from the Visual Studio 2008 documentation and to access F1 Help from Visual Studio 2008, you must add the collection to the Visual Studio Combined Help Collection.

Important:
All references to SQL Server 2008 in the SQL Server Compact 3.5 documentation refer to a pre-release version of SQL Server 2008.

1.4 Microsoft Synchronization Services for ADO.NET

2.0 Installing and Uninstalling SQL Server Compact 3.5

This section contains installation-related information.

2.1 Installing and Uninstalling SQL Server Compact 3.5 Runtime on Mobile Devices

SQL Server Compact 3.5 can be deployed on Windows Mobile devices either by manually copying and installing the CAB files, or through Visual Studio. The SSCEDeviceRuntime-ENU.msi file puts the SQL Server Compact 3.5 CAB files for deploying SQL Server Compact 3.5 on the Windows Mobile devices. The CAB files are put into the folder: %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices\platform\processor. The cab files description is as follows:

  • SQL Server Compact 3.5 Core (sqlce.platform.processor.cab):
    The sqlce.platform.processor.cab file contains sqlcese35.dll, sqlceqp35.dll, sqlceme35.dll, and System.Data.SqlServerCe.dll.
  • SQL Server Compact 3.5 Replication (sqlce.repl.platform.processor.cab):
    The sqlce.repl.platform.processor.cab file contains sqlceca35.dll, sqlceoledb35.dll, and sqlcecompact35.dll.
  • SQL Server Compact 3.5 Tools EN (sqlce.dev.lang.platform.processor.cab):
    The sqlce.dev.lang.platform.processor.cab file contains isqlw35.exe, a program that implements SQL Server Compact 3.5 Query Analyzer. It also contains sqlceerr35lang.dll, which provides error descriptions for use during development. To use SQL Server Compact 3.5 Query Analyzer, install sqlce.repl.platform.processor.cab.

To Uninstall SQL Server Compact 3.5 from a Mobile Device

  1. Click Start, click Settings, click System, and then click Remove Programs.
  2. To uninstall SQL Server Compact 3.5 components, from the list of installed programs, select the components to uninstall.
    • SQL Server Compact 3.5 Core
    • SQL Server Compact 3.5 Tools
    • SQL Server Compact 3.5 Repl
  3. Click Remove.

2.2 Installing and Uninstalling SQL Server Compact 3.5 Runtime on Windows Desktop Computers

SQL Server Compact 3.5 has a separate installer (SSCERuntime-ENU.msi) for Windows desktop computers. SQL Server Compact 3.5 installs with Visual Studio 2008 or it can be downloaded from Microsoft Download Site.

What to consider when you install SQL Server Compact 3.5:

  • To install or uninstall SQL Server Compact 3.5, you must be an administrator on the Windows desktop computer.
  • .NET Framework 2.0 or a later version is required before you install SQL Server Compact 3.5 for managed code development. You can download the .NET Framework 2.0 from .NET Framework 2.0 Download Center. Native developers can use OLEDB without requiring the .NET Framework.

To Uninstall SQL Server Compact 3.5

  1. In Control Panel, double-click Add or Remove Programs.
  2. From the list of installed programs, select Microsoft SQL Server Compact 3.5.
  3. Click Remove.

2.3 Installing and Uninstalling SQL Server Compact 3.5 Server Tools

Server Tools for SQL Server Compact 3.5 can be downloaded from the Microsoft Download Center. SQL Server Compact 3.5 Server Tools cannot be installed side-by-side with earlier versions of Server Tools on the server that is running IIS.

For more information about how to install and configure a server environment for Remote Data Access or merge replication, see "Installing a Server Environment" and "Configuring and Securing Server Environment" in SQL Server Compact 3.5 Books Online.

To Uninstall SQL Server Compact 3.5 Server Tools

  1. In Control Panel, double-click Add or Remove Programs.
  2. From the list of installed programs, select Microsoft SQL Server Compact 3.5 Server Tools.
  3. Click Remove.

After uninstalling, restart IIS or restart the server that is running IIS.

[Top]

3.0 Supported Operating Systems and Platforms for SQL Server Compact 3.5

This release of SQL Server Compact 3.5 supports the following operating systems.

Windows Desktop Computers

  • Microsoft Windows XP Professional SP2
  • Microsoft Windows XP Home Edition SP2
  • Microsoft Windows XP Media Center Edition 2004 SP2
  • Microsoft Windows XP Media Center Edition 2005
  • Microsoft Windows XP Tablet PC Edition SP2
  • Microsoft Windows XP Embedded SP2
  • Microsoft Windows XP Professional x64 SP2 (WOW),
  • Windows Embedded for Point of Service SP2
  • Microsoft Windows Server 2003, Standard Edition SP2
  • Microsoft Windows Server 2003, Enterprise Edition SP2
  • Microsoft Windows Server 2003, Datacenter Edition SP2
  • Microsoft Windows Server 2003 R2, Standard Edition
  • Microsoft Windows Server 2003 R2, Enterprise Edition
  • Microsoft Windows Server 2003 R2, Datacenter Edition
  • Microsoft Windows Server 2003 x64, Standard Edition (WOW)
  • Microsoft Windows Server 2003 x64, Enterprise x64 Edition (WOW)
  • Microsoft Windows Server 2003 x64, Datacenter Edition (WOW)
  • Microsoft Windows Server 2003 R2 x64, Standard Edition (WOW)
  • Microsoft Windows Server 2003 R2 x64, Enterprise Edition (WOW)
  • Microsoft Windows Server 2003 R2 x64, Datacenter Edition (WOW)
  • Windows Vista Home Basic
  • Windows Vista Home Premium
  • Windows Vista Business
  • Windows Vista Enterprise
  • Windows Vista Ultimate
  • Windows Vista Starter Edition
  • Windows Vista Home Basic x64 (WOW)
  • Windows Vista Home Premium x64 (WOW)
  • Windows Vista Business x64 (WOW)
  • Windows Vista Enterprise x64 (WOW)
  • Windows Vista Ultimate x64 (WOW)

Windows Mobile Devices

4.0 Deploying SQL Server Compact 3.5 Applications

This section describes support for deploying SQL Server Compact 3.5 applications.

4.1 SQL Server Compact 3.5 Windows Desktop Deployment Support in Visual Studio

4.2 SQL Server Compact 3.5 Windows Mobile Device Deployment Support in Visual Studio

You can use Visual Studio to deploy a SQL Server Compact 3.5 application to either an emulator or a device in the following ways.

A Pocket PC 2003 application can be deployed on the following:

  • Pocket PC 2003 device
  • Pocket PC 2003 emulator
  • Pocket PC 2003 SE VGA emulator

A Windows CE 5.0 application can be deployed on the following:

  • Windows Mobile Version 5.0 Pocket PC device
  • Windows Mobile Version 5.0 Pocket PC emulator
  • Windows Mobile Version 5.0 Pocket PC Phone Edition GSM (virtual radio) emulator
  • Windows Mobile Version 5.0 Pocket PC Phone Edition GSM VGA (virtual radio) emulator
  • Windows Mobile Version 5.0 Pocket PC VGA emulator
  • Windows Mobile Version 5.0 Smartphone device
  • Windows Mobile Version 5.0 Smartphone GSM (virtual radio) emulator
  • Windows Mobile Version 5.0 Smartphone GSM QVGA (virtual radio) emulator
  • Windows CE 5.0 devices

A Windows Mobile Version 5.0 Pocket PC application can be deployed on the following:

  • Windows Mobile Version 5.0 Pocket PC device
  • Windows Mobile Version 5.0 Pocket PC emulator
  • Windows Mobile Version 5.0 Pocket PC Phone Edition GSM (virtual radio) emulator
  • Windows Mobile Version 5.0 Pocket PC Phone Edition GSM VGA (virtual radio) emulator
  • Windows Mobile Version 5.0 Pocket PC VGA emulator

A Windows Mobile Version 5.0 Smartphone application can be deployed on the following:

  • Windows Mobile Version 5.0 Smartphone device
  • Windows Mobile Version 5.0 Smartphone GSM (virtual radio) emulator
  • Windows Mobile Version 5.0 Smartphone GSM QVGA (virtual radio) emulator

A Windows Mobile Version 6.0 application can be deployed on the following:

  • Windows Mobile 6 Standard
  • Windows Mobile 6 Standard Landscape QVGA
  • Windows Mobile 6 Standard QVGA
  • Windows Mobile 6 Classic
  • Windows Mobile 6 Professional
  • Windows Mobile 6 Professional Square
  • Windows Mobile 6 Professional Square QVGA
  • Windows Mobile 6 Professional Square VGA
  • Windows Mobile 6 Professional VGA

[Top]

4.3 SQL Server Compact 3.5 Deployment on Windows Desktop and Windows Mobile

SQL Server Compact 3.5 can be installed on Windows Desktop computers by using the SSCERuntime-<lang>.msi or by deploying the SQL Server Compact 3.5 components (DLL's) in the application folder. On Windows Mobile devices, SQL Server Compact 3.5 can be deployed by using the CAB files or by deploying the SQL Server Compact components (DLL's) in the application folder. If SQL Server Compact 3.5 components are deployed in the application folder, application developers will have to service the SQL Server Compact components with the SQL Server Compact updates and service releases. For more information on servicing, see Microsoft Web Site.

5.0 Known Issues

  1. Upgrading to the release version of SQL Server Compact 3.5 from SQL Server Compact 3.5 CTP or SQL Server Compact 3.5 beta versions is not supported.

    Upgrading from the CTP and beta versions of SQL Server Compact 3.5 to the release version is not supported. Uninstalling the CTP or beta version of Visual Studio 2008 does not uninstall SQL Server Compact 3.5. You must remove the CTP or beta installations of SQL Server Compact 3.5 manually before you install the release version of Visual Studio 2008, as follows:
    1. Uninstall the CTP or beta version of Visual Studio 2008.
    2. On Windows Vista, click Start, then Control Panel, and then double-click Programs and Features. Uninstall all CTP and beta installations of SQL Server Compact 3.5, SQL Server Compact 3.5 for Devices and SQL Server Compact 3.5 Design Tools.
    3. On Windows XP or Windows Server 2003, click Start, then Control Panel, and then double-click Add or Remove Programs. Uninstall all CTP and beta installations of SQL Server Compact 3.5, SQL Server Compact 3.5 for Devices and SQL Server Compact 3.5 Design Tools.

  2. SQL Server Compact 3.5 does not use the Encrypt property of the SqlCeConnection class.

    The Encrypt property of the SqlCeConnection class should not be used.
    Note:
    Encrypt property will be deprecated in a future release. The property is retained in SQL Server Compact 3.5 only for backward compatibility.

    Use the Encryption Mode property of the SqlCeConnection class to encrypt SQL Server Compact 3.5 database files. Uses of encryption mode with examples are given below:

    1. To create a new encrypted SQL Server Compact 3.5 database:
      C#:
      SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
      engine.CreateDatabase();
      Visual Basic:
      Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
      engine.CreateDatabase()
    2. To upgrade a SQL Server 2005 Compact Edition (version 3.1) or SQL Server 2005 Mobile Edition (version 3.0) database to an encrypted SQL Server Compact 3.5 database:
      C#:
      SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;");
      engine.Upgrade ("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
      Visual Basic:
      Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;")
      engine.Upgrade("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
    3. To change the encryption mode of an existing SQL Server Compact 3.5 database:
      C#:
      SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;");
      engine.Compact("Data Source=Northwind.sdf;encryption mode=ppc2003 compatibility;Password=<enterStrongPasswordHere>;");
      Visual Basic:
      Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;") 
      engine.Compact("Data Source=Northwind.sdf;encryption mode=ppc2003 compatibility;Password=<enterStrongPasswordHere>;")
    4. To encrypt an unencrypted SQL Server Compact 3.5 database:
      C#:
      SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf");
      engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
      Visual Basic:
      Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;") 
      engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
      
  3. While upgrading Visual Studio 2005 to Visual Studio 2008, encrypted SQL Server Compact database is not upgraded and ClickOnce applications must be re-published.

    Database files (*.sdf) created by earlier version of SQL Server Compact are not compatible with SQL Server Compact 3.5. Only unencrypted database files from earlier versions of SQL Server Compact are upgraded when a Visual Studio 2005 project is upgraded to Visual Studio 2008. Encrypted database files have to be manually upgraded. If the Visual Studio 2005 project uses ClickOnce to publish applications, the application should be re-published after the project has been upgraded in Visual Studio 2008.

    The encrypted database files can be manually upgraded by using the following steps:
    1. Click Data.
    2. Click Add New Data Source.
    3. Click Add Connection.
      If an earlier version of the database file is opened, a message appears. If you click OK, the Upgrade to SQL Server Compact 3.5 Database dialog box appears.
      Alternatively the SqlCeEngine.Upgrade API can be used for programmatic scenarios. Code sample is shown below:
      C#:
      SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;");
      engine.Upgrade ("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
      Visual Basic:
      Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;")
      engine.Upgrade("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
    If the project uses ClickOnce to publish applications, the application should be re-published after it has been upgraded in Visual Studio 2008. When you re-publish the ClickOnce application in Visual Studio 2008, you might see a warning that SQL Server 2005 Compact Edition prerequisite could not be found for bootstrapping. The warning should be ignored.

  4. SQL Server Compact 3.5 data types for parameters like SqlDbType or DbType should be explicitly set.

    If the data types for parameters such as SqlDbType or DbType are not explicitly set, an exception will be thrown. To resolve this issue, explicitly set the data type for parameters such as SqlDbType or DbType. This is critical in case of BLOB data types (image and ntext). A code example is given below:
    C#:
    SqlCeEngine engine = new SqlCeEngine(connString);
    engine.CreateDatabase();
    engine.Dispose();
    
    SqlCeConnection conn = new SqlCeConnection(connString);
    conn.Open();
    
    SqlCeCommand cmd = conn.CreateCommand();
    cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);";
    cmd.ExecuteNonQuery();
    
    cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);";
    SqlCeParameter paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128);
    SqlCeParameter paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText);
    paramName.Value = "Name1";
    paramBlob.Value = "Name1".PadLeft(4001);
    
    cmd.ExecuteNonQuery();
    Visual Basic:
    Dim engine As SqlCeEngine = New SqlCeEngine(connString)
    engine.CreateDatabase()
    engine.Dispose()
    
    Dim conn As SqlCeConnection = New SqlCeConnection(connString)
    conn.Open()
    
    Dim cmd As SqlCeCommand = conn.CreateCommand()
    cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);"
    cmd.ExecuteNonQuery() 
    
    cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);"
    Dim paramName As SqlCeParameter
    Dim paramBlob As SqlCeParameter
    paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128)
    paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText)
    paramName.Value = "Name1"
    paramBlob.Value = "Name1".PadLeft(4001)
    
    cmd.ExecuteNonQuery()
    
  5. SQL Server Compact 3.5 Books Online (BOL) and Microsoft Synchronization Services for ADO.NET v1.0 BOL available as a Web download only.

    SQL Server Compact 3.5 BOL and Microsoft Synchronization Services for ADO.NET v1.0 BOL are available as a Web download only and do not ship with Visual Studio 2008.
    To access these collections from the Visual Studio 2008 documentation and to access F1 Help from Visual Studio 2008, you must add these collections to the Visual Studio Combined Help Collection. To do that, download
    SQL Server Compact 3.5 Books Online and Microsoft Synchronization Services for ADO.Net . After downloading and installing the SQL Server Compact 3.5 Books Online and Microsoft Synchronization Services for ADO.NET v1.0 Books Online, close all instances of the Visual Studio Combined Help Collection and Visual Studio 2008. Then, click Start, point to All Programs, Microsoft Visual Studio 2008, and then click Microsoft Visual Studio 2008 Documentation to re-open the Visual Studio Combined Help Collection. SQL Server Compact 3.5 Books Online and Microsoft Synchronization Services for ADO.NET v1.0 Books Online should be available in the Table of Contents, Index, Search, and F1 Help for code and the user interface.

[Top]

6.0 Additional Information