<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Microsoft SQL Server Product Samples: Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Project/ProjectRss.aspx</link><description>This project contains Replication samples released with Microsoft SQL Server product.   </description><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=Home&amp;version=23</link><description>&lt;div class="wikidoc"&gt;
&lt;a href="http://CodePlex.com/SqlServerSamples" class="externalLink"&gt;SQL Server Samples Portal Page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; &amp;gt; SQL Server Replication Product Samples&lt;br /&gt; &lt;br /&gt;Replication is a set of technologies for copying and distributing data and database objects from one database to another and then synchronizing between databases to maintain consistency. Using replication, you can distribute data to different locations and to remote or mobile users over local and wide area networks, dial-up connections, wireless connections, and the Internet.&lt;br /&gt; &lt;br /&gt;This project contains Replication samples released with Microsoft SQL Server product. Below is the list of these samples. If you are interested in contributing Replication samples, please let us know by posting in the developers' forum.&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;SQL Server 2008&lt;/b&gt; samples &lt;a href="/MSFTReplProdSamples/Release/ProjectReleases.aspx" class="externalLink"&gt;download&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;SQL Server 2005&lt;/b&gt; samples &lt;a href="/MSFTReplProdSamples/Release/ProjectReleases.aspx?ReleaseId=4040" class="externalLink"&gt;download&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;For information about how to use CodePlex to access SQL Server samples, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=HowToUseCodePlex&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;To download samples databases, click &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then click the appropriate MSI file.&lt;br /&gt;For release notes and brief descriptions of all the sample databases and code, including restrictions on SQL Express and Vista, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=SQLServerDatabasesandSamplesOverview&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Sales Orders Mobile Replication Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Sales Orders Sample for Merge Replication &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Subscriber Monitor Utility Sample for Merge Replication &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>ReedMe</author><pubDate>Wed, 27 Aug 2008 23:55:28 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20080827115528P</guid></item><item><title>Closed Issue: Problem with install SampleDB</title><link>http://www.codeplex.com/MSFTReplProdSamples/WorkItem/View.aspx?WorkItemId=3248</link><description>While install SampleDB I&amp;#39;ve received the Error 1721&amp;#58; There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action&amp;#58; InstallDatabase, location&amp;#58; C&amp;#58;&amp;#92;AdventureWorks_Log.idf&amp;#39;&amp;#41; FOR ATTACh&amp;#59;&amp;#34;&lt;br /&gt;&lt;br /&gt;What can I do&amp;#63;&lt;br /&gt;&lt;br /&gt;My OS&amp;#58; Windows 2000,&lt;br /&gt;SQL&amp;#58; Microsoft SQL Server 2005 Express Edition&lt;br /&gt;SampleDB&amp;#58;AdventureWorksDB.msi &amp;#40;http&amp;#58;&amp;#47;&amp;#47;www.codeplex.com&amp;#47;MSFTDBProdSamples&amp;#47;Release&amp;#47;ProjectReleases.aspx&amp;#63;ReleaseId&amp;#61;5705&amp;#41;&lt;br /&gt;Comments: Issues with AdventureWorks should be open @ connect.microsoft.com or http://www.codeplex.com/MSFTDBProdSamples/</description><author>ReedMe</author><pubDate>Tue, 12 Aug 2008 21:37:29 GMT</pubDate><guid isPermaLink="false">Closed Issue: Problem with install SampleDB 20080812093729P</guid></item><item><title>Updated Wiki: SS2008!Subscriber Monitor Utility Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008!Subscriber Monitor Utility Sample for Merge Replication&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Subscriber Monitor Utility Merge Replication Sample
&lt;/h2&gt; &lt;br /&gt; 08/06/2008 01:27:32&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The Subscriber Monitor Utility sample is a Windows application that demonstrates how the Subscriber-side monitoring functionality provided by Replication Management Objects (RMO) is used to monitor merge subscriptions at the Subscriber. This sample solution can be built and run standalone at the Subscriber (using SubscriberMonitorUtility.exe). The SubscriberMonitor.dll assembly is also used by the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication"&gt;Readme_Sales Orders Merge Replication Sample&lt;/a&gt; to display subscription status.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A replication topology is generally monitored at the Publisher or Distributor. The Microsoft SQL Server&amp;nbsp;Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused view of all replication activity. For more information, see &lt;b&gt;Monitoring Replication with Replication Monitor&lt;/b&gt;. SQL Server Management Studio provides access to Replication Monitor. However, merge replication is designed specifically to support disconnected clients. Because it is still necessary to monitor the status of a subscription, even when the Subscriber is disconnected from the Publisher, RMO provides classes that enable this Subscriber-side monitor functionality.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Subscriber Monitor Utility sample primarily demonstrates the facilities of RMO for monitoring merge subscriptions at the Subscriber. This sample is designed to run at a server that subscribes to a merge publication. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft SQL Server 2005 or later version, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Engine Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Tools  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server samples. These samples are available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;This sample uses Windows Authentication. To run the sample, your Windows account must be a member of the &lt;b&gt;replmonitor&lt;/b&gt; fixed database role or the &lt;b&gt;db_owner&lt;/b&gt; fixed database role on the subscription database. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample solution, you will need to do the following:&lt;br /&gt;  To build the Subscriber Monitor Utility sample Install the replication samples. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:sn -k SampleKey.snkNote:  You can skip this step if this key was previously created for use with another sample. Navigate to the SubscriberMonitorUtility folder in the replication samples directory and open the SubscriberMonitorUtility.sln solution file in Visual Studio. The location of this folder for a default installation is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SubscriberMonitorUtility\CS. Build the solution.  &lt;br /&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, you need to navigate to the location of the built executable and run it.&lt;br /&gt;  To run the Subscriber Monitor Utility sample at the Subscriber Start SubscriberMonitorUtility.exe from Visual Studio or from the command prompt. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.Select a subscription to monitor from the Available Subscriptions drop-down list box.(Optional) Click the Edit button to change subscription properties.Click Connect. Select a Merge Agent session from the Merge Sessions tree view. (Optional) Click the Refresh button to refresh the session list. &lt;br /&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They have not been tested in nor are they intended to be used in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;How to: Programmatically Monitor Replication (RMO Programming)&lt;/b&gt;  &lt;b&gt;Developer InfoCenter (Replication)&lt;/b&gt;  &lt;b&gt;Using the Subscriber Monitor Sample&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:31:22 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Subscriber Monitor Utility Sample for Merge Replication 20080807083122A</guid></item><item><title>Updated Wiki: SS2005!Subscriber Monitor Utility Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005!Subscriber Monitor Utility Sample for Merge Replication&amp;version=14</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Subscriber Monitor Utility Sample for Merge Replication
&lt;/h2&gt; &lt;br /&gt;  &lt;br /&gt; Updated: &lt;b&gt; 5 December 2005 &lt;/b&gt;&lt;br /&gt;The Subscriber Monitor Utility sample is a Windows application that demonstrates how the Subscriber-side monitoring functionality provided by Replication Management Objects (RMO) is used to monitor merge subscriptions at the Subscriber. This sample solution can be built and run standalone at the Subscriber (using SubscriberMonitorUtility.exe). The SubscriberMonitor.dll assembly is also used by the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt; to display subscription status.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A replication topology is generally monitored at the Publisher or Distributor. The Microsoft&amp;nbsp;SQL Server&amp;nbsp;Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused view of all replication activity. For more information, see &lt;b&gt;Monitoring Replication with Replication Monitor&lt;/b&gt;. SQL Server Management Studio provides access to Replication Monitor. However, merge replication is designed specifically to support disconnected clients. Because it is still necessary to monitor the status of a subscription, even when the Subscriber is disconnected from the Publisher, RMO provides classes that enable this Subscriber-side monitor functionality.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Subscriber Monitor Utility sample primarily demonstrates the facilities of RMO for monitoring merge subscriptions at the Subscriber. This sample is designed to run at a server that subscribes to a merge publication. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft SQL Server 2005, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Connectivity Components  &lt;/li&gt;&lt;li&gt; Programming Models  &lt;/li&gt;&lt;li&gt; Development Tools (including SDK)  &lt;/li&gt;&lt;li&gt; Samples  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;This sample uses Windows Authentication. To run the sample, your Windows account must be a member of the &lt;b&gt;replmonitor&lt;/b&gt; fixed database role or the &lt;b&gt;db_owner&lt;/b&gt; fixed database role on the subscription database. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample solution, you will need to do the following:&lt;br /&gt;  To build the Subscriber Monitor Utility sample Install the replication samples. For more information, see Installing Samples.At the command prompt, navigate to the SQL Server 2005 samples installation directory. The default is C:\Program Files\Microsoft SQL Server\90\Samples. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:sn -k SampleKey.snkNote:  You can skip this step if this key was previously created for use with another sample. Navigate to the SubscriberMonitorUtility folder in the replication samples directory and open the SubscriberMonitorUtility.sln solution file in Microsoft Visual Studio 2005. The location of this folder for a default installation is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SubscriberMonitorUtility\CS. Build the solution.  &lt;br /&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, you need to navigate to the location of the built executable and run it.&lt;br /&gt;  To run the Subscriber Monitor Utility sample at the Subscriber Start SubscriberMonitorUtility.exe from Visual Studio 2005 or from the command prompt. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.Select a subscription to monitor from the Available Subscriptions drop-down list box.(Optional) Click the Edit button to change subscription properties.Click Connect. Select a Merge Agent session from the Merge Sessions tree view. (Optional) Click the Refresh button to refresh the session list. &lt;br /&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They have not been tested in nor are they intended to be used in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Change History
&lt;/h3&gt;  &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Release &lt;/th&gt;&lt;th&gt;  History  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; &lt;b&gt; 5 December 2005 &lt;/b&gt;&lt;/td&gt;&lt;td&gt;  Changed content: Updated key creation and deployment information to reflect sample updates.  &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &amp;#169; 2007 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:31:02 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2005!Subscriber Monitor Utility Sample for Merge Replication 20080807083102A</guid></item><item><title>Updated Wiki: SS2008!Sales Orders Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008!Sales Orders Sample for Merge Replication&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Sales Orders Merge Replication Sample
&lt;/h2&gt; &lt;br /&gt; 08/06/2008 01:27:32&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This readme file details how to install and run the Sales Orders sample. This file also details any known issues with the sample.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;This sample highlights a merge replication topology for delivering data to mobile users, and it also demonstrates the programmability features of merge replication in SQL Server. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. This sample is supported for Subscribers running all editions of SQL Server. The publication also supports SQL Server Compact 3.5 Subscribers. For more information about this sample scenario, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;&lt;li&gt; Transact-SQL   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Sales Orders sample demonstrates the following features of merge replication:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Replication Management Objects (RMO).  &lt;/li&gt;&lt;li&gt; Parameterized row filters.  &lt;/li&gt;&lt;li&gt; Precomputed partitions.  &lt;/li&gt;&lt;li&gt; Client-requested partitioned snapshot.  &lt;/li&gt;&lt;li&gt; Article type-based performance optimizations.  &lt;/li&gt;&lt;li&gt; SQL Server Compact 3.5 and SQL Server Express Subscribers.  &lt;/li&gt;&lt;li&gt; Automatic identity range management.  &lt;/li&gt;&lt;li&gt; Business logic handlers.  &lt;/li&gt;&lt;li&gt; Web synchronization (optional).  For more information about how these replication features are demonstrated in the sample, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;This sample is supported only on default installations of SQL Server. Named instances are not supported. Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2005 or later version, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Engine Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Tools  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server samples. These samples are available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions needed to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat, which configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot, your Windows account must be a member of the  sysadmin  fixed server role at the Publisher.   &lt;/li&gt;&lt;li&gt; The Sales Orders sample does various Database Engine and replication tasks, including creating the  AdventureWorksLocal  database, creating the local Subscription, and running the Merge Agent to initialize, reinitialize or synchronize the subscription. In order to successfully run the sample executable (SalesOrders.exe) at the Subscriber, your Windows account must have at least CREATE DATABASE permissions at the Subscriber.   &lt;b&gt;Note:   When the local database and subscription exists, your Windows account must be at least a member of the  db_owner  fixed database role on the  AdventureWorksLocal  database at the Subscriber to run the application.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; To initialize the subscription and synchronize with the Publisher, the Windows account used to connect to the Publisher (or with the Web server when using Web synchronization) must meet the following requirements:  &lt;/li&gt;&lt;li&gt; Have a valid login at the Publisher associated with a user in the publication database.  &lt;/li&gt;&lt;li&gt; Have a valid login at the Distributor associated with a user in the distribution database (of the guest user).  &lt;/li&gt;&lt;li&gt; Be a member of the publication access list (PAL) for the AdvWorksSalesOrders publication.   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample project and configure the replication topology, you will need to do the following:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; At the Publisher, run the replication installation script.  &lt;/li&gt;&lt;li&gt; (Optional) Configure the Internet Information Services (IIS) server to support Web synchronization for merge replication. If this is not done, you cannot use the Web synchronization feature of the sample.   &lt;/li&gt;&lt;li&gt; At the Subscriber, modify the configuration settings in the app.config file of the sample.  &lt;/li&gt;&lt;li&gt; At the Subscriber, build the sample using Visual Studio 2005 or the .NET Framework 2.0 SDK.  &lt;/li&gt;&lt;li&gt; At the Subscriber, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory. When using Web synchronization, you must also place a copy of BusinessLogic.dll in the C:\Program Files\Microsoft SQL Server\100\COM directory on the Web server.  &lt;/li&gt;
&lt;/ul&gt;&lt;h6&gt;
To configure the Sales Orders sample at the Publisher
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that the &lt;b&gt;AdventureWorks&lt;/b&gt; sample database has been installed and the database is attached. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;Ensure that the SQL Server Database Engine samples have been installed. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;Ensure that SQL Server Agent is running. You can view the status of and start this service from &lt;b&gt;Object Explorer&lt;/b&gt; in SQL Server Management Studio. &lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;(Optional) Configure Secure Sockets Layer (SSL) at the Publisher or at the server used for Web synchronization. SSL is required for communication between the IIS server and all Subscribers. To configure SSL, specify a server certificate for the IIS server to use. &lt;/li&gt;&lt;li&gt;Execute InstallSalesOrdersSample.bat and when prompted enter the login (in the case-sensitive format &amp;quot;DOMAIN\login&amp;quot;) and password for the Windows account under which the Snapshot Agent job will run. This calls sqlcmd.exe to execute CreateAdvWorksSalesOrdersPublication.sql, which does the following:&lt;/li&gt;&lt;li&gt; Checks that replication has been configured on the local server, and if not configures it as a Publisher with local Distributor using the distribution database.   &lt;/li&gt;&lt;li&gt; Drops and re-creates the stored procedures and user-defined functions used for data access at the client.  &lt;/li&gt;&lt;li&gt; Drops and re-creates the AdvWorksSalesOrders Publication.  &lt;/li&gt;&lt;li&gt; Adds articles to the publication.  &lt;/li&gt;&lt;li&gt; Registers the business logic handler at the Distributor.  &lt;/li&gt;&lt;li&gt; Starts the Snapshot Agent job to generate the initial snapshot.  The batch file can also automatically configure a virtual directory at the Publisher to support Web synchronization. If you choose not configure the virtual directory at the Publisher during installation, or if you plan to use a separate Web server, you must run the Configure Web Synchronization Wizard prior to using the Web synchronization features of the sample. &lt;/li&gt;&lt;li&gt;(Optional) Run the Configure Web Synchronization Wizard to configure an IIS server to support Web synchronization. Skip this step if InstallSalesOrdersSample.bat successfully created the virtual directory or if you will not use Web synchronization. For complete instructions about using this wizard, see &lt;b&gt;How to: Configure IIS for Web Synchronization&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Before continuing, ensure that the Snapshot Agent job for the AdvWorksSalesOrders publication has successfully completed. The status of this job can be viewed using Replication Monitor. For information about using Replication Monitor to view the status of a Snapshot Agent job, see the topic &lt;b&gt;How to: View Information and Perform Tasks for the Agents Associated With a Publication (Replication Monitor)&lt;/b&gt; in SQL Server Books Online. &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To build and configure the Sales Orders sample at the Subscriber
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. &lt;/li&gt;&lt;li&gt;Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  *Note:   You can skip this step if this key was previously created for use with another sample. *&lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrders.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Build the project. &lt;/li&gt;&lt;li&gt;In the project output folder, edit the SalesOrders.exe.config file and change the following: &lt;/li&gt;&lt;li&gt; Replace the value of the Subscriber key with the name of the local server.  &lt;/li&gt;&lt;li&gt; Replace the value of the Publisher key with the name of the server configured previously as the Publisher.   &lt;/li&gt;&lt;li&gt; (Optional) Replace the value of the WebSynchronizationUrl key when connecting to the Publisher using Web synchronization. This can also be done at run time.  &lt;/li&gt;&lt;li&gt; (Optional) Use the SyncWhenConnectedInterval key to set the interval between synchronizations, in seconds, when using the synchronize-when-connected functionality.    &lt;b&gt;Note:   Replication does not support localhost for server names.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory. &lt;/li&gt;&lt;li&gt;(Optional) If using Web synchronization, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory on the Web server.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the Sales Orders sample and synchronize data
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that remote connections are enabled at the Publisher and at the Subscriber (TCP/IP or Named Pipes) and that the SQL Server Agent service is running.&lt;/li&gt;&lt;li&gt;(Optional) At the Subscriber, test the Web synchronization connection by connecting to the Web server in diagnostic mode following the instructions on &amp;quot;To configure client certificates at the Subscriber&amp;quot; in &lt;b&gt;How to: Configure Web Synchronization for Merge Replication (Replication Transact-SQL Programming)&lt;/b&gt;. &lt;b&gt;Note:   If an HTTP error occurs when using Web synchronization, open Internet Explorer, and from the &lt;b&gt;Tools&lt;/b&gt; menu select &lt;b&gt;Internet Options&lt;/b&gt;, &lt;b&gt;Connections&lt;/b&gt;, and &lt;b&gt;LAN Settings&lt;/b&gt;. Ensure that &lt;b&gt;Automatically detect settings&lt;/b&gt; is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Start SalesOrders.exe from Visual Studio 2005 or from the command prompt. When the application runs for the first time, the subscription database and subscription are created and the Merge Agent is started to initialize the subscription.&lt;/li&gt;&lt;li&gt;After the subscription data has been initialized, the &lt;b&gt;Sales Orders&lt;/b&gt; form will load, displaying a list of existing orders that belong to salesperson &amp;quot;adventure-works\garrett1&amp;quot;. &lt;/li&gt;&lt;li&gt;Using the &lt;b&gt;Sales Orders&lt;/b&gt; form, you can make the following changes to sales data:&lt;/li&gt;&lt;li&gt; Edit sales order information.  &lt;/li&gt;&lt;li&gt; Add a new item to a sales order.   &lt;/li&gt;&lt;li&gt; Delete an item from a sales order.  &lt;/li&gt;&lt;li&gt; Change the ordered quantity for an item in a sales order.  &lt;/li&gt;&lt;li&gt;Select a synchronization method from the &lt;b&gt;Synchronize&lt;/b&gt; menu to synchronize the subscription. &lt;/li&gt;&lt;li&gt;(Optional) Check &lt;b&gt;Synchronize When Connected&lt;/b&gt; to automatically synchronize the subscription. Set the synchronization interval for background synchronization using the SyncWhenConnectedInterval key in the app.config file. &lt;b&gt;Note:   The &lt;b&gt;Synchronize When Connected&lt;/b&gt; feature is not available when running on Microsoft Windows 2000 platforms. For more information, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To use advanced synchronization options of the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From &lt;b&gt;Advanced&lt;/b&gt; in the &lt;b&gt;Synchronize&lt;/b&gt; menu, choose one of the following options:&lt;/li&gt;&lt;li&gt; (Optional) Select a reinitialize option to reinitialize the subscription.   &lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Web Synchronization Options&lt;/b&gt; and supply the Internet URL and the Windows Authentication credentials used to access the Web server over a secure HTTPS connection. To use this option, you must have already configured an IIS server for Web synchronization.    &lt;b&gt;Note:   Upload-only or download-only synchronization is not supported with Web synchronization. When Web synchronization is enabled, the &lt;b&gt;Only Upload Data&lt;/b&gt; menu item is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Get Subscription Status&lt;/b&gt; to view the results the most recent Merge Agent sessions.   &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;Use the following procedure to remove the Sales Orders sample.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To delete the subscription only
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Subscriber, execute the following Transact-SQL script to delete the pull subscription. * {&amp;quot; -- This batch is executed at the Subscriber to remove &lt;/li&gt;
&lt;/ol&gt;-- the Sales Orders sample subscription.&lt;br /&gt;DECLARE @publisher AS sysname;&lt;br /&gt; &lt;br /&gt;-- change this value to the name of the Publisher server.&lt;br /&gt;SET @publisher = N'PUBSERVER'; &lt;br /&gt; &lt;br /&gt;USE &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=AdventureWorksLocal&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication"&gt;AdventureWorksLocal&lt;/a&gt;&lt;br /&gt;EXEC sp_dropmergepullsubscription &lt;br /&gt;  @publisher = @publisher, &lt;br /&gt;  @publisher_db = N'AdventureWorks',&lt;br /&gt;  @publication = N'AdvWorksSalesOrders';&lt;br /&gt;GO &amp;quot;}*&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Publisher, execute the following Transact-SQL script to unregister the pull subscription. * {&amp;quot; -- This batch is executed at the Publisher to remove &lt;/li&gt;
&lt;/ol&gt;-- the Sales Orders sample subscription.&lt;br /&gt;DECLARE @subscriber AS sysname;&lt;br /&gt; &lt;br /&gt;-- change this value to the name of the Subscriber server.&lt;br /&gt;SET @subscriber = N'SUBSERVER'; &lt;br /&gt; &lt;br /&gt;USE &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=AdventureWorks&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication"&gt;AdventureWorks&lt;/a&gt;&lt;br /&gt;EXEC sp_dropmergesubscription &lt;br /&gt;  @publication = N'AdvWorksSalesOrders', &lt;br /&gt;  @subscriber = @subscriber, &lt;br /&gt;  @subscriber_db = N'AdventureWorksLocal';&lt;br /&gt;GO &amp;quot;}*&lt;br /&gt;&lt;h6&gt;
To remove the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Publisher, navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;Execute the batch file RemoveSalesOrdersSample.bat. &lt;/li&gt;&lt;li&gt;When prompted, type &amp;quot;Y&amp;quot; and press &lt;b&gt;Enter&lt;/b&gt; to remove all replication objects at the Publisher, remove all replication objects in the subscription database, and uninstall publishing and distribution at the Publisher.  *Important:   When using this script, all replication infrastructure will be removed. If you have created other publications that use this Publisher or Distributor, do not execute DropAdvWorksSalesOrdersPublication.sql. Instead, you should remove the AdvWorksSalesOrders publication manually. For more information, see &lt;b&gt;How to: Delete a Publication (SQL Server Management Studio)&lt;/b&gt; or &lt;b&gt;How to: Delete a Publication (Replication Transact-SQL Programming)&lt;/b&gt; in SQL Server Books Online. *&lt;/li&gt;&lt;li&gt;At the Subscriber on the  AdventureWorksLocal  database, execute &lt;b&gt;sp_removedbreplication (Transact-SQL)&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Change the database context to the  master  database and execute  &lt;span class="codeInline"&gt;DROP DATABASE AdventureWorksLocal&lt;/span&gt; .&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;Replication Programming Concepts&lt;/b&gt;  &lt;b&gt;Developer InfoCenter (Replication)&lt;/b&gt;  &lt;b&gt;Samples (Replication)&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:30:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Sales Orders Sample for Merge Replication 20080807083046A</guid></item><item><title>Updated Wiki: SS2005!Sales Orders Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005!Sales Orders Sample for Merge Replication&amp;version=14</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Sales Orders Sample for Merge Replication
&lt;/h2&gt; &lt;br /&gt;  &lt;br /&gt; Updated: &lt;b&gt; 14 April 2006 &lt;/b&gt;&lt;br /&gt;This readme file details how to install and run the Sales Orders sample. This file also details any known issues with the sample. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;This sample highlights a merge replication topology for delivering data to mobile users, and it also demonstrates the programmability features of merge replication in SQL Server 2005. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. This sample is supported for Subscribers running all editions of SQL Server 2005. The publication also supports SQL Server 2005 Compact Edition Subscribers. For more information about this sample scenario, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;&lt;li&gt; Transact-SQL   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Sales Orders sample demonstrates the following features of merge replication:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Replication Management Objects (RMO).  &lt;/li&gt;&lt;li&gt; Parameterized row filters.  &lt;/li&gt;&lt;li&gt; Precomputed partitions.  &lt;/li&gt;&lt;li&gt; Client-requested partitioned snapshot.  &lt;/li&gt;&lt;li&gt; Article type-based performance optimizations.  &lt;/li&gt;&lt;li&gt; SQL Server 2005 Compact Edition and Express Edition Subscribers.  &lt;/li&gt;&lt;li&gt; Automatic identity range management.  &lt;/li&gt;&lt;li&gt; Business logic handlers.  &lt;/li&gt;&lt;li&gt; Web synchronization (optional).  For more information about how these replication features are demonstrated in the sample, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2005 Service Pack 1 (SP1), including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Connectivity Components  &lt;/li&gt;&lt;li&gt; Programming Models  &lt;/li&gt;&lt;li&gt; Development Tools (including SDK)  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is included with SQL Server 2005 and is also available at the &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;SQL Server Developer Center&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server 2005 samples. These samples are included with SQL Server 2005 and are also available at the &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;SQL Server Developer Center&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Installing Samples&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.   *Note:   To generate the initial snapshot, you must have SQL Server 2005 SP1 applied at the Publisher. To use this sample on a SQL Server 2005 Publisher without SP1 applied, you must first drop and re-create the FK&lt;i&gt;SalesOrderDetail&lt;/i&gt;SalesOrderHeader_SalesOrderID FOREIGN KEY constraint on the &lt;b&gt;SalesOrderHeader&lt;/b&gt; table without the ON DELETE CASCADE clause. *&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions needed to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat, which configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot, your Windows account must be a member of the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role at the Publisher.   &lt;/li&gt;&lt;li&gt; The Sales Orders sample does various Database Engine and replication tasks, including creating the &lt;b&gt;AdventureWorksLocal&lt;/b&gt; database, creating the local Subscription, and running the Merge Agent to initialize, reinitialize or synchronize the subscription. In order to successfully run the sample executable (SalesOrders.exe) at the Subscriber, your Windows account must have at least CREATE DATABASE permissions at the Subscriber.   &lt;b&gt;Note:   When the local database and subscription exists, your Windows account must be at least a member of the &lt;b&gt;db_owner&lt;/b&gt; fixed database role on the &lt;b&gt;AdventureWorksLocal&lt;/b&gt; database at the Subscriber to run the application.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; To initialize the subscription and synchronize with the Publisher, the Windows account used to connect to the Publisher (or with the Web server when using Web synchronization) must meet the following requirements:  &lt;/li&gt;&lt;li&gt; Have a valid login at the Publisher associated with a user in the publication database.  &lt;/li&gt;&lt;li&gt; Have a valid login at the Distributor associated with a user in the distribution database (of the guest user).  &lt;/li&gt;&lt;li&gt; Be a member of the publication access list (PAL) for the AdvWorksSalesOrders publication.   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample project and configure the replication topology, you will need to do the following:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; At the Publisher, run the replication installation script.  &lt;/li&gt;&lt;li&gt; (Optional) Configure the Internet Information Services (IIS) server to support Web synchronization for merge replication. If this is not done, you cannot use the Web synchronization feature of the sample.   &lt;/li&gt;&lt;li&gt; At the Subscriber, modify the configuration settings in the app.config file of the sample.  &lt;/li&gt;&lt;li&gt; At the Subscriber, build the sample using Visual Studio 2005 or the .NET Framework 2.0 SDK.  &lt;/li&gt;&lt;li&gt; At the Subscriber, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\90\COM directory. When using Web synchronization, you must also place a copy of BusinessLogic.dll in the C:\Program Files\Microsoft SQL Server\90\COM directory on the Web server.  &lt;/li&gt;
&lt;/ul&gt;&lt;h6&gt;
To configure the Sales Orders sample at the Publisher
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that the AdventureWorks sample database has been installed and the database is attached. If the database is not attached, see &lt;b&gt;Installing AdventureWorks Sample Databases and Samples&lt;/b&gt; in SQL&amp;nbsp;Server Books Online.&lt;/li&gt;&lt;li&gt;Ensure that the SQL Server Database Engine samples have been installed.For more information, see &lt;i&gt;Installing Samples&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;Ensure that SQL Server Agent is running. You can view the status of and start this service from &lt;b&gt;Object Explorer&lt;/b&gt; in SQL Server Management Studio. &lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;(Optional) Configure Secure Sockets Layer (SSL) at the Publisher or at the server used for Web synchronization. SSL is required for communication between the IIS server and all Subscribers. To configure SSL, specify a server certificate for the IIS server to use. &lt;/li&gt;&lt;li&gt;Execute InstallSalesOrdersSample.bat and when prompted enter the login (in the case-sensitive format &amp;quot;DOMAIN\login&amp;quot;) and password for the Windows account under which the Snapshot Agent job will run. This calls sqlcmd.exe to execute CreateAdvWorksSalesOrdersPublication.sql, which does the following:&lt;/li&gt;&lt;li&gt; Checks that replication has been configured on the local server, and if not configures it as a Publisher with local Distributor using the distribution database.   &lt;/li&gt;&lt;li&gt; Drops and re-creates the stored procedures and user-defined functions used for data access at the client.  &lt;/li&gt;&lt;li&gt; Drops and re-creates the AdvWorksSalesOrders Publication.  &lt;/li&gt;&lt;li&gt; Adds articles to the publication.  &lt;/li&gt;&lt;li&gt; Registers the business logic handler at the Distributor.  &lt;/li&gt;&lt;li&gt; Starts the Snapshot Agent job to generate the initial snapshot.  The batch file can also automatically configure a virtual directory at the Publisher to support Web synchronization. If you choose not configure the virtual directory at the Publisher during installation, or if you plan to use a separate Web server, you must run the Configure Web Synchronization Wizard prior to using the Web synchronization features of the sample. &lt;/li&gt;&lt;li&gt;(Optional) Run the Configure Web Synchronization Wizard to configure an IIS server to support Web synchronization. Skip this step if InstallSalesOrdersSample.bat successfully created the virtual directory or if you will not use Web synchronization. For complete instructions about using this wizard, see &lt;b&gt;How to: Configure an IIS Server for Web Synchronization (SQL Server Management Studio)&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Before continuing, ensure that the Snapshot Agent job for the AdvWorksSalesOrders publication has successfully completed. The status of this job can be viewed using Replication Monitor. For information about using Replication Monitor to view the status of a Snapshot Agent job, see the topic &lt;b&gt;How to: View Information and Perform Tasks for the Agents Associated With a Publication (Replication Monitor)&lt;/b&gt; in SQL Server Books Online. &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To build and configure the Sales Orders sample at the Subscriber
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the command prompt, navigate to the SQL Server 2005 samples installation directory. The default is C:\Program Files\Microsoft SQL Server\90\Samples. &lt;/li&gt;&lt;li&gt;Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  *Note:   You can skip this step if this key was previously created for use with another sample. *&lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SalesOrders\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrders.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Build the project. &lt;/li&gt;&lt;li&gt;In the project output folder, edit the SalesOrders.exe.config file and change the following: &lt;/li&gt;&lt;li&gt; Replace the value of the Subscriber key with the name of the local server.  &lt;/li&gt;&lt;li&gt; Replace the value of the Publisher key with the name of the server configured previously as the Publisher.   &lt;/li&gt;&lt;li&gt; (Optional) Replace the value of the WebSynchronizationUrl key when connecting to the Publisher using Web synchronization. This can also be done at run time.  &lt;/li&gt;&lt;li&gt; (Optional) Use the SyncWhenConnectedInterval key to set the interval between synchronizations, in seconds, when using the synchronize-when-connected functionality.    &lt;b&gt;Note:   Replication does not support localhost for server names.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\90\COM directory. &lt;/li&gt;&lt;li&gt;(Optional) If using Web synchronization, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\90\COM directory on the Web server.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the Sales Orders sample and synchronize data
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that remote connections are enabled at the Publisher and at the Subscriber (TCP/IP or Named Pipes) and that the SQL Server Agent service is running.&lt;/li&gt;&lt;li&gt;(Optional) At the Subscriber, test the Web synchronization connection by connecting to the Web server in diagnostic mode following the instructions on &amp;quot;To configure client certificates at the Subscriber&amp;quot; in &lt;b&gt;How to: Configure Web Synchronization for Merge Replication (Replication Transact-SQL Programming)&lt;/b&gt;. &lt;b&gt;Note:   If an HTTP error occurs when using Web synchronization, open Internet Explorer, and from the &lt;b&gt;Tools&lt;/b&gt; menu select &lt;b&gt;Internet Options&lt;/b&gt;, &lt;b&gt;Connections&lt;/b&gt;, and &lt;b&gt;LAN Settings&lt;/b&gt;. Ensure that &lt;b&gt;Automatically detect settings&lt;/b&gt; is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Start SalesOrders.exe from Visual Studio 2005 or from the command prompt. When the application runs for the first time, the subscription database and subscription are created and the Merge Agent is started to initialize the subscription.&lt;/li&gt;&lt;li&gt;After the subscription data has been initialized, the &lt;b&gt;Sales Orders&lt;/b&gt; form will load, displaying a list of existing orders that belong to salesperson &amp;quot;adventure-works\garrett1&amp;quot;. &lt;/li&gt;&lt;li&gt;Using the &lt;b&gt;Sales Orders&lt;/b&gt; form, you can make the following changes to sales data:&lt;/li&gt;&lt;li&gt; Edit sales order information.  &lt;/li&gt;&lt;li&gt; Add a new item to a sales order.   &lt;/li&gt;&lt;li&gt; Delete an item from a sales order.  &lt;/li&gt;&lt;li&gt; Change the ordered quantity for an item in a sales order.  &lt;/li&gt;&lt;li&gt;Select a synchronization method from the &lt;b&gt;Synchronize&lt;/b&gt; menu to synchronize the subscription. &lt;/li&gt;&lt;li&gt;(Optional) Check &lt;b&gt;Synchronize When Connected&lt;/b&gt; to automatically synchronize the subscription. Set the synchronization interval for background synchronization using the SyncWhenConnectedInterval key in the app.config file. &lt;b&gt;Note:   The &lt;b&gt;Synchronize When Connected&lt;/b&gt; feature is not available when running on Microsoft Windows 2000 platforms. For more information, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To use advanced synchronization options of the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From &lt;b&gt;Advanced&lt;/b&gt; in the &lt;b&gt;Synchronize&lt;/b&gt; menu, choose one of the following options:&lt;/li&gt;&lt;li&gt; (Optional) Select a reinitialize option to reinitialize the subscription.   &lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Web Synchronization Options&lt;/b&gt; and supply the Internet URL and the Windows Authentication credentials used to access the Web server over a secure HTTPS connection. To use this option, you must have already configured an IIS server for Web synchronization.    &lt;b&gt;Note:   Upload-only or download-only synchronization is not supported with Web synchronization. When Web synchronization is enabled, the &lt;b&gt;Only Upload Data&lt;/b&gt; menu item is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Get Subscription Status&lt;/b&gt; to view the results the most recent Merge Agent sessions.   &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;Use the following procedure to remove the Sales Orders sample.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To delete the subscription only
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Subscriber, execute the following Transact-SQL script to delete the pull subscription.&lt;/li&gt;&lt;li&gt;At the Publisher, execute the following Transact-SQL script to unregister the pull subscription.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To remove the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Publisher, navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;Execute the batch file RemoveSalesOrdersSample.bat. &lt;/li&gt;&lt;li&gt;When prompted, type &amp;quot;Y&amp;quot; and press &lt;b&gt;Enter&lt;/b&gt; to remove all replication objects at the Publisher, remove all replication objects in the subscription database, and uninstall publishing and distribution at the Publisher.  *Important:   When using this script, all replication infrastructure will be removed. If you have created other publications that use this Publisher or Distributor, do not execute DropAdvWorksSalesOrdersPublication.sql. Instead, you should remove the AdvWorksSalesOrders publication manually. For more information, see &lt;b&gt;How to: Delete a Publication (SQL Server Management Studio)&lt;/b&gt; or &lt;b&gt;How to: Delete a Publication (Replication Transact-SQL Programming)&lt;/b&gt; in SQL Server Books Online. *&lt;/li&gt;&lt;li&gt;At the Subscriber on the &lt;b&gt;AdventureWorksLocal&lt;/b&gt; database, execute &lt;b&gt;sp_removedbreplication&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Change the database context to the &lt;b&gt;master&lt;/b&gt; database and execute  &lt;span class="codeInline"&gt;DROP DATABASE AdventureWorksLocal&lt;/span&gt; .&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Change History
&lt;/h3&gt;  &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Release &lt;/th&gt;&lt;th&gt;  History  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; &lt;b&gt; 14 April 2006 &lt;/b&gt;&lt;/td&gt;&lt;td&gt;  Changed content: Updated the requirements to SQL Server 2005 SP1. Added a note with information on how to run the sample on a SQL Server 2005 Publisher.  &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; &lt;b&gt; 5 December 2005 &lt;/b&gt;&lt;/td&gt;&lt;td&gt;  Changed content: Updated deployment steps.  Updated key creation and deployment information to reflect sample updates.  &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &amp;#169; 2007 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:30:24 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2005!Sales Orders Sample for Merge Replication 20080807083024A</guid></item><item><title>Updated Wiki: SS2008!Sales Orders Mobile Replication Sample</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008!Sales Orders Mobile Replication Sample&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Sales Orders Mobile Replication Sample
&lt;/h2&gt; &lt;br /&gt; 08/06/2008 01:27:32&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. This sample is the SQL Server Compact 3.5 Subscriber version of the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;. This sample highlights using Microsoft SQL Server Compact 3.5 as a Subscriber in a merge replication topology for delivering data to mobile users. It also demonstrates the programmability features of replication in SQL Server Compact 3.5. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. The publication used by this sample is created when you install the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;. For more information about the replication scenario used in this sample, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;* &lt;br /&gt;      C#  &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;This sample is supported only on default installations of SQL Server. Named instances are not supported. Before running this sample, make sure the following software is installed on the development computer:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft Compact 2.0.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Microsoft SQL Server Compact 3.5.  &lt;/li&gt;&lt;li&gt; Microsoft ActiveSync 4.0 or later versions.  &lt;/li&gt;&lt;li&gt; The SQL Server samples. These samples are available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.  You must also have either a mobile device or a mobile device emulator (included with Microsoft Visual Studio 2005) with at least 15 MB of free memory on which to deploy and run the sample.&lt;/li&gt;
&lt;/ul&gt;To initialize the subscription and download sales order data to the device, you must have a SQL Server Publisher configured to run the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions required to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat at the Publisher, your Windows account must be a member of the  sysadmin  fixed server role at the Publisher. This batch file configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot.  &lt;/li&gt;&lt;li&gt; To initialize the subscription and synchronize data with the Publisher, the Windows account used to connect to the Web server must meet the following requirements:  &lt;/li&gt;&lt;li&gt; Have a valid login at the Publisher associated with a user in the publication database.  &lt;/li&gt;&lt;li&gt; Have a valid login at the Distributor associated with a user in the distribution database (or the guest user).  &lt;/li&gt;&lt;li&gt; Be a member of the publication access list (PAL) for the AdvWorksSalesOrders publication.    &lt;b&gt;Note:   When you use an anonymous connection to the Web server, the IIS anonymous Windows account is used to connect to the Publisher.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; To connect to the Web server using Secure Sockets Layer (SSL) encryption, you must have a copy of the root certificate of the server certificate used to secure the Web server installed as a root certificate on the device. If the Web server is configured to require client certificates, you must also have a valid certificate installed as a personal certificate on the device.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To configure the replication topology and build and deploy the sample project:&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; At the Publisher, run the publication installation script from the Sales Orders sample.  &lt;/li&gt;&lt;li&gt; Build the Sales Orders sample and deploy the business logic handler assembly on the Web server.  &lt;/li&gt;&lt;li&gt; Run the Configure Web Synchronization wizard to configure the virtual directory.   &lt;/li&gt;&lt;li&gt; Build and deploy the sample to a device or device emulator using Visual Studio 2005.  &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To configure the Publisher, and build and deploy the sample project
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;On a computer that is running SQL Server 2005 or a later version, execute the installation script from the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt; to create the AdvWorksSalesOrders publication at the Publisher.&lt;/li&gt;&lt;li&gt;At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. &lt;/li&gt;&lt;li&gt;Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  *Note:   You can skip this step if this key was previously created for use with another sample. *&lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrders.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Build the project. &lt;/li&gt;&lt;li&gt;Place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory on the Web server. &lt;/li&gt;&lt;li&gt;Run the Configure Web synchronization Wizard to create a virtual directory name &amp;quot;SalesOrdersMobile.&amp;quot; For information about how to run this wizard, follow the steps in the &lt;b&gt;How To: Configure Connectivity with the Configure Web Synchronization Wizard&lt;/b&gt; topic in SQL Server Compact 3.5 Books Online. &lt;b&gt;Note:   When client certificates are required to connect to the Web server, you must have a valid personal certificate installed on the device.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;If using an anonymous connection to the Web server, create a login at the Publisher for the Windows account used for anonymous access, create a user in the &lt;b&gt;AdventureWorks&lt;/b&gt; database for this login, and add this user to the PAL for the AdvWorksSalesOrders publication. For more information, see &lt;b&gt;How to: Manage Logins in the Publication Access List (SQL Server Management Studio)&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders Mobile sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrdersMobile\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrdersMobile.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Connect the device or device emulator and start ActiveSync.&lt;/li&gt;&lt;li&gt;Build and deploy the project to the device. &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the Sales Orders Mobile sample and synchronize data
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Cradle the device and ensure that ActiveSync is running.&lt;/li&gt;&lt;li&gt;To secure the connection to the Web server using SSL, export the root certificate of the server certificate used to secure the SalesOrdersMobile virtual directory (in DER encoded binary X.509 format), copy it to the device, and tap to install it as a root certificate on the device. When client certificates are required to connect to the Web server, you must also have a valid personal certificate installed on the device.  &lt;b&gt;Security Note:   If you use Basic Authentication to connect to the Web server, you should use SSL to encrypt the connection to the Web server. This protects the Windows credentials.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;On the device, start Internet Explorer and browse to one of the following URLs:&lt;/li&gt;&lt;li&gt; http://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll?diag - when using anonymous access to the Web server.  &lt;/li&gt;&lt;li&gt; https://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll?diag - when connecting to the Web server using SSL and specifying a Windows login and password to use for Basic Authentication.  &lt;/li&gt;&lt;li&gt;On the device or device emulator, start the SalesOrdersMobile program. When run for the first time, the program creates the mobile subscription database (\My Documents\AWMobile.sdf).&lt;/li&gt;&lt;li&gt;On the &lt;b&gt;Settings&lt;/b&gt; page, enter the name of the Publisher and the URL of the Web server in one of the following formats:&lt;/li&gt;&lt;li&gt; http://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll. This URL is used when the &lt;b&gt;Connect anonymously to server&lt;/b&gt; box is checked.   &lt;/li&gt;&lt;li&gt; https://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll. This URL is used when the &lt;b&gt;Connect anonymously to server&lt;/b&gt; box is unchecked. You must also specify a Windows login and password in the &lt;b&gt;Windows login&lt;/b&gt; and &lt;b&gt;Password&lt;/b&gt; fields, where these values are the credentials that correspond to a Windows login at the Publisher and Distributor.   &lt;/li&gt;&lt;li&gt;Tap &lt;b&gt;Save&lt;/b&gt; to save these settings.&lt;/li&gt;&lt;li&gt;On the &lt;b&gt;Synchronize&lt;/b&gt; page, verify the value in the &lt;b&gt;Hostname&lt;/b&gt; field, select &lt;b&gt;Full (recommended)&lt;/b&gt; for &lt;b&gt;Sync type&lt;/b&gt;, and then tap &lt;b&gt;Synchronize&lt;/b&gt;. The device connects to the specified Web server to create, initialize, and download subscription data for the application.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To update sales order data and synchronize with the Publisher
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;With the subscription initialized, on the &lt;b&gt;File&lt;/b&gt; menu, tap &lt;b&gt;View Orders&lt;/b&gt;, and select a customer from the &lt;b&gt;Customers&lt;/b&gt; list.&lt;/li&gt;&lt;li&gt;To update an existing order, tap on an existing order in the &lt;b&gt;Orders&lt;/b&gt; table, then do one of the following:&lt;/li&gt;&lt;li&gt; To update an existing item, double-tap an item in the &lt;b&gt;Order Items&lt;/b&gt; grid, change the &lt;b&gt;Quantity&lt;/b&gt; value for the selected item, and then tap &lt;b&gt;Save&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; To add a new item to the order, tap &lt;b&gt;Add New&lt;/b&gt;, select the product from the &lt;b&gt;Category&lt;/b&gt; and &lt;b&gt;Product&lt;/b&gt; lists, set the order quantity in the &lt;b&gt;Quantity&lt;/b&gt; field, and then tap &lt;b&gt;Save&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; To delete an existing item from an order, select the item in the &lt;b&gt;Order Items&lt;/b&gt; grid, and then tap &lt;b&gt;Delete&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt;Tap &lt;b&gt;Synchronize&lt;/b&gt; from the &lt;b&gt;Tools&lt;/b&gt; menu, select either &lt;b&gt;Full (recommended)&lt;/b&gt; or &lt;b&gt;Upload only&lt;/b&gt; from the &lt;b&gt;Sync type&lt;/b&gt; list, and then tap &lt;b&gt;Synchronize&lt;/b&gt;. &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:30:04 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Sales Orders Mobile Replication Sample 20080807083004A</guid></item><item><title>Updated Wiki: SS2005!Sales Orders Mobile Replication Sample</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005!Sales Orders Mobile Replication Sample&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Sales Orders Sample for Devices
&lt;/h2&gt; &lt;br /&gt;  &lt;br /&gt; New: &lt;b&gt; 14 April 2006 &lt;/b&gt;&lt;br /&gt;This sample is the mobile device version of the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;. This sample highlights using Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) as a Subscriber in a merge replication topology for delivering data to mobile device users. It also demonstrates the programmability features of replication in SQL Server Compact Edition. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. The publication used by this sample is created when you install the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;. For more information about the replication scenario used in this sample, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed on the development computer:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005 Service Pack 1 (SP1) or later versions. For more information, see &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition).  &lt;/li&gt;
&lt;/ul&gt;* &lt;br /&gt;    Microsoft ActiveSync 4.0 or later versions.  &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2005 Service Pack 2 (SP2) or later versions.  &lt;/li&gt;&lt;li&gt; The SQL Server 2005 samples. These samples are included with SQL Server 2005 and are also available at the &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;SQL Server Developer Center&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Installing Samples&lt;/i&gt;.  You must also have either a mobile device or a mobile device emulator (included with Microsoft Visual Studio 2005) with at least 15 MB of free memory on which to deploy and run the sample.&lt;/li&gt;
&lt;/ul&gt;To initialize the subscription and download sales order data to the device, you must have a SQL Server 2005 Publisher configured to run the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions required to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat at the Publisher, your Windows account must be a member of the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role at the Publisher. This batch file configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot.  &lt;/li&gt;&lt;li&gt; To initialize the subscription and synchronize data with the Publisher, the Windows account used to connect to the Web server must meet the following requirements:  &lt;/li&gt;&lt;li&gt; Have a valid login at the Publisher associated with a user in the publication database.  &lt;/li&gt;&lt;li&gt; Have a valid login at the Distributor associated with a user in the distribution database (or the guest user).  &lt;/li&gt;&lt;li&gt; Be a member of the publication access list (PAL) for the AdvWorksSalesOrders publication.    &lt;b&gt;Note:   When you use an anonymous connection to the Web server, the IIS anonymous Windows account is used to connect to the Publisher.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; To connect to the Web server using Secure Sockets Layer (SSL) encryption, you must have a copy of the root certificate of the server certificate used to secure the Web server installed as a root certificate on the device. If the Web server is configured to require client certificates, you must also have a valid certificate installed as a personal certificate on the device.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To configure the replication topology and build and deploy the sample project:&lt;br /&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt; At the Publisher, run the publication installation script from the Sales Orders sample.  &lt;/li&gt;&lt;li&gt; Build the Sales Orders sample and deploy the business logic handler assembly on the Web server.  &lt;/li&gt;&lt;li&gt; Run the Configure Web Synchronization wizard to configure the virtual directory.   &lt;/li&gt;&lt;li&gt; Build and deploy the sample to a device or device emulator using Visual Studio 2005.  &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To configure the Publisher, and build and deploy the sample project
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;On a computer that is running SQL Server 2005, execute the installation script from the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt; to create the AdvWorksSalesOrders publication at the Publisher. &lt;b&gt;Note:   The Sales Orders sample configuration script configures Web synchronization only for SQL Server 2005 and SQL Server Express Subscribers.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;At the command prompt, navigate to the SQL Server 2005 samples installation directory. The default is C:\Program Files\Microsoft SQL Server\90\Samples. &lt;/li&gt;&lt;li&gt;Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  *Note:   You can skip this step if this key was previously created for use with another sample. *&lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SalesOrders\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrders.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Build the project. &lt;/li&gt;&lt;li&gt;Place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\90\COM directory on the Web server. &lt;/li&gt;&lt;li&gt;Run the Configure Web synchronization Wizard to create a virtual directory name &amp;quot;SalesOrdersMobile.&amp;quot; For information about how to run this wizard, follow the steps in the &lt;b&gt;How To: Configure Connectivity with the Configure Web Synchronization Wizard&lt;/b&gt; topic in SQL Server Compact Edition Books Online. &lt;b&gt;Note:   When client certificates are required to connect to the Web server, you must have a valid personal certificate installed on the device.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;If using an anonymous connection to the Web server, create a login at the Publisher for the Windows account used for anonymous access, create a user in the &lt;b&gt;AdventureWorks&lt;/b&gt; database for this login, and add this user to the PAL for the AdvWorksSalesOrders publication. For more information, see &lt;b&gt;How to: Manage Logins in the Publication Access List (SQL Server Management Studio)&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders Mobile device sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SalesOrdersMobile\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrdersMobile.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Connect the device or device emulator and start ActiveSync.&lt;/li&gt;&lt;li&gt;Build and deploy the project to the device. &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the Sales Orders Mobile device sample and synchronize data
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Cradle the device and ensure that ActiveSync is running.&lt;/li&gt;&lt;li&gt;To secure the connection to the Web server using SSL, export the root certificate of the server certificate used to secure the SalesOrdersMobile virtual directory (in DER encoded binary X.509 format), copy it to the device, and tap to install it as a root certificate on the device. When client certificates are required to connect to the Web server, you must also have a valid personal certificate installed on the device.  &lt;b&gt;Security Note:   If you use Basic Authentication to connect to the Web server, you should use SSL to encrypt the connection to the Web server. This protects the Windows credentials.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;On the device, start Internet Explorer and browse to one of the following URLs:&lt;/li&gt;&lt;li&gt; http://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll?diag - when using anonymous access to the Web server.  &lt;/li&gt;&lt;li&gt; https://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll?diag - when connecting to the Web server using SSL and specifying a Windows login and password to use for Basic Authentication.  &lt;/li&gt;&lt;li&gt;On the device or device emulator, start the SalesOrdersMobile program. When run for the first time, the program creates the SQL Server Compact Edition subscription database (\My Documents\AWMobile.sdf).&lt;/li&gt;&lt;li&gt;On the &lt;b&gt;Settings&lt;/b&gt; page, enter the name of the Publisher and the URL of the Web server in one of the following formats:&lt;/li&gt;&lt;li&gt; http://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll. This URL is used when the &lt;b&gt;Connect anonymously to server&lt;/b&gt; box is checked.   &lt;/li&gt;&lt;li&gt; https://&lt;i&gt;webserver&lt;/i&gt;/SalesOrdersMobile/sqlcesa30.dll. This URL is used when the &lt;b&gt;Connect anonymously to server&lt;/b&gt; box is unchecked. You must also specify a Windows login and password in the &lt;b&gt;Windows login&lt;/b&gt; and &lt;b&gt;Password&lt;/b&gt; fields, where these values are the credentials that correspond to a Windows login at the Publisher and Distributor.   &lt;/li&gt;&lt;li&gt;Tap &lt;b&gt;Save&lt;/b&gt; to save these settings.&lt;/li&gt;&lt;li&gt;On the &lt;b&gt;Synchronize&lt;/b&gt; page, verify the value in the &lt;b&gt;Hostname&lt;/b&gt; field, select &lt;b&gt;Full (recommended)&lt;/b&gt; for &lt;b&gt;Sync type&lt;/b&gt;, and then tap &lt;b&gt;Synchronize&lt;/b&gt;. The device connects to the specified Web server to create, initialize, and download subscription data for the application.&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To update sales order data and synchronize with the Publisher
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;With the subscription initialized, on the &lt;b&gt;File&lt;/b&gt; menu, tap &lt;b&gt;View Orders&lt;/b&gt;, and select a customer from the &lt;b&gt;Customers&lt;/b&gt; list.&lt;/li&gt;&lt;li&gt;To update an existing order, tap on an existing order in the &lt;b&gt;Orders&lt;/b&gt; table, then do one of the following:&lt;/li&gt;&lt;li&gt; To update an existing item, double-tap an item in the &lt;b&gt;Order Items&lt;/b&gt; grid, change the &lt;b&gt;Quantity&lt;/b&gt; value for the selected item, and then tap &lt;b&gt;Save&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; To add a new item to the order, tap &lt;b&gt;Add New&lt;/b&gt;, select the product from the &lt;b&gt;Category&lt;/b&gt; and &lt;b&gt;Product&lt;/b&gt; lists, set the order quantity in the &lt;b&gt;Quantity&lt;/b&gt; field, and then tap &lt;b&gt;Save&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt; To delete an existing item from an order, select the item in the &lt;b&gt;Order Items&lt;/b&gt; grid, and then tap &lt;b&gt;Delete&lt;/b&gt;.  &lt;/li&gt;&lt;li&gt;Tap &lt;b&gt;Synchronize&lt;/b&gt; from the &lt;b&gt;Tools&lt;/b&gt; menu, select either &lt;b&gt;Full (recommended)&lt;/b&gt; or &lt;b&gt;Upload only&lt;/b&gt; from the &lt;b&gt;Sync type&lt;/b&gt; list, and then tap &lt;b&gt;Synchronize&lt;/b&gt;. &amp;#169; 2007 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:29:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2005!Sales Orders Mobile Replication Sample 20080807082944A</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=Home&amp;version=22</link><description>&lt;div class="wikidoc"&gt;
&lt;a href="http://CodePlex.com/SqlServerSamples" class="externalLink"&gt;SQL Server Samples Portal Page&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; &amp;gt; SQL Server Replication Product Samples&lt;br /&gt; &lt;br /&gt;Replication is a set of technologies for copying and distributing data and database objects from one database to another and then synchronizing between databases to maintain consistency. Using replication, you can distribute data to different locations and to remote or mobile users over local and wide area networks, dial-up connections, wireless connections, and the Internet.&lt;br /&gt; &lt;br /&gt;This project contains Replication samples released with Microsoft SQL Server product. Below is the list of these samples. If you are interested in contributing Replication samples, please let us know by posting in the developers' forum.&lt;br /&gt; &lt;br /&gt;To download these samples click on the Releases tab (or click &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MSFTReplProdSamples" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;), optionally select another (older) release, then click on the Windows Installer package (MSI file) which matches the architecture of the installation computer.&lt;br /&gt; &lt;br /&gt;For information about how to use CodePlex to access SQL Server samples, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=HowToUseCodePlex&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;To download samples databases, click &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then click the appropriate MSI file.&lt;br /&gt;For release notes and brief descriptions of all the sample databases and code, including restrictions on SQL Express and Vista, click &lt;a href="http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=SQLServerDatabasesandSamplesOverview&amp;amp;referringTitle=Home" class="externalLink"&gt;here&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Sample &lt;/th&gt;&lt;th&gt; SQL Server 2005 &lt;/th&gt;&lt;th&gt; SQL Server 2008 &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Sales Orders Mobile Replication Sample &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Mobile%20Replication%20Sample&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Mobile%20Replication%20Sample&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Sales Orders Sample for Merge Replication &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; Subscriber Monitor Utility Sample for Merge Replication &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2005&lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=Home"&gt;SS2008&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Thu, 07 Aug 2008 08:29:23 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20080807082923A</guid></item><item><title>Updated Release: SQL Server 2008 RTM (Aug 06, 2008)</title><link>http://www.codeplex.com/MSFTReplProdSamples/Release/ProjectReleases.aspx?ReleaseId=16044</link><description>&lt;div&gt;
This release contains the SQL Server 2008 RTM product samples for Replication.&lt;br&gt;
&lt;/div&gt;</description><author></author><pubDate>Thu, 07 Aug 2008 04:42:38 GMT</pubDate><guid isPermaLink="false">Updated Release: SQL Server 2008 RTM (Aug 06, 2008) 20080807044238A</guid></item><item><title>Released: SQL Server 2008 RTM (Aug 06, 2008)</title><link>http://www.codeplex.com/MSFTReplProdSamples/Release/ProjectReleases.aspx?ReleaseId=16044</link><description>&lt;div&gt;
This release contains the SQL Server 2008 RTM product samples for Replication.&lt;br&gt;
&lt;/div&gt;</description><author></author><pubDate>Thu, 07 Aug 2008 04:42:38 GMT</pubDate><guid isPermaLink="false">Released: SQL Server 2008 RTM (Aug 06, 2008) 20080807044238A</guid></item><item><title>Source code checked in, #15927</title><link>http://www.codeplex.com/MSFTReplProdSamples/SourceControl/ListDownloadableCommits.aspx</link><description>Adding &amp;#39;Katmai&amp;#58;August 2008 RTM&amp;#39;</description><author>ReedMe</author><pubDate>Thu, 07 Aug 2008 00:04:16 GMT</pubDate><guid isPermaLink="false">Source code checked in, #15927 20080807120416A</guid></item><item><title>Source code checked in, #11622</title><link>http://www.codeplex.com/MSFTReplProdSamples/SourceControl/ListDownloadableCommits.aspx</link><description>Adding &amp;#39;Katmai&amp;#58;June 2008 RC0&amp;#39;</description><author>ReedMe</author><pubDate>Wed, 11 Jun 2008 05:42:45 GMT</pubDate><guid isPermaLink="false">Source code checked in, #11622 20080611054245A</guid></item><item><title>Updated Wiki: SS2008!Subscriber Monitor Utility Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008!Subscriber Monitor Utility Sample for Merge Replication&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Subscriber Monitor Utility Merge Replication Sample
&lt;/h2&gt; &lt;br /&gt; 6/10/2008 1:32:27 AM&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;The Subscriber Monitor Utility sample is a Windows application that demonstrates how the Subscriber-side monitoring functionality provided by Replication Management Objects (RMO) is used to monitor merge subscriptions at the Subscriber. This sample solution can be built and run standalone at the Subscriber (using SubscriberMonitorUtility.exe). The SubscriberMonitor.dll assembly is also used by the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2008%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication"&gt;Readme_Sales Orders Merge Replication Sample&lt;/a&gt; to display subscription status.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A replication topology is generally monitored at the Publisher or Distributor. The Microsoft SQL Server&amp;nbsp;Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused view of all replication activity. For more information, see &lt;b&gt;Monitoring Replication with Replication Monitor&lt;/b&gt;. SQL Server Management Studio provides access to Replication Monitor. However, merge replication is designed specifically to support disconnected clients. Because it is still necessary to monitor the status of a subscription, even when the Subscriber is disconnected from the Publisher, RMO provides classes that enable this Subscriber-side monitor functionality.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Subscriber Monitor Utility sample primarily demonstrates the facilities of RMO for monitoring merge subscriptions at the Subscriber. This sample is designed to run at a server that subscribes to a merge publication. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft SQL Server 2005 or later version, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Engine Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Tools  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server samples. These samples are available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;This sample uses Windows Authentication. To run the sample, your Windows account must be a member of the &lt;b&gt;replmonitor&lt;/b&gt; fixed database role or the &lt;b&gt;db_owner&lt;/b&gt; fixed database role on the subscription database. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample solution, you will need to do the following:&lt;br /&gt;  To build the Subscriber Monitor Utility sample Install the replication samples. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:sn -k SampleKey.snkNote:  You can skip this step if this key was previously created for use with another sample. Navigate to the SubscriberMonitorUtility folder in the replication samples directory and open the SubscriberMonitorUtility.sln solution file in Visual Studio. The location of this folder for a default installation is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SubscriberMonitorUtility\CS. Build the solution.  &lt;br /&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, you need to navigate to the location of the built executable and run it.&lt;br /&gt;  To run the Subscriber Monitor Utility sample at the Subscriber Start SubscriberMonitorUtility.exe from Visual Studio or from the command prompt. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.Select a subscription to monitor from the Available Subscriptions drop-down list box.(Optional) Click the Edit button to change subscription properties.Click Connect. Select a Merge Agent session from the Merge Sessions tree view. (Optional) Click the Refresh button to refresh the session list. &lt;br /&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They have not been tested in nor are they intended to be used in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;How to: Programmatically Monitor Replication (RMO Programming)&lt;/b&gt;  &lt;b&gt;Developer InfoCenter (Replication)&lt;/b&gt;  &lt;b&gt;Using the Subscriber Monitor Sample&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Wed, 11 Jun 2008 00:53:18 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Subscriber Monitor Utility Sample for Merge Replication 20080611125318A</guid></item><item><title>Updated Wiki: SS2005!Subscriber Monitor Utility Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005!Subscriber Monitor Utility Sample for Merge Replication&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Subscriber Monitor Utility Sample for Merge Replication
&lt;/h2&gt; &lt;br /&gt; 6/10/2008 4:38:07 PM&lt;br /&gt;  &lt;br /&gt; Updated: &lt;b&gt; 5 December 2005 &lt;/b&gt;&lt;br /&gt;The Subscriber Monitor Utility sample is a Windows application that demonstrates how the Subscriber-side monitoring functionality provided by Replication Management Objects (RMO) is used to monitor merge subscriptions at the Subscriber. This sample solution can be built and run standalone at the Subscriber (using SubscriberMonitorUtility.exe). The SubscriberMonitor.dll assembly is also used by the &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005%21Sales%20Orders%20Sample%20for%20Merge%20Replication&amp;amp;referringTitle=SS2005%21Subscriber%20Monitor%20Utility%20Sample%20for%20Merge%20Replication"&gt;Sales Orders Sample for Merge Replication&lt;/a&gt; to display subscription status.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;A replication topology is generally monitored at the Publisher or Distributor. The Microsoft SQL Server&amp;nbsp;Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused view of all replication activity. For more information, see &lt;b&gt;Monitoring Replication with Replication Monitor&lt;/b&gt;. SQL Server Management Studio provides access to Replication Monitor. However, merge replication is designed specifically to support disconnected clients. Because it is still necessary to monitor the status of a subscription, even when the Subscriber is disconnected from the Publisher, RMO provides classes that enable this Subscriber-side monitor functionality.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Subscriber Monitor Utility sample primarily demonstrates the facilities of RMO for monitoring merge subscriptions at the Subscriber. This sample is designed to run at a server that subscribes to a merge publication. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Microsoft SQL Server 2005, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Connectivity Components  &lt;/li&gt;&lt;li&gt; Programming Models  &lt;/li&gt;&lt;li&gt; Development Tools (including SDK)  &lt;/li&gt;&lt;li&gt; Samples  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;This sample uses Windows Authentication. To run the sample, your Windows account must be a member of the &lt;b&gt;replmonitor&lt;/b&gt; fixed database role or the &lt;b&gt;db_owner&lt;/b&gt; fixed database role on the subscription database. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample solution, you will need to do the following:&lt;br /&gt;  To build the Subscriber Monitor Utility sample Install the replication samples. For more information, see Installing Samples.At the command prompt, navigate to the SQL Server 2005 samples installation directory. The default is C:\Program Files\Microsoft SQL Server\90\Samples. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:sn -k SampleKey.snkNote:  You can skip this step if this key was previously created for use with another sample. Navigate to the SubscriberMonitorUtility folder in the replication samples directory and open the SubscriberMonitorUtility.sln solution file in Microsoft Visual Studio 2005. The location of this folder for a default installation is C:\Program Files\Microsoft SQL Server\90\Samples\Replication\Merge\SubscriberMonitorUtility\CS. Build the solution.  &lt;br /&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt;To run the sample, you need to navigate to the location of the built executable and run it.&lt;br /&gt;  To run the Subscriber Monitor Utility sample at the Subscriber Start SubscriberMonitorUtility.exe from Visual Studio 2005 or from the command prompt. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.Select a subscription to monitor from the Available Subscriptions drop-down list box.(Optional) Click the Edit button to change subscription properties.Click Connect. Select a Merge Agent session from the Merge Sessions tree view. (Optional) Click the Refresh button to refresh the session list. &lt;br /&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They have not been tested in nor are they intended to be used in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;How to: Programmatically Monitor Replication (RMO Programming)&lt;/b&gt;  &lt;b&gt;Replication Developer InfoCenter&lt;/b&gt;  &lt;b&gt;Subscriber Monitor Sample&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2005 Assistance*&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Change History
&lt;/h3&gt; &lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;  Release &lt;/th&gt;&lt;th&gt;  History  &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; &lt;b&gt; 5 December 2005 &lt;/b&gt;&lt;/td&gt;&lt;td&gt;  Changed content: Updated key creation and deployment information to reflect sample updates.  &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; &lt;br /&gt; &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Wed, 11 Jun 2008 00:52:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2005!Subscriber Monitor Utility Sample for Merge Replication 20080611125246A</guid></item><item><title>Updated Wiki: SS2008!Sales Orders Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2008!Sales Orders Sample for Merge Replication&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Readme_Sales Orders Merge Replication Sample
&lt;/h2&gt; &lt;br /&gt; 6/10/2008 1:32:27 AM&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt; This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005. &lt;br /&gt;This readme file details how to install and run the Sales Orders sample. This file also details any known issues with the sample.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;This sample highlights a merge replication topology for delivering data to mobile users, and it also demonstrates the programmability features of merge replication in SQL Server. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. This sample is supported for Subscribers running all editions of SQL Server. The publication also supports SQL Server Compact 3.5 Subscribers. For more information about this sample scenario, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;&lt;li&gt; Transact-SQL   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Sales Orders sample demonstrates the following features of merge replication:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Replication Management Objects (RMO).  &lt;/li&gt;&lt;li&gt; Parameterized row filters.  &lt;/li&gt;&lt;li&gt; Precomputed partitions.  &lt;/li&gt;&lt;li&gt; Client-requested partitioned snapshot.  &lt;/li&gt;&lt;li&gt; Article type-based performance optimizations.  &lt;/li&gt;&lt;li&gt; SQL Server Compact 3.5 and Express Edition Subscribers.  &lt;/li&gt;&lt;li&gt; Automatic identity range management.  &lt;/li&gt;&lt;li&gt; Business logic handlers.  &lt;/li&gt;&lt;li&gt; Web synchronization (optional).  For more information about how these replication features are demonstrated in the sample, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2005 or later version, including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Engine Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Tools  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server samples. These samples are available on the &lt;b&gt;Microsoft SQL Server Samples and Community Projects&lt;/b&gt; page on &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;CodePlex&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework Documentation&lt;/b&gt;.  &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions needed to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat, which configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot, your Windows account must be a member of the  sysadmin  fixed server role at the Publisher.   &lt;/li&gt;&lt;li&gt; The Sales Orders sample does various Database Engine and replication tasks, including creating the  AdventureWorksLocal  database, creating the local Subscription, and running the Merge Agent to initialize, reinitialize or synchronize the subscription. In order to successfully run the sample executable (SalesOrders.exe) at the Subscriber, your Windows account must have at least CREATE DATABASE permissions at the Subscriber.   &lt;b&gt;Note:   When the local database and subscription exists, your Windows account must be at least a member of the  db_owner  fixed database role on the  AdventureWorksLocal  database at the Subscriber to run the application.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; To initialize the subscription and synchronize with the Publisher, the Windows account used to connect to the Publisher (or with the Web server when using Web synchronization) must meet the following requirements:  &lt;/li&gt;&lt;li&gt; Have a valid login at the Publisher associated with a user in the publication database.  &lt;/li&gt;&lt;li&gt; Have a valid login at the Distributor associated with a user in the distribution database (of the guest user).  &lt;/li&gt;&lt;li&gt; Be a member of the publication access list (PAL) for the AdvWorksSalesOrders publication.   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Building and Configuring the Sample
&lt;/h3&gt;To build the sample project and configure the replication topology, you will need to do the following:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; At the Publisher, run the replication installation script.  &lt;/li&gt;&lt;li&gt; (Optional) Configure the Internet Information Services (IIS) server to support Web synchronization for merge replication. If this is not done, you cannot use the Web synchronization feature of the sample.   &lt;/li&gt;&lt;li&gt; At the Subscriber, modify the configuration settings in the app.config file of the sample.  &lt;/li&gt;&lt;li&gt; At the Subscriber, build the sample using Visual Studio 2005 or the .NET Framework 2.0 SDK.  &lt;/li&gt;&lt;li&gt; At the Subscriber, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory. When using Web synchronization, you must also place a copy of BusinessLogic.dll in the C:\Program Files\Microsoft SQL Server\100\COM directory on the Web server.  &lt;/li&gt;
&lt;/ul&gt;&lt;h6&gt;
To configure the Sales Orders sample at the Publisher
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that the &lt;b&gt;AdventureWorks&lt;/b&gt; sample database has been installed and the database is attached. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;Ensure that the SQL Server Database Engine samples have been installed. For more information, see &lt;i&gt;Considerations for Installing SQL Server Samples and Sample Databases&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;Ensure that SQL Server Agent is running. You can view the status of and start this service from &lt;b&gt;Object Explorer&lt;/b&gt; in SQL Server Management Studio. &lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;(Optional) Configure Secure Sockets Layer (SSL) at the Publisher or at the server used for Web synchronization. SSL is required for communication between the IIS server and all Subscribers. To configure SSL, specify a server certificate for the IIS server to use. &lt;/li&gt;&lt;li&gt;Execute InstallSalesOrdersSample.bat and when prompted enter the login (in the case-sensitive format &amp;quot;DOMAIN\login&amp;quot;) and password for the Windows account under which the Snapshot Agent job will run. This calls sqlcmd.exe to execute CreateAdvWorksSalesOrdersPublication.sql, which does the following:&lt;/li&gt;&lt;li&gt; Checks that replication has been configured on the local server, and if not configures it as a Publisher with local Distributor using the distribution database.   &lt;/li&gt;&lt;li&gt; Drops and re-creates the stored procedures and user-defined functions used for data access at the client.  &lt;/li&gt;&lt;li&gt; Drops and re-creates the AdvWorksSalesOrders Publication.  &lt;/li&gt;&lt;li&gt; Adds articles to the publication.  &lt;/li&gt;&lt;li&gt; Registers the business logic handler at the Distributor.  &lt;/li&gt;&lt;li&gt; Starts the Snapshot Agent job to generate the initial snapshot.  The batch file can also automatically configure a virtual directory at the Publisher to support Web synchronization. If you choose not configure the virtual directory at the Publisher during installation, or if you plan to use a separate Web server, you must run the Configure Web Synchronization Wizard prior to using the Web synchronization features of the sample. &lt;/li&gt;&lt;li&gt;(Optional) Run the Configure Web Synchronization Wizard to configure an IIS server to support Web synchronization. Skip this step if InstallSalesOrdersSample.bat successfully created the virtual directory or if you will not use Web synchronization. For complete instructions about using this wizard, see &lt;b&gt;How to: Configure IIS for Web Synchronization&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Before continuing, ensure that the Snapshot Agent job for the AdvWorksSalesOrders publication has successfully completed. The status of this job can be viewed using Replication Monitor. For information about using Replication Monitor to view the status of a Snapshot Agent job, see the topic &lt;b&gt;How to: View Information and Perform Tasks for the Agents Associated With a Publication (Replication Monitor)&lt;/b&gt; in SQL Server Books Online. &lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To build and configure the Sales Orders sample at the Subscriber
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. &lt;/li&gt;&lt;li&gt;Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt: &lt;span class="codeInline"&gt;sn -k SampleKey.snk&lt;/span&gt;  *Note:   You can skip this step if this key was previously created for use with another sample. *&lt;/li&gt;&lt;li&gt;Navigate to the installation location for the Sales Orders sample solution in Microsoft Visual C#. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\CS.&lt;/li&gt;&lt;li&gt;Open the SalesOrders.sln solution file in Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Build the project. &lt;/li&gt;&lt;li&gt;In the project output folder, edit the SalesOrders.exe.config file and change the following: &lt;/li&gt;&lt;li&gt; Replace the value of the Subscriber key with the name of the local server.  &lt;/li&gt;&lt;li&gt; Replace the value of the Publisher key with the name of the server configured previously as the Publisher.   &lt;/li&gt;&lt;li&gt; (Optional) Replace the value of the WebSynchronizationUrl key when connecting to the Publisher using Web synchronization. This can also be done at run time.  &lt;/li&gt;&lt;li&gt; (Optional) Use the SyncWhenConnectedInterval key to set the interval between synchronizations, in seconds, when using the synchronize-when-connected functionality.    &lt;b&gt;Note:   Replication does not support localhost for server names.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory. &lt;/li&gt;&lt;li&gt;(Optional) If using Web synchronization, place a copy of the BusinessLogic.dll assembly in the C:\Program Files\Microsoft SQL Server\100\COM directory on the Web server.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Running the Sample
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
To run the Sales Orders sample and synchronize data
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Ensure that remote connections are enabled at the Publisher and at the Subscriber (TCP/IP or Named Pipes) and that the SQL Server Agent service is running.&lt;/li&gt;&lt;li&gt;(Optional) At the Subscriber, test the Web synchronization connection by connecting to the Web server in diagnostic mode following the instructions on &amp;quot;To configure client certificates at the Subscriber&amp;quot; in &lt;b&gt;How to: Configure Web Synchronization for Merge Replication (Replication Transact-SQL Programming)&lt;/b&gt;. &lt;b&gt;Note:   If an HTTP error occurs when using Web synchronization, open Internet Explorer, and from the &lt;b&gt;Tools&lt;/b&gt; menu select &lt;b&gt;Internet Options&lt;/b&gt;, &lt;b&gt;Connections&lt;/b&gt;, and &lt;b&gt;LAN Settings&lt;/b&gt;. Ensure that &lt;b&gt;Automatically detect settings&lt;/b&gt; is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Start SalesOrders.exe from Visual Studio 2005 or from the command prompt. When the application runs for the first time, the subscription database and subscription are created and the Merge Agent is started to initialize the subscription.&lt;/li&gt;&lt;li&gt;After the subscription data has been initialized, the &lt;b&gt;Sales Orders&lt;/b&gt; form will load, displaying a list of existing orders that belong to salesperson &amp;quot;adventure-works\garrett1&amp;quot;. &lt;/li&gt;&lt;li&gt;Using the &lt;b&gt;Sales Orders&lt;/b&gt; form, you can make the following changes to sales data:&lt;/li&gt;&lt;li&gt; Edit sales order information.  &lt;/li&gt;&lt;li&gt; Add a new item to a sales order.   &lt;/li&gt;&lt;li&gt; Delete an item from a sales order.  &lt;/li&gt;&lt;li&gt; Change the ordered quantity for an item in a sales order.  &lt;/li&gt;&lt;li&gt;Select a synchronization method from the &lt;b&gt;Synchronize&lt;/b&gt; menu to synchronize the subscription. &lt;/li&gt;&lt;li&gt;(Optional) Check &lt;b&gt;Synchronize When Connected&lt;/b&gt; to automatically synchronize the subscription. Set the synchronization interval for background synchronization using the SyncWhenConnectedInterval key in the app.config file. &lt;b&gt;Note:   The &lt;b&gt;Synchronize When Connected&lt;/b&gt; feature is not available when running on Microsoft Windows 2000 platforms. For more information, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h6&gt;
To use advanced synchronization options of the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;From &lt;b&gt;Advanced&lt;/b&gt; in the &lt;b&gt;Synchronize&lt;/b&gt; menu, choose one of the following options:&lt;/li&gt;&lt;li&gt; (Optional) Select a reinitialize option to reinitialize the subscription.   &lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Web Synchronization Options&lt;/b&gt; and supply the Internet URL and the Windows Authentication credentials used to access the Web server over a secure HTTPS connection. To use this option, you must have already configured an IIS server for Web synchronization.    &lt;b&gt;Note:   Upload-only or download-only synchronization is not supported with Web synchronization. When Web synchronization is enabled, the &lt;b&gt;Only Upload Data&lt;/b&gt; menu item is disabled.&lt;/b&gt;&lt;/li&gt;&lt;li&gt; (Optional) Select &lt;b&gt;Get Subscription Status&lt;/b&gt; to view the results the most recent Merge Agent sessions.   &lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Removing the Sample
&lt;/h3&gt;Use the following procedure to remove the Sales Orders sample.&lt;br /&gt; &lt;br /&gt;&lt;h6&gt;
To delete the subscription only
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Subscriber, execute the following Transact-SQL script to delete the pull subscription. * {&amp;quot; -- This batch is executed at the Subscriber to remove &lt;/li&gt;
&lt;/ol&gt;-- the Sales Orders sample subscription.&lt;br /&gt;DECLARE @publisher AS sysname;&lt;br /&gt; &lt;br /&gt;-- change this value to the name of the Publisher server.&lt;br /&gt;SET @publisher = N'PUBSERVER'; &lt;br /&gt; &lt;br /&gt;USE &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=AdventureWorksLocal&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication"&gt;AdventureWorksLocal&lt;/a&gt;&lt;br /&gt;EXEC sp_dropmergepullsubscription &lt;br /&gt;  @publisher = @publisher, &lt;br /&gt;  @publisher_db = N'AdventureWorks',&lt;br /&gt;  @publication = N'AdvWorksSalesOrders';&lt;br /&gt;GO &amp;quot;}*&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Publisher, execute the following Transact-SQL script to unregister the pull subscription. * {&amp;quot; -- This batch is executed at the Publisher to remove &lt;/li&gt;
&lt;/ol&gt;-- the Sales Orders sample subscription.&lt;br /&gt;DECLARE @subscriber AS sysname;&lt;br /&gt; &lt;br /&gt;-- change this value to the name of the Subscriber server.&lt;br /&gt;SET @subscriber = N'SUBSERVER'; &lt;br /&gt; &lt;br /&gt;USE &lt;a href="http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=AdventureWorks&amp;amp;referringTitle=SS2008%21Sales%20Orders%20Sample%20for%20Merge%20Replication"&gt;AdventureWorks&lt;/a&gt;&lt;br /&gt;EXEC sp_dropmergesubscription &lt;br /&gt;  @publication = N'AdvWorksSalesOrders', &lt;br /&gt;  @subscriber = @subscriber, &lt;br /&gt;  @subscriber_db = N'AdventureWorksLocal';&lt;br /&gt;GO &amp;quot;}*&lt;br /&gt;&lt;h6&gt;
To remove the Sales Orders sample
&lt;/h6&gt; &lt;br /&gt;&lt;ol&gt;
&lt;li&gt;At the Publisher, navigate to the installation location for the Sales Order sample scripts. The default is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SalesOrders\Scripts.&lt;/li&gt;&lt;li&gt;Execute the batch file RemoveSalesOrdersSample.bat. &lt;/li&gt;&lt;li&gt;When prompted, type &amp;quot;Y&amp;quot; and press &lt;b&gt;Enter&lt;/b&gt; to remove all replication objects at the Publisher, remove all replication objects in the subscription database, and uninstall publishing and distribution at the Publisher.  *Important:   When using this script, all replication infrastructure will be removed. If you have created other publications that use this Publisher or Distributor, do not execute DropAdvWorksSalesOrdersPublication.sql. Instead, you should remove the AdvWorksSalesOrders publication manually. For more information, see &lt;b&gt;How to: Delete a Publication (SQL Server Management Studio)&lt;/b&gt; or &lt;b&gt;How to: Delete a Publication (Replication Transact-SQL Programming)&lt;/b&gt; in SQL Server Books Online. *&lt;/li&gt;&lt;li&gt;At the Subscriber on the  AdventureWorksLocal  database, execute &lt;b&gt;sp_removedbreplication (Transact-SQL)&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Change the database context to the  master  database and execute  &lt;span class="codeInline"&gt;DROP DATABASE AdventureWorksLocal&lt;/span&gt; .&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;
Comments
&lt;/h3&gt;Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
See Also
&lt;/h3&gt; &lt;br /&gt;&lt;h6&gt;
Other Resources
&lt;/h6&gt;&lt;b&gt;Replication Programming Concepts&lt;/b&gt;  &lt;b&gt;Developer InfoCenter (Replication)&lt;/b&gt;  &lt;b&gt;Samples (Replication)&lt;/b&gt;    &lt;br /&gt;&lt;h6&gt;
 Help and Information
