Installing on a Desktop and a Tablet PC (SQL Server Compact Edition)
Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) is the next version of Microsoft SQL Server 2005 Mobile Edition (SQL Server Mobile). SQL Server Compact Edition is available for use on desktop computers without the need for installing Visual Studio 2005 or SQL Server 2005. The SQL Server Compact Edition installer for desktop computers and Tablet PC computers (SQLServerEv31-EN.msi) contains runtime binary files for desktop and Tablet PC computers only. The installer contains the following libraries:
- SQLCEOLEDB30.DLL (OLEDB data provider)
- System.Data.SqlServerCe.dll (ADO.NET data provider)
The SQL Server Compact Edition installer for desktop and Tablet PC release does not include the CAB files for installing SQL Server Compact Edition on mobile devices or the SQL Server Compact Edition Server Tools (also referred to as connectivity components).
Unless you are using the OLEDB data provider, the Microsoft .NET Framework 2.0 or a later version is required to install SQL Server Compact Edition. You can download the .NET Framework 2.0 from the .NET Framework 2.0 Download Center.
The following software is not required to install SQL Server Compact Edition on desktop and Tablet PC computers because this installer has runtime binary files only:
- Internet Information Services (IIS) 5.x or later versions of IIS (32-bit only)
- ActiveSync 4.0 or later version
- Internet Explorer 6.0
- Neither Visual Studio nor SQL Server is required to install SQL Server Compact Edition on desktop and Tablet PC computers.
To replicate data between SQL Server and SQL Server Compact Edition, you must install replication components. For more information about SQL Server replication components, see Hardware and Software Requirements. You must also install the server tools (Sqlce30setupen.msi). For more information about the server tools, see Connectivity Tools.
The SQL Server Compact Edition installer for desktop and Tablet PC computers installs SQL Server Compact Edition in a fixed location. The fixed installation location provides serviceability support for SQL Server Compact Edition. The SQL Server Compact Edition Setup program will install the managed assemblies, such as System.Data.SqlServerCe.dll, in the global assembly cache (GAC), and register native DLLs, such as OLE DB Provider (sqlceoledb30.dll), in the registry. Because of the registry installation, SQL Server Compact Edition can only be installed by a user with administrative credentials. SQL Server Compact Edition is installed at the following location:
%Program Files%\Microsoft SQL Server Compact Edition \v3.1
If program files directory is in the C drive, SQL Server Compact Edition runtime binaries will be installed in the C:\Program Files\Microsoft SQL Server Compact Edition \v3.1 directory.
After you install SQL Server Compact Edition, you can see the program in Add or Remove Programs as Microsoft SQL Server 2005 Compact Edition.
DataDirectory is a substitution string that indicates the path of the database. DataDirectory makes it easy to share a project and to deploy an application by eliminating the need to hard-code the full path. For example, instead of having the following connection string:
"Data Source= c:\program files\MyApp\Mydb.sdf"
By using |DataDirectory| (enclosed in pipe symbols as shown), you can have the following connection string:
"Data Source = |DataDirectory|\Mydb.sdf"
You set the DataDirectory property on the AppDomain by calling AppDomain.SetData.
AppDomain.SetData is not supported by the .NET Compact Framework. However, the .NET Compact Framework data provider is required to create applications for mobile devices. Therefore, if DataDirectory property is used when you program applications for mobile devices, SQL Server Compact Edition returns an error.
If you do not set the DataDirectory property, the following default rules will be applied to access the database folder path:
- For applications that are put in a directory on the client computer, the path of the database will be the folder in which the application is put. For example, if MyApp.exe is put in the /MyDir folder, the /MyDir folder will be accessed.
- For applications that run under ClickOnce, a data folder is created for that purpose and will be accessed.
- For Web applications, the App_Data folder will be accessed. You can set DataDirectory to App_Data folder by using AppDomain.SetData.