This sample shows one way to build an object-oriented programming interface for Service Broker applications. The sample contains classes that encapsulate the details of sending and receiving messages by using the Service Broker DML. This sample forms the foundations
for other sample applications included with the SQL Server samples.
The sample includes two different approaches to message dispatch. An application that uses this sample can use an attribute-based approach for message dispatch, or the application can implement a message processing loop.
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.
Building the Sample
- Open the solution file Service Broker Interface.sln in Visual Studio 2008. This file is located in the
cs directory within the
- Build the solution by pressing F6, or by selecting Build Solution from the
Using the Sample
- Build the sample as described above.
- Add a reference to the assembly Microsoft.Samples.SqlServer.dll .
- In your code, add a using directive (C#) or Imports statement (Visual Basic) for the namespace
This sample requires Visual Studio 2008. Because the sample uses features of the common language runtime that were not available in earlier versions, versions of Visual Studio earlier than 2008 cannot build the sample.
This sample demonstrates one way to represent Service Broker DML within a .NET language.
© 2008 Microsoft Corporation. All rights reserved.