&lt;/h6&gt;&lt;ul&gt;
&lt;li&gt;Getting SQL Server 2008 Assistance* &amp;#169; 2008 Microsoft Corporation. All rights reserved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>bonniefe</author><pubDate>Wed, 11 Jun 2008 00:51:47 GMT</pubDate><guid isPermaLink="false">Updated Wiki: SS2008!Sales Orders Sample for Merge Replication 20080611125147A</guid></item><item><title>Updated Wiki: SS2005!Sales Orders Sample for Merge Replication</title><link>http://www.codeplex.com/MSFTReplProdSamples/Wiki/View.aspx?title=SS2005!Sales Orders Sample for Merge Replication&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
Sales Orders Sample for Merge Replication
&lt;/h2&gt; &lt;br /&gt; 6/10/2008 4:38:07 PM&lt;br /&gt;  &lt;br /&gt; Updated: &lt;b&gt; 14 April 2006 &lt;/b&gt;&lt;br /&gt;This readme file details how to install and run the Sales Orders sample. This file also details any known issues with the sample. &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Scenario
&lt;/h3&gt;This sample highlights a merge replication topology for delivering data to mobile users, and it also demonstrates the programmability features of merge replication in SQL Server 2005. The sample is a Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office. This sample is supported for Subscribers running all editions of SQL Server 2005. The publication also supports SQL Server Compact Edition Subscribers. For more information about this sample scenario, see &lt;b&gt;Sales Orders Sample Scenario&lt;/b&gt;.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Languages
&lt;/h3&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt;C#  &lt;/li&gt;&lt;li&gt; Transact-SQL   &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Features
&lt;/h3&gt;The Sales Orders sample demonstrates the following features of merge replication:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; Replication Management Objects (RMO).  &lt;/li&gt;&lt;li&gt; Parameterized row filters.  &lt;/li&gt;&lt;li&gt; Precomputed partitions.  &lt;/li&gt;&lt;li&gt; Client-requested partitioned snapshot.  &lt;/li&gt;&lt;li&gt; Article type-based performance optimizations.  &lt;/li&gt;&lt;li&gt; SQL Server Compact Edition and Express Edition Subscribers.  &lt;/li&gt;&lt;li&gt; Automatic identity range management.  &lt;/li&gt;&lt;li&gt; Business logic handlers.  &lt;/li&gt;&lt;li&gt; Web synchronization (optional).  For more information about how these replication features are demonstrated in the sample, see &lt;b&gt;Sales Orders Sample Implementation Details&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
Prerequisites
&lt;/h3&gt;Before running this sample, make sure the following software is installed:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; SQL Server 2005 Service Pack 1 (SP1), including the following optionally installed components:  &lt;/li&gt;&lt;li&gt; SQL Server Database Services (including replication)  &lt;/li&gt;&lt;li&gt; Client Connectivity Components  &lt;/li&gt;&lt;li&gt; Programming Models  &lt;/li&gt;&lt;li&gt; Development Tools (including SDK)  &lt;/li&gt;&lt;li&gt; AdventureWorks Sample OLTP Database. This sample database is included with SQL Server 2005 and is also available at the &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;SQL Server Developer Center&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.  &lt;/li&gt;&lt;li&gt; The SQL Server 2005 samples. These samples are included with SQL Server 2005 and are also available at the &lt;a href="http://go.microsoft.com/fwlink/?linkid=62796" class="externalLink"&gt;SQL Server Developer Center&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. For more information, see &lt;i&gt;Installing Samples&lt;/i&gt;.  &lt;/li&gt;&lt;li&gt; .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see &lt;b&gt;Installing the .NET Framework SDK&lt;/b&gt;.   *Note:   To generate the initial snapshot, you must have SQL Server 2005 SP1 applied at the Publisher. To use this sample on a SQL Server 2005 Publisher without SP1 applied, you must first drop and re-create the FK&lt;i&gt;SalesOrderDetail&lt;/i&gt;SalesOrderHeader_SalesOrderID FOREIGN KEY constraint on the &lt;b&gt;SalesOrderHeader&lt;/b&gt; table without the ON DELETE CASCADE clause. *&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;
Required Permissions
&lt;/h3&gt;The permissions needed to configure and run the Sales Orders sample are based on replication security requirements, and are as follows:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;li&gt; To run InstallSalesOrdersSample.bat, which configures replication, creates the AdvWorksSalesOrders publication, and generates the initial snapshot, your Windows account must be a member of the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role at the Publisher.   &lt;/li&gt;&lt;li&gt; The Sales Orders sample does various Database Engine and replication tasks, including creating the &lt;b&gt;AdventureWorksLocal&lt;/b&gt; database, creating the local Subscription, and running the Merge Agent to ini