Export (0) Print
Expand All

You can explicitly specify the location and size of the temporary database by using the Microsoft SQL Server Compact 3.5 Replication and Remote Data Access objects. To specify the location, add the temp path, temp file directory, or ssce:temp file directory parameter to the connection string (set with either SqlCeReplication.SubscriberConnectionString or SqlCeRemoteDataAccess.LocalConnectionString). To specify the size, add the temp file max size parameter.

The location you specify for the temporary database must already exist.

The following example shows how to use the SubscriberConnectionString property in the Replication object to set the location of the temporary database.

SqlCeReplication ceRepl = new SqlCeReplication();
ceRepl.SubscriberConnectionString = @"Persist Security Info = False;
   Temp File Directory = '\TempDB\'; Temp File Max Size = 256;
   Data Source = 'SalesData.sdf';
   Password = '<enterStrongPasswordHere>'; File Mode = 'shared read';
   Max Database Size = 256; Max Buffer Size = 1024";

The following example shows how to use the LocalConnectionString property in the RemoteDataAccess object to set the location of the temporary database.

SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
rda.LocalConnectionString = @"Persist Security Info = False;
   Temp Path = '\TempDB\'; Data Source = 'SalesData.sdf';
   Password = '<enterStrongPasswordHere>'; File Mode = 'shared read';
   Max Database Size = 256; Max Buffer Size = 1024";

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft