Microsoft BizTalk Adapter for SQL Server Help

Welcome to Microsoft BizTalk Adapter for SQL Server Help, which includes a variety of resources that can help you learn to develop, deploy, administer, and use the SQL adapter.

Getting started icon | Getting Started Information about new features, limitations, prerequisites, and topics for users who are new to the adapter.
Tutorials icon | SQL Adapter Tutorials Step-by-step instructions for learning how to use the adapter for specific scenarios.
Adapter Architecture icon | Planning and Architecture Architectural overview of the adapter.
Adapter Development icon | Development Instructions on how to use the adapter with BizTalk Server, the Windows Communication Foundation (WCF) service model, and the WCF channel model.
Adapter Deployment icon | Deployment Information about installing the adapter, migrating from previous versions of the adapter, and troubleshooting the installation.
Adapter Troubleshooting icon | Troubleshooting Information about enabling tracing and about troubleshooting issues with the BizTalk Adapter Pack and with the adapter, in particular.
Adapter Samples icon | Samples Samples demonstrating how to use the adapter.
Community resources icon | Community Resources Information about how to get assistance with the BizTalk Adapter Pack.

© 2013 Microsoft Corporation. All rights reserved.


Getting Started
Important
If this document is installed as part of the SQL adapter installation (by running the SQLAdapterSetup.msi), you must ignore all references to Microsoft BizTalk Adapter Pack. Also, all references to the BizTalk Adapter Pack Setup should be interpreted as the SQL adapter Setup.

This section provides an overview of the adapter, prerequisites, and topics for users who are new to Microsoft BizTalk Adapter Pack. It discusses the features of Microsoft BizTalk Adapter for SQL Server and the different operations that can be performed on the SQL Server database by using the adapter.

What is an adapter? An adapter is a software component that enables you to send and receive messages to and from a line-of-business (LOB) system. The primary design goal of an adapter is to facilitate the exchange of business documents between trading partners. Because each business system may adhere to specific document formats and protocols, the adapter must use a delivery mechanism that conforms to commonly recognized standards and protocols to provide a uniform interface to the users.

The adapters in the BizTalk Adapter Pack can be divided into two broad categories:

  • LOB adapters. Such adapters provide service-oriented programming model to access LOB systems—for example, adapters for SAP or Siebel.

  • Data adapters. Such adapters provide service-oriented programming model to access databases—for example, adapters for the Oracle database or SQL Server.

There are five adapters in the BizTalk Adapter Pack:

  • Microsoft BizTalk Adapter for SQL Server (SQL adapter).

    Note
    The SQL adapter is also available outside the BizTalk Adapter Pack as a separate adapter.

  • Microsoft BizTalk Adapter for Oracle E-Business Suite (Oracle E-Business adapter).

  • Microsoft BizTalk Adapter for Oracle Database (Oracle Database adapter).

  • Microsoft BizTalk Adapter for mySAP Business Suite (SAP adapter).

  • Microsoft BizTalk Adapter for Siebel eBusiness Applications (Siebel adapter).

    Note
    The Siebel adapter is not available for 64-bit platforms.

If you do not already know how you want to use the SQL adapter at your company, it is recommended that you start by exploring the features and functionality of the adapter described in Understanding BizTalk Adapter for SQL Server.

In This Section

  • Prerequisite Skills and Knowledge

  • Common Administrative Tasks

  • Common Developer Tasks

  • Understanding BizTalk Adapter for SQL Server

  • SQL Adapter Tutorials

  • Community Resources

  • Frequently Asked Questions


Prerequisite Skills and Knowledge
See Also

The potential users for the BizTalk Adapter Pack are:

  • Developers who directly program to the adapters.

  • IT professionals who consume the adapters using other integration platforms like Microsoft BizTalk Server and other tools.

  • Independent software vendors (ISVs) who build solutions on top of the adapters.

The prerequisite skills and knowledge required for each role are detailed below.

Prerequisites for Developers

A developer using Microsoft BizTalk Adapter for SQL Server must be at least moderately experienced with the use of:

  • Microsoft Visual Studio 2012 and the development of .NET solutions

  • Programming with the .NET Framework 3.5 SP1 and Microsoft .NET Framework 4.5

    Note
    .NET Framework 4.5 is essential to use BizTalk Adapter Pack with BizTalk Server 2013. However, you can use .NET Framework 3.5 SP1 and Microsoft .NET Framework 4.5 to write.NET applications (channel/proxy) for connecting using adapters.

  • Programming with the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK

  • Extensible Markup Language (XML)

  • XML Schema Definition (XSD) language

  • Web Services Definition Language (WSDL)

Prerequisites for IT Professional

An IT professional using the Microsoft BizTalk Adapter for SQL Server must be at least moderately experienced with the use of:

  • Microsoft BizTalk Server 2013

  • Windows SharePoint Services

Prerequisites for ISVs

ISVs using the Microsoft BizTalk Adapter for SQL Server must be at least moderately experienced with the use of:

  • The internal workings and concepts of SQL Server to be able to build applications on top of the adapters

  • .NET Framework 3.5 SP1 and Microsoft .NET Framework 4.5

  • The WCF LOB Adapter SDK

See Also

Other Resources

Getting Started
Understanding BizTalk Adapter for SQL Server


Common Administrative Tasks

The following table provides links to topics helpful for deploying, using, and maintaining Microsoft BizTalk Adapter for SQL Server.

Administrative Tasks

  • SQL Adapter Tutorials

  • Deployment

Planning and Architecture

  • Planning and Architecture

  • Understanding BizTalk Adapter for SQL Server

  • Security and Protection

Other Resources

  • Community Resources

  • Glossary

See Also

Concepts

Common Developer Tasks

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


Common Developer Tasks

The following table provides links to topics useful for developing applications on top of Microsoft BizTalk Adapter for SQL Server.

Developer Tasks

  • Establishing a Connection to SQL Server

  • Developing BizTalk Applications

  • Developing Applications by Using the WCF Service Model

  • Developing Applications by Using the WCF Channel Model

Planning and Architecture

  • Planning and Architecture

  • Understanding BizTalk Adapter for SQL Server

  • Security and Protection

Other Resources

  • Community Resources

  • Troubleshooting

  • Glossary

See Also

Concepts

Common Administrative Tasks

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


Understanding BizTalk Adapter for SQL Server

The BizTalk Adapter Pack enables service-oriented programmatic access making it possible to interact with an external system. The adapters provide the following advantages to clients:

  • Consistent design-time experience. The adapters provide a common and user-friendly design-time experience for browsing, searching, and retrieving metadata of LOB artifacts.

  • Varied programming options. The adapters provide a choice of programming model including the Windows Communication Foundation (WCF) channel model, WCF service model, ADO.NET, Web services, or BizTalk supported models.

  • Uniform experience across LOBs. The adapters standardize on using WCF and the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, and hence provide a uniform experience of gaining access to any LOB system.

As mentioned, the adapters are built on top of the WCF LOB Adapter SDK. The WCF LOB Adapter SDK provides a common basis for building integration adapters that a variety of client applications such as BizTalk Server and Microsoft Office can consume. The WCF LOB Adapter SDK aligns the adapter strategy with the Microsoft Services strategy by exposing integration adapters as Windows Communication Foundation (WCF) channels. For more information about the WCF LOB Adapter SDK, see the WCF LOB Adapter SDK documentation. The WCF LOB Adapter SDK documentation is installed along with the WCF LOB Adapter SDK, typically under <installation drive>:\Program Files\WCF LOB Adapter SDK\Documents.

To perform operations on a SQL Server database, adapter clients must have access to relevant tables, procedures, views, scalar functions, and table valued functions. Database tables are the basic unit of storage in the SQL Server database. External applications can select, insert, delete, and update data from a table by using SQL statements. Applications can also access data in the tables by using procedures, views, scalar functions, and table valued functions. With Microsoft BizTalk Adapter for SQL Server, adapter clients can browse artifacts such as tables, procedures, views, and other such items in a SQL Server database. Adapter clients can select the artifacts they require for their solution, and retrieve metadata for those artifacts. This enables users to access and execute the operations on the artifacts in the SQL Server database.

This section lists the features of the SQL adapter.

In This Section

  • Overview of BizTalk Adapter for SQL Server

  • New Features in BizTalk Adapter for SQL Server

  • Limitations of BizTalk Adapter for SQL Server

See Also

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


Overview of BizTalk Adapter for SQL Server

The Microsoft BizTalk Adapter for SQL Server exposes the SQL Server database as a WCF service. Adapter clients can perform operations on the SQL Server database by exchanging SOAP messages with the adapter. The adapter consumes the SOAP message and makes appropriate ADO.NET calls to perform the operation. The adapter returns the response from the SQL Server database back to the client in the form of SOAP messages.

The SQL adapter surfaces metadata of artifacts in the SQL Server database (such as tables, views, and procedures). This metadata describes the structure of a SOAP message in the form of Web Services Description Language (WSDL). The SQL adapter uses the Add Adapter Service Reference Visual Studio Plug-in, Add Adapter Metadata Wizard, and Consume Adapter Service BizTalk Project Add-in to enable adapter clients to retrieve metadata for operations. The adapter also generates programming artifacts that can be used in your programming solution. For more information about Add Adapter Service Reference Visual Studio Plug-in, Add Adapter Metadata Wizard, and Consume Adapter Service BizTalk Project Add-in, see Connecting to SQL Server in Visual Studio.

The SQL adapter uses ADO.NET to communicate with the SQL Server database. You can use the SQL adapter to communicate with the SQL Server database in the following ways:

  • By developing BizTalk applications. For more information, see Developing BizTalk Applications.

  • By using the Windows Communication Foundation (WCF) service model. For more information, see Developing Applications by Using the WCF Service Model.

  • By using the WCF channel model. For more information, see Developing Applications by Using the WCF Channel Model.

In This Section

  • How Does the Adapter Connect to SQL Server?

  • How Does the Adapter Surface SQL Server Metadata?

  • What Operations Can Be Performed Using the Adapter?

  • Other Features Supported by the Adapter

See Also

Other Resources

Understanding BizTalk Adapter for SQL Server


How Does the Adapter Connect to SQL Server?

The Microsoft BizTalk Adapter for SQL Server requires adapter clients to provide a connection string, called the connection Uniform Resource Identifier (URI), to connect to the SQL Server database. Internally, the SQL adapter maps the URI to a database connection string to connect to the SQL Server database. With a connection URI, adapter clients can specify connection parameters to connect to an external system. For more information about the connection URI, see SQL Server Connection URI.

In the connection URI, you can also specify the name of a failover SQL Server database on a standby computer to connect to if the primary SQL Server database is not available. The failover SQL Server database must be a mirror of the primary SQL Server database. The failover SQL Server database is specified using an optional parameter, FailoverPartner, in the connection URI. Providing a failover SQL Server database ensures high availability and data redundancy. For more information about high availability with respect to SQL Server, see “Using Database Mirroring” at http://go.microsoft.com/fwlink/?LinkID=196852.

Make sure you comply with the security guidelines when establishing a connection with the SQL Server database. For more information about security guidelines, see Security and Protection.

See Also

Other Resources

Overview of BizTalk Adapter for SQL Server
Establishing a Connection to SQL Server

© 2013 Microsoft Corporation. All rights reserved.


How Does the Adapter Surface SQL Server Metadata?

The metadata that Microsoft BizTalk Adapter for SQL Server surfaces from the SQL Server database describes the message structure for communicating with the SQL Server database using the adapter. The SQL adapter supports two interfaces for retrieving metadata.

  • MetadataExchange provided by Windows Communication Foundation (WCF). WCF provides a metadata-exchange endpoint for all WCF bindings, which enables clients to get metadata from the SQL Server database.

  • IMetadataRetrievalContract provided by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, which supports the metadata browsing and searching capabilities of the adapter.

The SQL adapter surfaces the SQL Server database artifacts and respective operations that the adapter clients can invoke. The adapter also surfaces operations (such as ExecuteNonQuery, ExecuteReader, and ExecuteScalar) that can be used to perform specific operations on the SQL Server database. These operations are discussed later in this topic.

Note
The SQL adapter surfaces artifacts in all the schemas in the SQL Server database that the currently connected user has access to. This implies that apart from the default schema (dbo), the adapter clients can also perform operations on artifacts in other schemas in the SQL Server database provided that the user credentials used to connect using the SQL adapter has access to those schemas in the SQL Server database. For information about a schema in SQL Server database, see http://go.microsoft.com/fwlink/?LinkId=130148.

You can use the adapter clients to browse, search, and retrieve metadata by:

  • Creating a BizTalk project in Visual Studio

  • Using the WCF service model

  • Using the WCF channel model

When using a BizTalk project, you must use the Consume Adapter Service BizTalk Project Add-in or Add Adapter Metadata Wizard to generate metadata for the operations that you want to perform on the SQL Server database. When using the WCF service model, you must use the Add Adapter Service Reference Visual Studio Plug-in to generate the proxy classes for performing operations on the SQL Server database. For more information about browsing, searching, and retrieving metadata using Consume Adapter Service Add-in, Add Adapter Metadata Wizard or Add Adapter Service Reference Plug-in, see Retrieving Metadata for SQL Server Operations in Visual Studio.

Browsing Metadata

The SQL adapter enables adapter clients to browse database tables, views, stored procedures, and functions that are available in the SQL Server database. As part of the metadata browse operation, the adapter also surfaces the operations that can be performed on the SQL Server database, including some custom operations supported by the adapters. These operations are available from Consume Adapter Service Add-in, Add Adapter Metadata Wizard or Add Adapter Service Reference Plug-in. The SQL adapter surfaces the following operations:

  • The operations on tables, views, procedures, scalar functions, and table valued functions. For example, the SQL adapter may surface Insert, Update, Select, and Delete operations for the EMPLOYEE table.

  • The Set<column name> operation for tables and views that enables adapter clients to write large data values in a streaming fashion. The Set operation is only returned for those tables and views that contain columns with any of the following data types: Varchar(Max), Nvarchar(Max) or Varbinary(Max). For more information, see Operations on Tables and Views That Contain Large Data Types.

  • The ExecuteNonQuery, ExecuteReader, and ExecuteScalar operations that enable adapter clients to execute arbitrary SQL statements in SQL Server. For more information about these operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

  • The Polling and Notification operations to receive inbound messages from SQL Server. For information about the Polling operation, see Support for Polling; for information about the Notification operation, see Receiving Query Notifications.

For more information about how the metadata is categorized, see Metadata Node IDs.

Searching Metadata

With the SQL adapter, it is possible to perform a search query on the SQL Server database by using the SQL Server search expressions that are compatible with the LIKE operator. For example, adapter clients can use a search expression such as “EMP%” to obtain tables starting with EMP. The adapter converts this to the following SQL query:

Copy Code
SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLE_NAME LIKE 'EMP%'

The following table lists the special characters that can be used for search and their interpretation by the SQL adapter.

Special character Interpretation

_ (underscore)

Matches exactly one character.

For example, “A_” matches “AB”, “AC”, “AD”.

% (percentage)

Matches zero or more characters.

For example, “A%” matches “A”, “AB”, “ABC”.

[ ]

  • Escapes the special meaning of _ and %.

  • Specifies a range or set of characters to be present.

For example:

  • %[%]% matches all names that include a % symbol.

  • [a-f] matches all names that have characters between and including ‘a’ and ‘f’.

  • [abc] matches all names that have characters ‘a’, ‘b’, and ‘c’.

[^]

Specifies a range or set of characters not to be present.

For example:

  • [^a-f] matches all names that do not have characters between and including ‘a’ and ‘f’.

  • [^abc] matches all names that do not have characters ‘a’, ‘b’, and ‘c’.

Important
The metadata search scope is restricted to the level immediately under the node at which the search operation is performed. For example, to search for a scalar function, you must be searching under /Scalar Function/[Schema]. Multi-level search is not supported.

Retrieving Metadata

When retrieving metadata, the SQL adapter can extract metadata under a schema, including all or a subset of database objects with the respective object and operation parameters. The adapter presents the entities from the SQL Server database as element names in XML. Because underscores are the only permissible special characters that can be included, all other special characters in the element names are encoded using underscores. For example, emp$name is encoded as emp_x0024_name.

See Also

Other Resources

Overview of BizTalk Adapter for SQL Server
Understanding BizTalk Adapter for SQL Server
Retrieving Metadata for SQL Server Operations in Visual Studio


What Operations Can Be Performed Using the Adapter?

You can use the adapter clients to perform operations on the SQL Server database by:

  • Creating BizTalk projects

  • Using the WCF service model

  • Using the WCF channel model

The Microsoft BizTalk Adapter for SQL Server exposes operations that applications can invoke on it and that it can, in turn, invoke on applications. These operations are invoked by sending SOAP messages over a channel. If a response is required, it is returned in a SOAP message over the same channel. For information about the message structure and the SOAP action associated with each operation, see Messages and Message Schemas for BizTalk Adapter for SQL Server.

This section provides information about the operations supported on the SQL Server database using the SQL adapter.

In This Section

  • Performing Basic Insert, Update, Delete, and Select Operations on Tables and Views

  • Operations on Tables and Views That Contain Large Data Types

  • Operations on Tables and Views with User-Defined Types

  • Executing Stored Procedures in SQL Server

  • Executing Scalar Functions in SQL Server

  • Executing Table-Valued Functions in SQL Server

  • Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

  • Operations on Tables and Views That Contain Large Data Types

  • Support for Composite Operations

  • Support for Polling

  • Receiving Query Notifications

See Also

Other Resources

Overview of BizTalk Adapter for SQL Server


Performing Basic Insert, Update, Delete, and Select Operations on Tables and Views

The Microsoft BizTalk Adapter for SQL Server surfaces a set of standard operations on each table and view in the SQL Server database. By using these operations, you can execute simple INSERT, UPDATE, SELECT, and DELETE statements qualified by a WHERE clause on the target table or view. These operations are also called data manipulation language (DML) operations.

The following table shows the DML operations that the SQL adapter supports:

Operation Description

Insert

Performs an Insert operation on the target table or view.

  • The Insert operation takes an array of records as input. Each record is strongly typed to the target table, and maps to the row being inserted in the table.

  • You can insert values in identity columns provided the value of the AllowIdentityInsert binding property is set to TRUE. For more information about the AllowIdentityInsert binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

  • The return value of the Insert operation is an array of Long data type. This array stores the identity values of the inserted rows, if any. If there is no identity column in a table, the return value is NULL.

Some values in the Insert operation message are treated in the following manner by the SQL adapter:

  • Values specified for computed columns and timestamp columns are ignored.

  • If the node for an identity column is null, it is ignored.

For all other values in the Insert operation message:

  • If a value is specified for a column, that value is used in the INSERT statement.

  • If the node for a particular column is null, NULL is used in the INSERT statement.

Note
If for a particular record, there are no values that can be used in the INSERT statement (that is, either no values were specified for any column or all the column values were ignored), the adapter executes the following SQL statement:

insert into <table_name> default values

Select

Performs a SELECT statement on the target table or view based on an array of records (columns) and a query string that specifies a WHERE clause.

  • A value must be specified for the list of the columns in the SELECT statement. If all columns have to be retrieved in a table or view, * must be specified in the SELECT statement. If specific columns have to be retrieved, the column names must be separated by comma, and specified in the same order as they are defined in the table or view.

  • The WHERE clause must be included in the SELECT statement. However, if you do not want to specify a value in the WHERE clause, you can either delete the Query element or leave it empty.

  • The Select operation also allows you to perform an Update operation. In this case, the UPDATE statement is placed inside the Query element of the SELECT statement.

The return value of the Select operation is a strongly-typed result set that contains the specified columns and rows from the target table or view.

Update

Performs an Update operation on the target table or view.

  • The Update operation takes an array of record pairs as input. Each record pair is a collection of two records, and each record is strongly-typed to the target table.

    • The first record corresponds to new values that need to be updated, that is, it corresponds to the SET clause of the UPDATE statement.

    • The second record corresponds to the old values of the rows, that is, it corresponds to the WHERE clause of the UPDATE statement.

    Note
    If, for a particular record pair, there are no values that can be used in the SET clause, no UPDATE statement is executed for that record pair.

  • You can update values in identity columns provided the value of the AllowIdentityInsert binding property is set to TRUE. For more information about the AllowIdentityInsert binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

  • The return value of the Update operation is of Int32 data type, and denotes the number of rows updated.

Some values in the Update operation message are treated in the following manner by the SQL adapter:

  • Values specified for computed columns and timestamp columns in the SET clause of the message are ignored.

  • If a User Defined Type (UDT) is not byte ordered, the value specified for the UDT column in the WHERE clause is ignored.

  • If the node for an identity column is null in the SET clause of the message, it is ignored.

  • If the node for an identity or timestamp column is null in the WHERE clause of the message, it is ignored.

  • If the node for an image, XML, Text or Ntext column is not null in the WHERE clause of the message, the values specified for them are ignored because these values cannot be compared.

For all other values in the Update operation message:

  • If a value is specified for a column in the SET clause of the UPDATE statement, the value is used in the SET clause of the statement (set <column_name> = <value>).

  • If the node for a particular column is null in the SET clause, NULL is used in the UPDATE statement (set <column_name> = null).

  • If a value is specified for a column in the WHERE clause of the UPDATE statement, the value is used in the WHERE clause of the statement (where <column_name> = <value>).

  • If the node for a particular column is null in the WHERE clause of the UPDATE statement, NULL is used in the UPDATE statement (where <column_name> is null).

Delete

Performs a Delete operation on the target table or view based on a strongly-typed array of records (list of column names) of the target table and a filter string that specifies a WHERE clause.

The return value of the Delete operation is of Int32 data type, and denotes the number of rows deleted.

Some values in the Delete operation message are treated in the following manner by the SQL adapter:

  • If the node for an image, XML, Text or Ntext column is not null in the WHERE clause of the message, the values specified for them are ignored because these values cannot be compared.

  • If the node for an identity or timestamp column is null, it is ignored.

  • If a UDT is not byte ordered, the value specified for the UDT column in the WHERE clause is ignored.

For all other values in the Delete operation message:

  • If a value is specified for a column, the value is used in the WHERE clause of the DELETE statement (where <column_name> = <value>).

  • If the node for a particular column is null, NULL is used in the DELETE statement (where <column_name> is null).

Note
If, for a particular record, there are no values that can be used in the DELETE statement (that is, either no values were specified for any column or if all the column values present were ignored), the adapter does not execute any DELETE statement.

For more information about:

  • Performing these operations using BizTalk Server, see Performing Basic Insert, Update, Delete, and Select Operations by Using BizTalk Server.

  • Message structures and SOAP action for performing DML operations, see Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Operations on Tables and Views That Contain Large Data Types

The Microsoft BizTalk Adapter for SQL Server provides supports for the following SQL Server large data types:

  • Varchar(Max)

  • Nvarchar(Max)

  • Varbinary(Max)

To read large data values from SQL Server, the SQL adapter exposes the Select operation.

To write large data values to SQL Server, the SQL adapter exposes the Set<column_name> operation, where <column_name> is the name of the column of type Varchar(Max), Nvarchar(Max) or Varbinary(Max). The Set<column_name> operation also allows adapter clients to write FILESTREAM data in SQL Server 2008.

Note
The Set<column_name> operation is available only for those tables and views that contain columns with any of the three large data types mentioned earlier.

For detailed information about performing operations on tables and views in SQL Server that contain large data types, see Performing Operations on Tables and Views with Large Data Types by Using BizTalk Server.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Operations on Tables and Views with User-Defined Types

You can use the SQL adapter to perform operations on tables or views that have columns of user-defined types (UDTs). You can use the standard table operations (Insert, Update, Delete, and Select) to read or write data into columns on UDT types. You can also execute stored procedures and functions on such tables. However, you need to perform certain tasks before you can use the adapter to operate on tables with UDT columns. Once you have performed these tasks, you can use the adapter to:

  • Perform Insert, Delete, Update, and Select operations, as described in Performing Basic Insert, Update, Delete, and Select Operations by Using BizTalk Server.

  • Execute stored procedures, as described in Executing Stored Procedures in SQL Server by Using BizTalk Server.

  • Perform composite operations on tables with UDT columns, as described in Performing Composite Operations on SQL Server by Using BizTalk Server

  • Poll tables with UDT columns, as described in Receiving Polling-based Data-changed Messages from SQL Server by Using BizTalk Server.

  • Perform other operations, as described in Developing BizTalk Applications.

Considerations While Performing Operations on Tables with UDTs

You must perform the following tasks before you can use the adapter to perform operations on tables with UDT columns.

For SQL Server 2005

  • While generating schema for operation using Visual Studio. Make sure the respective assemblies of the UDTs are available at the same location as the Visual Studio executable, devenv.exe. The executable is typically available at <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • While performing the operation using BizTalk Server. Make sure the respective assemblies for the UDTs are available under the BizTalk Server installation location. For BizTalk Server 2006 R2, typically this is <installation drive>:\Program Files\Microsoft BizTalk Server 2006. For BizTalk Server 2013, typically this is <installation drive>:\Program Files\Microsoft BizTalk Server 2013.

  • While performing the operation using Visual Studio. Make sure the respective assemblies for the UDTs are at the same location as the project executable file, which typically is under the project’s \bin\Debug folder.

For SQL Server 2008

  • While generating schema for operation using Visual Studio

    UDT Type Location of Assemblies

    UDTs shipped with SQL Server 2008, for example, Geography

    • Make sure Microsoft.SqlServer.Types.dll is added to the GAC.

    • Make sure SqlServerSpatial.dll is available in the System32 folder.

    You can install these DLLs on the computer by running the SQL Server 2008 setup and selecting Management Tools – Basic and Management Tools – Complete in the Feature Selection page of the wizard.

    UDTs not shipped with SQL Server 2008 but defined by users

    Make sure the respective assemblies for the UDTs are available at the same location as the Visual Studio executable, devenv.exe. The executable is typically available at <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • While performing the operation using BizTalk Server

    UDT Type Location of Assemblies

    UDTs shipped with SQL Server 2008, for example, Geography

    • Make sure Microsoft.SqlServer.Types.dll is added to the GAC.

    • Make sure SqlServerSpatial.dll is available in the System32 folder.

    You can install these DLLs on the computer by running the SQL Server 2008 setup and selecting Management Tools – Basic and Management Tools – Complete in the Feature Selection page of the wizard.

    UDTs not shipped with SQL Server 2008 but defined by users

    Make sure the respective assemblies for the UDTs are available under the BizTalk Server installation location. For BizTalk Server 2013, typically this is <installation drive>:\Program Files\Microsoft BizTalk Server 2013.

  • While performing the operation using Visual Studio

    UDT Type Location of Assemblies

    UDTs shipped with SQL Server 2008, for example, Geography

    • Make sure Microsoft.SqlServer.Types.dll is added to the GAC.

    • Make sure SqlServerSpatial.dll is available in the System32 folder.

    You can install these DLLs on the computer by running the SQL Server 2008 setup and selecting Management Tools – Basic and Management Tools – Complete in the Feature Selection page of the wizard.

    UDTs not shipped with SQL Server 2008 but defined by users

    Make sure the respective assemblies for the UDTs are available at the same location as the project executable file, which typically is under the project’s \bin\Debug folder.

Once you have completed these tasks, you are all set to perform operations on tables with UDTs.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Executing Stored Procedures in SQL Server

The Transact-SQL and CLR stored procedures in SQL Server are surfaced as operations in Microsoft BizTalk Adapter for SQL Server under the Procedures node while using the Consume Adapter Service Add-in or Add Adapter Service Reference Plug-in. The operation names exposed by the SQL adapter are the same as the name of the stored procedure in SQL Server. All the parameters in the stored procedure are exposed in the corresponding operation. The OUT parameter contains the return value of the stored procedure. The result set of the stored procedure is an array of DataSet. For more information about DataSet, see http://go.microsoft.com/fwlink/?LinkId=196853. The schema information of the target object is obtained as part of the response message at run time.

However, if you want to obtain the schema information of the target object at design time, you must generate schemas for the procedures under the Strongly-Typed Procedures node in the Consume Adapter Service Add-in or Add Adapter Service Reference Plug-in. Note that the same stored procedures are surfaced under the Procedures and the Strongly-Typed Procedures node. The return value of the stored procedure is strongly typed, and not just an array of DataSet. As the schema information is available at the design time, you can use it to map the schema of the stored procedure to another schema for a different operation. For example, you can map the schema generated for a strongly-typed procedure to the schema generated for the Insert operation on a database table.

Note
You will not be able to view the schema information at design time for a strongly-typed stored procedure if:

  • You are using a cursor, which is a return value of another stored procedure, as the input parameter for the strongly-typed stored procedure.

  • It is a CLR stored procedure that performs some operations on a table.

Support for Stored Procedures with FOR XML Clause

The SQL adapter also enables you to execute stored procedures that have a SELECT statement with a FOR XML clause. A FOR XML clause is used in a SELECT statement to return the results as XML instead of a rowset. For more information about the FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

Note
The “native” SQL adapter available with BizTalk Server supports only those stored procedures that return XML, that is, have the FOR XML clause in the SELECT statement. With the support for stored procedures with FOR XML clause, you can execute these stored procedures using the WCF-based SQL adapter without making any changes to the stored procedure definition.

Support for Stored Procedures with Temporary Tables

The SQL adapter enables you to generate metadata for stored procedures that contain temporary tables in their definitions. However, for such stored procedures you must generate metadata by selecting the stored procedures only from the Procedures node, while using the Add Adapter Service Reference Plug-in or Consume Adapter Service Add-in. The adapter does not support generating metadata for such stored procedures from under the Strongly-Typed Procedures node.

Support for Result Sets Containing Columns Without Names or With Same Names

The following table lists how the SQL adapter handles columns without names and same names in the result sets for stored procedures and strongly-typed stored procedures.

Result set contains… Stored Procedure Strongly-Typed Stored Procedure

Columns without names

The SQL adapter generates a name for the column in the following way: a unique ID (GUID) is generated for the column without "-" (hyphen), and then the GUID string is prefixed by "C" because the generated GUID might start with a digit but an XML tag name cannot.

The SQL adapter generates the following name for the column: “UnNamedColumn[column_index]”, where column_index starts from ‘0’.

Columns with same names

The names of the columns other than the first one are appended with “_” (underscore) followed by a random GUID without "-" (hyphen). For example: “_[GUID]”.

The SQL adapter does not support columns with same names in the result sets, and throws an exception.

Important
You must ensure that the column names in a result set have unique names.

Note
In general, it is recommended that all the columns in a result set for stored procedures and strongly-typed stored procedures must be named, and have unique names.

For more information about:

  • How to execute stored procedures, see Executing Stored Procedures in SQL Server by Using BizTalk Server.

  • How to execute stored procedures having a FOR XML clause, see Executing Stored Procedures Having a FOR XML Clause.

  • Message schemas for the stored procedures, see Message Schemas for Procedures and Functions.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Executing Scalar Functions in SQL Server

The Transact-SQL and CLR scalar functions in SQL Server are surfaced as operations in Microsoft BizTalk Adapter for SQL Server. The operation name in the SQL adapter is the same as the name of the scalar function in SQL Server.

All the parameters in the scalar function are exposed in the corresponding operation. The return value of the operation in the SQL adapter is the same as the return value defined in the scalar function in SQL Server.

For more information about executing scalar functions, see Invoking Scalar Functions in SQL Server by Using BizTalk Server.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Executing Table-Valued Functions in SQL Server

The Transact-SQL and CLR table valued functions in SQL Server are surfaced as operations in Microsoft BizTalk Adapter for SQL Server. The operation name in the SQL adapter is the same as the name of the table valued function in SQL Server.

All the parameters in the table valued function are exposed in the corresponding operation. If you do not specify an input parameter for a table valued function, the SQL adapter internally invokes the function using the DEFAULT keyword. This implies that the table valued function is executed using the default value specified while defining the function.

For more information about:

  • Using the SQL adapter with BizTalk Server to invoke table valued functions in SQL Server, see Invoking Table-Valued Functions in SQL Server by Using BizTalk Server.

  • Message structure and SOAP actions for table valued functions, see Message Schemas for Procedures and Functions.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

The Microsoft BizTalk Adapter for SQL Server exposes the following operations at the root level:

  • ExecuteNonQuery: Use this operation to execute any arbitrary SQL statements in SQL Server if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and:

    • For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement.

    • For all other types of statements, the return value is -1.

  • ExecuteReader: Use this operation to execute any arbitrary SQL statements in SQL Server if you want the result set to be returned, if any, as an array of DataSet. For information about DataSet, see “DataSet Class” at http://go.microsoft.com/fwlink/?LinkID=196853.

  • ExecuteScalar: Use this operation to execute any arbitrary SQL statements in SQL Server to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.

    Note
    The advantage of ExecuteScalar over ExecuteReader is that the response message payload of the ExecuteScalar operation is much smaller compared to the one returned by the ExecuteReader operation. Therefore, if you require only one value to be returned, you should use ExecuteScalar instead of ExecuteReader.

You can use the ExecuteNonQuery, ExecuteReader or ExecuteScalar operation to execute multiple SQL statements.

For more information about performing these operations using the BizTalk Server, see Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using BizTalk Server.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Support for Composite Operations

The Microsoft BizTalk Adapter for SQL Server enables adapter clients to perform composite operations on the SQL Server database. A composite operation can include any number of the following operations, and in any order:

  • The Insert, Update, and Delete operations on the tables and views.

  • Stored procedures that are surfaced as operations in the adapter.

The operations in a composite operation must target tables and views only in a single database.

For information about:

  • How to perform composite operations in SQL adapter using the BizTalk Server, see Performing Composite Operations on SQL Server by Using BizTalk Server.

  • Message schemas for the composite operation, see Message Schemas for Composite Operations.

Important
If there are “n” number of operations in a composite operation that return a result set then “n+1” number of connections are required for the composite operation to be executed. Therefore, you must ensure that the value specified for the MaxConnectionPoolSize binding property is n+1 or greater. For more information about the MaxConnectionPoolSize binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Support for Polling

Microsoft BizTalk Adapter for SQL Server enables adapter clients to receive data-change messages from the SQL Server database. The SQL adapter supports receiving "polling-based" messages wherein the adapter executes a specified SQL statement (SELECT statement or stored procedure), retrieves or updates the data, and provides the result to the adapter client at regular intervals of time.

The SQL adapter exposes the following operations for polling:

  • Polling: Enables you to receive periodic data-change messages for SQL Server tables or views. The messages are not strongly-typed.

  • TypedPolling: Enables you to receive strongly-typed messages from the SQL Server database. You must use this operation if you intend to map the elements in the polling message to any other schema.

  • XmlPolling. Enables you to use SELECT statements or stored procedures that use a FOR XML clause and return data as XML messages. This operation returns the polling message as an XML message.

    For more information about FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

For more information about polling in the SQL adapter, see Receiving Polling-based Data-changed Messages from SQL Server by Using BizTalk Server.

Polling

A typical polling operation using the SQL adapter involves the following:

  1. The adapter clients must specify Polling as the inbound operation in the InboundOperationType binding property. The default value for this binding property is Polling.

  2. The adapter clients must specify a SQL statement for the PolledDataAvailableStatement binding property that determines whether there is data available for polling. The first column of the first row of the first result set returned on executing this statement contains an integer value. If there is no data available for polling, the return value is 0 (zero). If there is data available, the return value is greater than zero.

  3. The adapter clients must specify a polling interval for the PollingIntervalInSeconds binding property to define the interval at which the statement in the PolledDataAvailableStatement binding property is executed. At the end of every polling interval, the polled data available statement is executed, and the result set is returned.

  4. The adapter clients must specify a polling SQL statement (SELECT statement or stored procedure) for the PollingStatement binding property. If there is data available for polling (determined by the PolledDataAvailableStatement binding property), the adapter executes the polling statement to obtain and update (if applicable) the data in the SQL Server database. When the SQL adapter is used with BizTalk Server, the same transaction is also used to submit the message to BizTalk Server.

  5. The adapter clients can use the PollWhileDataFound binding property to ignore the polling interval, and continuously poll data, as and when available.

  6. The result sets that are returned as a result of executing the polling statement are sent to the adapter client as the inbound message.

Note
An XmlPolling operation involves the same steps as the Polling operation.

Strongly-Typed Polling

A typical strongly-typed polling operation using the SQL adapter involves the following:

  1. The adapter clients must specify TypedPolling as the inbound operation in the InboundOperationType binding property. The default value for this binding property is Polling.

  2. The adapter clients must specify an inbound ID as part of the connection URI. The inbound ID could be any string and is appended to the standard namespace of the TypedPolling operation to prevent namespace collisions.

  3. The rest of the steps are same as steps 2–6 listed in the Polling operation described in the preceding section.

For detailed information about the binding properties related to polling and strongly-typed polling, see Working with BizTalk Adapter for SQL Server Binding Properties.

Note
Multiple result sets can be returned as a result of executing the polling statement. If the result sets do not contain any rows, no messages are sent to the adapter client.

The illustration below provides information about the polling workflow in SQL adapter. Two scenarios for the polling workflow are illustrated:

  1. When the value of the PollWhileDataFound is set to “False” (default setting).

  2. When the value of the PollWhileDataFound is set to “True.”

Polling Workflow (PollWhileDataFound = False) Polling Workflow (PollWhileDataFound = True)

Differences between Polling and Query Notification

Though polling and query notification are both inbound operations, and inform the adapter clients about the data changes in the SQL Server database, the following table lists some differences between the two. The following differences will help you decide on an operation depending on your requirements:

Polling Query Notification

Polling is initiated by the adapter. The adapter executes a statement to validate whether data is available for polling, and then initiates polling by executing the polling statement if some data is available for polling.

Query notification is initiated by SQL Server. The notification statement issued by the adapter just instructs the database to initiate notification in case there is a change in the result set of the statement.

You can use the polling statement to read or update data in a SQL Server database table.

You can use the query notification statement to only read data in a SQL Server database table.

Polling informs you about the actual data that has changed.

Query notification only informs about the type of change in the data such as Insert, Update, and Delete.

The data-change notification depends on the polling interval, and the adapter clients are informed about the data changes at the end of every polling interval.

Tip
Polling can give you better throughput in scenarios where the data changes are happening continuously, and you do not want to be notified of each change as and when it happens. Instead, you specify a polling interval after which you want to be notified of all the changes that have happened since the last data-change notification.

The data-change notification is instantaneous.

For more information about query notification in Microsoft BizTalk Adapter for SQL Server, see Receiving Query Notifications by Using BizTalk Server.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Receiving Query Notifications

The adapter clients can subscribe to receive query notifications about the data changes in the SQL Server database. A SQL SELECT statement or a stored procedure specifies the data-change criteria in a table for triggering of the query notifications, and the SQL Server sends query notifications as and when the result set for the SELECT statement or the stored procedure changes.

Important
To support query notifications, the adapter clients and the SQL Server database have to fulfill certain requirements. For detailed information about these requirements, see “Enabling Query Notifications” at http://go.microsoft.com/fwlink/?LinkID=122323.

A typical query notification involves the following:

  • The adapter clients must specify Notification as the inbound operation in the InboundOperationType binding property. The default value for this binding property is Polling.

  • The adapter clients must specify a SQL statement to register for query notifications in the NotificationStatement binding property. The adapter client gets a notification from SQL Server as soon as the result set for the specified SQL statement changes.

    Important
    To receive notifications, the SQL statement for the notification subscription must meet certain criteria. For information about SQL statements that can be used for query notifications, see http://go.microsoft.com/fwlink/?LinkId=122160.

  • The adapter clients must specify whether the adapter sends a notification to the adapter clients as soon as the listener is started in the NotifyOnListenerStart binding property.

  • The notification is sent to the adapter clients as and when the result set of the SQL statement specified in the NotificationStatement binding property is changed.

For more information about these binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

Note
The notification subscription is always committed, regardless of whether the transaction in which the statement ran was committed or rolled back. Therefore, the notification operation might not guarantee that the result of the query subscribed for notification has changed. For example, suppose data is inserted in a table row (subscribed for notification) in a transaction, and immediately a notification is sent to the adapter informing about the change (insert). Due to some reason, the transaction rolls back, and effectively no data is inserted into the table row. However, the SQL Server does not send a notification to the adapter about the transaction roll back. For information about query notifications in SQL Server, see http://go.microsoft.com/fwlink/?LinkId=145367.

Differences between Query Notification and Polling

Though query notification and polling are both inbound operations, and inform the adapter clients about the data changes in the SQL Server database, the following table lists some differences between the two. The following differences will help you decide on an operation depending on your requirements:

Query Notification Polling

Query notification is initiated by SQL Server. The notification statement issued by the adapter just instructs the database to initiate notification in case there is a change in the result set of the statement.

Polling is initiated by the adapter. The adapter executes a statement to validate whether data is available for polling, and then initiates polling by executing the polling statement if some data is available for polling.

You can use the query notification statement to only read data in a SQL Server database table.

You can use the polling statement to read or update data in a SQL Server database table.

Query notification informs only about the type of change in the data such as Insert, Update, and Delete.

Polling informs you about the actual data that has changed.

The data-change notification is instantaneous.

The data-change notification depends on the polling interval, and the adapter clients are informed about the data changes at the end of every polling interval.

Tip
Polling can give you better throughput in scenarios where the data changes are happening continuously, and you do not want to be notified of each change as and when it happens. Instead, you specify a polling interval after which you want to be notified of all the changes that have happened since the last change notification.

For more information about query notification in Microsoft BizTalk Adapter for SQL Server, see Receiving Query Notifications by Using BizTalk Server.

See Also

Other Resources

What Operations Can Be Performed Using the Adapter?


Other Features Supported by the Adapter

In addition to the features discussed throughout the topics of Overview of BizTalk Adapter for SQL Server, the Microsoft BizTalk Adapter for SQL Server also provides the following features that are useful for adapter clients:

  • Support for configuring adapters using binding properties. Adapter clients can configure the SQL adapter by specifying certain binding properties. For example, clients can specify the maximum number of connections allowed in a connection pool for a specific connection string by setting the MaxConnectionPoolSize binding property. For more information, see Working with BizTalk Adapter for SQL Server Binding Properties.

  • Support for null values for operation parameters. Adapter clients can provide null values for operation parameters using the XSD "nillable" attribute.

  • Support for dynamic ports in BizTalk. Through the BizTalk WCF-Custom adapter, the SQL adapter supports a dynamic port that enables dynamic routing of messages from BizTalk Server based on the message context properties. For more information, see Configuring Dynamic Ports.

  • Support for performance counters. The SQL adapter supports WCF-based performance counters for use by adapter clients. For more information about performance counters, see Using Performance Counters.

See Also

Other Resources

Overview of BizTalk Adapter for SQL Server


New Features in BizTalk Adapter for SQL Server

This section lists the features in Microsoft BizTalk Adapter for SQL Server.

Note
This topic has been used from the previous version of Microsoft BizTalk Adapter for SQL Server Help.

Features in the SQL Adapter

Following are the features introduced in the previous releases of the SQL adapter.

Technology-Related Features

Feature | Comment
Use of Windows Communication Foundation (WCF) | The SQL adapter is built on top of the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK (WCF LOB Adapter SDK). In turn, the WCF LOB Adapter SDK is built on top of WCF. The adapter is exposed as a WCF channel to adapter clients. This enables connectivity, metadata exchange, and business data exchange with external systems.
Support for the WCF channel model and the WCF service model | In the WCF channel model, adapter clients can consume the SQL adapter by directly sending and receiving XML messages. In the WCF service model, adapter clients can generate a .NET proxy class from the Web Services Description Language (WSDL) obtained by using the SQL adapter.
Support for 64-bit platforms | The SQL adapter is now available for 64-bit platforms.

Metadata-Related Features

Feature Comment

Browse, search, and retrieve metadata

The adapter clients can browse and search metadata in batches by specifying a batch size. This feature is available only when programming into the adapter and not through the Consume Adapter Service BizTalk Project Add-in. The metadata search is supported at the Tables, Views, Procedures, Scalar Functions, and Table Valued Functions levels. The search string is used directly within a SQL statement.

Support for invoking artifacts with same name in different databases

In the SQL adapter, the namespaces in the XML Schema Definition (XSD) file contained only the schema name, and in some cases the object name. However, if an application wants to execute operations on identically named artifacts with different metadata in different databases, the generated metadata will conflict. The only way to distinguish the metadata is to use the database name in the XSD namespaces.

The current version of the SQL adapter allows you to specify the database name in the XSD namespaces by setting the value of the UseDatabaseNameInXsdNamespace binding property to TRUE. The default value of the binding property is false, which implies that the XSD namespaces will not contain the database name. For more information about the UseDatabaseNameInXsdNamespace binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

Performance-Related Features

Feature | Comment
Support for performance counters | The SQL adapter supports WCF-based performance counters for use by adapter clients. For more information about performance counters, see Using Performance Counters.

Operations-Related Features

Feature Comment

Support for the SQL Server 2005 and SQL Server 2008 data types

The SQL adapter supports the following data types introduced in:

  • SQL Server 2005: XML, Varchar(Max), and Varbinary(Max).

  • SQL Server 2008: Date, Time, Datetimeoffset, Datetime2, Hierarchyid, Geography, Geometry, and FILESTREAM.

Support for User-Defined Types (UDTs)

The SQL adapter supports performing operations on tables and views that contain UDTs. For information about support for UDTs, see Operations on Tables and Views with User-Defined Types.

Support for executing Transact-SQL and CLR stored procedures and functions

Adapter clients can execute Transact-SQL and CLR:

  • Stored procedures in a SQL Server database.

  • Scalar and table valued functions in a SQL Server database.

For more information about this, see What Operations Can Be Performed Using the Adapter?.

Support for executing stored procedures with or without the FOR XML clause

The SQL adapter enables you to execute stored procedures that have a SELECT statement with or without a FOR XML clause. The previous version of the adapter supported only those stored procedures that had a FOR XML clause in the SELECT statement. For information about executing stored procedures, see Executing Stored Procedures in SQL Server.

Support for streaming of large objects

Adapter clients can stream large character and binary fields in the SQL Server database using the Set<column name> operation, where <column_name> is the name of the column of type Varchar(Max), Nvarchar(Max) or Varbinary(Max). The Set<column name> operation also allows you to insert or update FILESTREAM data in a SQL Server 2008 database. For more information about this, see Operations on Tables and Views That Contain Large Data Types.

Note
To read character and binary fields in SQL Server tables and views, adapter clients use the Select operation.

Support for query notifications

Adapter clients can receive query notifications from SQL Server based on a triggering SELECT statement or a stored procedure. The notification is sent by the SQL Server to the adapter clients as and when the result set for the SELECT statement or the stored procedure changes. For more information about query notifications, see Receiving Query Notifications.

Support for executing arbitrary SQL statements

The SQL adapter enables adapter clients to execute arbitrary SQL statements using the ExecuteNonQuery, ExecuteReader, and ExecuteScalar operations. For more information about these operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

Support for composite operations

The SQL adapter enables adapter clients to perform composite operations on the SQL Server database. A composite operation can include any number of the following operations, and in any order:

  • The Insert, Update, and Delete operations on the tables and views.

  • Stored procedures that are surfaced as operations in the adapter.

For more information about composite operations, see Support for Composite Operations.

Enhanced polling

The SQL adapter now supports two additional types of polling: TypedPolling and XmlPolling. For information about these polling types, see Support for Polling.

Support for performing operations on artifacts in multiple schemas

Apart from the default schema (dbo), adapter clients can also perform operations on artifacts in other schemas in the SQL Server database provided that the user credentials used to connect using the SQL adapter has access to those schemas in the SQL Server database. For information about a schema in SQL Server database, see http://go.microsoft.com/fwlink/?LinkId=130148.

See Also

Other Resources

Overview of BizTalk Adapter for SQL Server


Limitations of BizTalk Adapter for SQL Server

The following are known limitations for Microsoft BizTalk Adapter for SQL Server:

  • The SQL adapter does not support synonyms created in the SQL Server database. For information about synonyms in SQL Server, see http://go.microsoft.com/fwlink/?LinkId=120111.

  • If you change the system time of the computer running the BizTalk Server host, the time is not updated automatically in the BizTalk Server host. This could lead to incorrect behavior of the inbound operations that use the receive port of BizTalk Server. As a workaround, you must restart the host instance that has a receive port after you have changed the system time of the computer running it.

  • If a parameter name in a stored procedure contains 127 or more characters, you cannot execute the stored procedure using the SQL adapter. This is due to the limitation of ADO.NET.

  • The WSDL the SQL adapter generates, when converted to a proxy, exposes the DateTimeOffset column as System.DateTime. This data type cannot store time zone information. As a consequence, any date/time value the adapter sends to the proxy will be converted into local time in the .NET application. If you wish to keep the time zone information, you must change the interface of your proxy to use the String type instead of System.DateTime. Then, use XmlConvert.ToDateTimeOffset to create a Sytstem.DateTimeOffset object, which can store the timezone information.

See Also

Other Resources

Understanding BizTalk Adapter for SQL Server


SQL Adapter Tutorials

The first of the SQL adapter tutorials contains detailed instructions on how to migrate BizTalk projects created using the previous version of the SQL adapter to use the WCF-based SQL adapter. The other SQL adapter contains, scenario-based, step-by-step instructions on performing operations on SQL Server using the SQL adapter.

Also, the topics in the Developing BizTalk Applications section provide detailed instructions on how to use the SQL adapter with BizTalk Server.

In This Section

  • Tutorial 1: Migrating BizTalk Projects

  • Tutorial 2: Employee - Purchase Order Process

See Also

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


Tutorial 1: Migrating BizTalk Projects

The previous version of the SQL adapter that shipped with Microsoft BizTalk Server differs from the WCF-based SQL adapter in many aspects, including:

  • The design-time experience of creating a BizTalk project.

  • The metadata retrieval experience.

  • Schema file name and namespace.

  • Data type mappings.

  • The operations that can be performed using the adapter.

  • Physical port configuration in the BizTalk Server Administration console

These differences are explained in the topics within Migrating BizTalk Projects Created Using the Previous Version of the SQLadapter.

However, you can make changes to the BizTalk project that was created using the previous version of the adapter and make it work with the WCF-based SQL adapter.

This tutorial provides instructions on the changes you should make to the existing BizTalk project created using the previous version of the adapter.

Note
In this tutorial, for the sake of brevity, the previous version of the SQL adapter will be referred to as vPrev SQL adapter. Similarly, a BizTalk project that uses the vPrev SQL adapter will be referred to as vPrev BizTalk project.

Important
This tutorial provides guidance on how to migrate a vPrev SQL adapter BizTalk project that performs a basic insert operation on a SQL Server database table. This tutorial does not cover all possible scenarios for migration from the vPrev SQL adapter to the new WCF-based SQL adapter. You must use this migration tutorial as a foundation and modify accordingly to make changes that are relevant to your existing project.

Sample Used for the Tutorial

This tutorial is based upon a sample (SQL_Migration) that demonstrates how to migrate a vPrev BizTalk project. The sample is provided with Microsoft BizTalk Adapter Pack. For more information, see Samples.

Prerequisites

  • You must have a vPrev BizTalk project. This tutorial involves a BizTalk project that performs an Insert operation on a Customer table in the SQL Server database. The Customer table has the following design:

    Column Name Description

    v_custid

    Primary key, integer type, identity field

    Name

    nchar(10) type

  • You must have a request message to perform an Insert operation on the SQL Server database using the vPrev SQL adapter. The request message must conform to the schema of the Insert operation generated using the vPrev SQL adapter.

  • You should have completed the steps in Before You Develop BizTalk Applications.

Understanding a BizTalk Project Created Using the Previous Version of the Adapter

The key constituents of a vPrev BizTalk project created are:

  • BizTalk orchestration. This is a simple orchestration that picks request messages from a file location, sends the request message to the SQL Server database using a WCF-Custom send-receive port, receives the response, and saves it to another file location.

  • Schema for the operation you wish to perform on the SQL Server database. This tutorial involves a BizTalk project that performs an Insert operation on the Customer table. The schema generated for the Customer table is InsertCustomerService.xsd. This schema is generated using the vPrev SQL adapter.

  • Request message. The request message to perform an Insert operation on the Customer table. The schema of the request message conforms to the schema of the Insert operation as surfaced by the previous version of the SQL adapter.

How to Migrate a BizTalk Project Created Using the Previous Version of the Adapter

The goal of this migration tutorial is to enable you to send a request message, which conforms to schema generated by vPrev SQL adapter, using a WCF-Custom port that can only process messages conforming to the WCF-based SQL adapter. So, in short, the migration exercise involves configuring the WCF-Custom port to process messages that do not conform to the WCF-based SQL adapter's schema.

However, to be able to configure the WCF-Custom port appropriately, you must perform the following tasks:

  • Generate metadata for the Insert operation on the Customer table using the WCF-based SQL adapter.

  • Map the request message for performing an Insert operation using the vPrev SQL adapter to a request message for performing an Insert operation using the WCF-based SQL adapter.

  • Map the response message received using the WCF-based SQL adapter to the response message for the vPrev SQL adapter.

  • Create a WCF-Custom SQL send-receive port in the BizTalk Server Administration console.

  • Configure the WCF-Custom port to use the request and response mappings.

In This Section

  • Step 1: Modify the vPrev BizTalk Project

  • Step 2: Configure the Orchestration in BizTalk Server Administration Console

  • Step 3: Test the Migrated Application

See Also

Other Resources

SQL Adapter Tutorials

© 2013 Microsoft Corporation. All rights reserved.


Step 1: Modify the vPrev BizTalk Project
Step 1 of 3

Time to complete: 10 minutes

Objective: In this step, you make the following changes to the existing vPrev BizTalk project:

  • Generate metadata for the Insert operation on the Customer table using the WCF-based SQL adapter.

  • Map the request message for performing an Insert operation using the vPrev SQL adapter to a request message for performing an Insert operation using the WCF-based SQL adapter.

  • Map the response message received using the WCF-based SQL adapter to the response message received using the vPrev SQL adapter.

Prerequisites

You must have a vPrev BizTalk project to perform an Insert operation on the Customer table in the SQL Server database.

To modify the vPrev BizTalk project

  1. Generate metadata for the Insert operation on the Customer table using the WCF-based SQL adapter. You can use the Consume Adapter Service BizTalk Project Add-in to generate metadata.

    For instructions on how to generate metadata, see Retrieving Metadata for SQL Server Operations in Visual Studio. After the schema is generated, a file with the name similar to TableOperation.dbo.Customer.xsd is added to the BizTalk project. This file contains the schema for sending a message to perform an Insert operation on the Customer table in the SQL Server database using the WCF-based SQL adapter.

  2. Generating the metadata for the Insert operation also creates a port binding file. In the next step, this binding file will be used to create a WCF-Custom send port to send messages to the SQL Server database. The SOAP action for the operation is also set to the operation for which you generated metadata. For example, if you generate metadata for the Insert operation, the operation name in the SOAP action on the send port will be “Insert”. However, the operation name on the logical send port that you create as part of the orchestration could be different, for example, “Operation_1”. As a result, when you send messages to the SQL Server database using the send port, you get an error. To prevent this, make sure the operation name on the logical send port in your orchestration is the same as the operation name for which you generated metadata.

    So, in case of this tutorial, because you generate metadata for the Insert operation, change the name of the logical send port operation to “Insert”.

  3. For the request message, map the schema generated using vPrev SQL database adapter to the schema generated using the WCF-based SQL adapter.

    1. Add a BizTalk Mapper to the BizTalk project. Right-click the BizTalk project, point to Add, and then click New Item.

      In the Add New Item dialog box, from the left pane, select Map Files. From the right pane, select Map. Specify a name for the map, such as RequestMap.btm. Click Add.

    2. From the Source Schema pane, click Open Source Schema.

    3. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and then select the schema for the request message for the vPrev SQL adapter. For this tutorial, select New_Migration.InsertCustomerService, and then click OK.

    4. In the Root Node for Source Schema dialog box, select Insert, and then click OK.

    5. From the Destination Schema pane, click Open Destination Schema.

    6. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and then select the schema for the request message for the WCF-based SQL adapter. For this tutorial, select New_Migration.TableOperation.dbo.Customer, and then click OK.

    7. In the Root Node for Target Schema dialog box, select Insert, and then click OK.

    8. Map the respective elements in both the schemas as illustrated in the following figure.

      Map the request schemas
    9. Save the map.

  4. For the response message, map the schema generated using vPrev SQL adapter to the schema generated using the WCF-based SQL adapter.

    1. Add a BizTalk Mapper to the BizTalk project. Right-click the BizTalk project, point to Add, and click New Item.

      In the Add New Item dialog box, from the left pane, select Map Files. From the right pane, select Map. Specify a name for the map, such as ResponseMap.btm, and then click Add.

    2. From the Source Schema pane, click Open Source Schema.

    3. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and then select the schema for the response message for the WCF-based SQL adapter. For this tutorial, select New_Migration.TableOperation.dbo.Customer, and then click OK.

    4. In the Root Node for Source Schema dialog box, select InsertResponse, and then click OK.

    5. From the Destination Schema pane, click Open Destination Schema.

    6. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and then select the schema for the response message for the vPrev SQL adapter. For this tutorial, select New_Migration.InsertCustomerService, and then click OK.

    7. In the Root Node for Target Schema dialog box, select InsertResponse, and then click OK.

    8. You will notice a few differences between the response schemas for generated by the two adapters. These differences can be explained as follows:

      • Using the WCF-based SQL adapter, if you insert a record into a table that contains a primary key (and is also an identity field) the response for the Insert operation returns the value for the identity field for the inserted row. So, the schema for the response message conforming to the WCF-based SQL adapter contains an additional InsertResult element. This element contains an array, which in turn contains the identity fields for the inserted rows.

      • Using the vPrev SQL adapter, if you insert a record into a table, the adapter only returns an empty “Success” element as part of the response message.

      So, the schemas are mapped in such a way that the response from the WCF-based SQL adapter containing the value for the identity fields is “copied” as part of the “Success” element, which is part of the response message from the vPrev SQL adapter. You can use the Mass Copy functoid to copy elements from one schema into another.

      To use the Mass Copy functoid, from the Toolbox, drag the Mass Copy functoid and drop it on the Mapper grid. Connect the InsertResult element in the source schema to the functoid. Similarly, connect the Success element in the destination schema to the functoid. The following figure illustrates how the two elements are mapped via the functoid.

      Map the response schemas
      Note
      For more information about the Mass Copy functoid, see http://go.microsoft.com/fwlink/?LinkId=119749.

    9. Save the map.

  5. Save and build the BizTalk solution. Right-click the solution, and then click Build Solution.

  6. Deploy the solution. Right-click the solution, and then click Deploy Solution.

Next Steps

Create a WCF-custom send port, and configure it to use the maps you created in this step, as described in Step 2: Configure the Orchestration in BizTalk Server Administration Console.

See Also

Concepts

Tutorial 1: Migrating BizTalk Projects

© 2013 Microsoft Corporation. All rights reserved.


Step 2: Configure the Orchestration in BizTalk Server Administration Console
Step 2 of 3

Time to complete: 10 minutes

Objective: In this step, you perform the following tasks:

  • Create a WCF-Custom send-receive port to send and receive messages from the SQL Server database using the SQL adapter. Configure this port to use the maps you created in the previous step.

  • Configure the orchestration you deployed in the previous step to use the WCF-Custom port.

Prerequisites

You should have deployed the BizTalk orchestration for which you want to configure the WCF-Custom port as described in Step 1: Modify the vPrev BizTalk Project.

To create a WCF-Custom port

  1. When you generate schema for an operation on the SQL Server database using Consume Adapter Service BizTalk Project Add-in, a binding file is also added to the BizTalk project. You can import this binding file into your BizTalk application to create a WCF-Custom send-receive port. For instructions on importing a binding file, see Importing Bindings.

  2. After you import the binding file, a send port is created under the Send Ports folder in the BizTalk Server Administration console.

  3. Right-click the WCF-Custom port, and then click Properties.

  4. From the left pane of the send port properties dialog box, click the General tab. From the right pane, click Configure.

  5. In the WCF-Custom Transport Properties dialog box, click the Credentials tab, specify the credentials to connect to a SQL Server database, and then click OK.

  6. From the left pane of the send port properties dialog box, click Inbound Maps. From the right pane, click the field under the Map column, and from the drop-down select ResponseMap.

    Configure inbound map

  7. From the left pane of the send port properties dialog box, click Outbound Maps. From the right pane, click the field under the Map column, and from the drop-down select RequestMap.

    Configure outbound map

  8. Click OK.

To configure the BizTalk application

  1. In the BizTalk Server Administration console, expand BizTalk Group, expand Applications, and then expand the BizTalk Application where the orchestration is deployed.

  2. Right-click the BizTalk application, and then select Configure.

  3. From the left pane, click the orchestration to configure. From the right pane, from the Host drop-down list, select a BizTalk host instance.

  4. Under the Bindings box, map the logical ports of the BizTalk orchestration to the physical ports in the BizTalk Server Administration console.

    1. Select the file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    2. Select the file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    3. Select the WCF-Custom send port you created earlier in this topic.

    4. Click OK.

Next Steps

You have now completed migration of your vPrev BizTalk project to a BizTalk project that sends messages to the SQL Server database using the WCF-based SQL adapter. You must now test the migrated BizTalk application by sending a request message to perform an Insert operation on the SQL Server database, as described in Step 3: Test the Migrated Application.

See Also

Concepts

Tutorial 1: Migrating BizTalk Projects

© 2013 Microsoft Corporation. All rights reserved.


Step 3: Test the Migrated Application
Step 3 of 3

Time to complete: 5 minutes

Objective: In this step, you will test the migrated application by performing an Insert operation on the Customer table. To do this, you drop a request message that conforms to the schema generated using the vPrev SQL adapter.

Prerequisites

  • Configure the BizTalk application by mapping the logical ports in the BizTalk orchestration to physical ports in the BizTalk Server Administration console.

  • Configure the BizTalk application to use the WCF-Custom send port for the WCF-based SQL adapter.

To test the migrated application

  1. Create a request XML that conforms to the schema generated by the vPrev SQL adapter. Using the outbound map, the WCF-Custom send port converts this to conform to the schema for the WCF-based SQL adapter and sends it to the SQL Server database.

    Copy Code
    <Insert xmlns="http://SQLInsert">
  <sync>
    <after>
      <CustomerTable Name="John" />
    </after>
  </sync>
</Insert>

  2. Paste the request message to the folder that is mapped to the file receive location.

  3. The orchestration consumes the request message and sends it to the SQL Server database. The response from the SQL Server database is received in the schema that conforms to the schema of the WCF-based SQL adapter. Using the inbound map, the WCF-Custom send port converts this to the schema for the vPrev SQL adapter. The response from the SQL Server database is saved to the other file location defined as part of the orchestration. The response for the preceding request message is:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<InsertResponse xmlns="http://SQLInsert">
  <Success>
    <long xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">101</long>
  </Success>
</InsertResponse>

    In the preceding response, “101” is the value of the identity column inserted in the Customer table.

See Also

Concepts

Tutorial 1: Migrating BizTalk Projects

© 2013 Microsoft Corporation. All rights reserved.


Tutorial 2: Employee - Purchase Order Process

In this tutorial, you are automating the process where the Purchases department that places an equipment order every time a new employee joins the organization. Both employee details and purchase order details are maintained in Employee and Purchase_Order tables respectively, in a SQL Server database. The Purchases department is informed by updating the Purchase_Order table in the SQL Server database and by sending an e-mail. Within the process, the following actions occur:

  1. The adapter receives a notification each time the Employee table is updated. The adapter then sends a notification to the BizTalk orchestration.

  2. The BizTalk orchestration figures out whether the notification is for a new record inserted into the Employee table. If the notification is for any other operation on the Employee table, the orchestration does not perform any operation.

  3. If the notification is for an Insert operation on the Employee table, notifying that a new employee record was added, the orchestration uses the SQL adapter to read the details of the new record.

  4. The orchestration receives a response that contains the details of the new added employee record. The orchestration maps the Employee_ID and Designation fields in the response to the request message for the Insert operation on the Purchase_Order table.

  5. The orchestration then uses the SQL adapter to perform an Insert operation on the Purchase_Order table. The response for the Insert operation is sent to the Purchases department as an e-mail.

About the Database Objects Used in this Sample

This tutorial uses the database objects created by the SQL script shipped with the samples. For more information about the script and the samples, see Samples. The database objects that you will use in this tutorial are:

  • ADAPTER_SAMPLES database.

  • Employee and Purchase_Order tables.

  • UPDATE_EMPLOYEE stored procedure.

All these database objects are created when you run the SQL script provided with the sample. Make sure you run the script before you start with the tutorial.

Sample Based on This Tutorial

A sample, Employee_PurchaseOrder, which is based on this tutorial is also provided with the BizTalk Adapter Pack. For more information, see Samples.

We recommend that you go through the tutorial completely to understand how to create BizTalk projects using the adapter, and then look at the sample as a reference.

In This Section

  • Lesson 1: Generate Schemas and Create Messages

  • Lesson 2: Receive and Filter Notifications

  • Lesson 3: Execute a Stored Procedure to Select New Employees Added

  • Lesson 4: Perform an Insert Operation on the Purchase Order Table

  • Lesson 5: Deploy the Solution


Lesson 1: Generate Schemas and Create Messages

In this lesson, you create a BizTalk project in Visual Studio, generate the schemas for the operations you perform on the SQL Server database using the SQL adapter, and then create messages for those schemas.

In This Section

  • Step 1: Generate Schema for Operations

  • Step 2: Create Messages for BizTalk Orchestrations


Step 1: Generate Schema for Operations
Step 1 of 2

Time to complete: 5 minutes

Objective: In this step, you generate schemas for the operations that you perform on the SQL Server database using the SQL adapter. For this tutorial, you must generate schema for the following:

  • Notification (inbound operation).

  • UPDATE_EMPLOYEE stored procedure (outbound operation).

  • Insert operation on the Purchase_Order table (outbound operation).

Prerequisites

Before you proceed with the tutorial, make sure:

  • You must have completed the steps in Before You Develop BizTalk Applications.

  • You must log on as a member of the BizTalk Server Administrators group.

To generate schema for operations

  1. Create a new BizTalk project in Visual Studio. For this tutorial, name the project as Employee_PurchaseOrder.

  2. Connect to the ADAPTER_SAMPLES SQL Server database using the Consume Adapter Service Add-in. For instructions on how to connect using Consume Adapter Service Add-in, see Connecting to SQL Server in Visual Studio Using Consume Adapter Service Add-in.

    Note
    You can also connect to SQL Server using the Add Adapter Metadata Wizard. However, for this tutorial you will use the Consume Adapter Service Add-in.

  3. Generate schema for the Notification inbound operation.

    1. After connecting to the ADAPTER_SAMPLES database, in the Consume Adapter Service Add-in, from the Select contract type list, select Service (Inbound operations).

    2. From the Select a category box, click the root node (/).

    3. From the Available categories and operations box, select Notification and click Add. The Notification operation is now displayed in the Added categories and operations box. Click OK.

  4. Generate schema for the UPDATE_EMPLOYEE stored procedure and the Insert operation on Purchase_Order table.

    1. Repeat step 2 to connect to ADAPTER_SAMPLES database in SQL Server using the Consume Adapter Service Add-in.

      Note
      You cannot generate schema for inbound and outbound operations at the same time. Hence, in step 3, after you click OK to generate the schema for Notification operation, the Consume Adapter Service Add-in closes. You must reconnect to the SQL Server database to generate schema for outbound operations.

    2. From the Select contract type list, select Client (Outbound operations).

    3. From the Select a category box, click the Strongly-Typed Procedures node. From the Available categories and operations box, select UPDATE_EMPLOYEE, and then click Add.

      Important
      The UPDATE_EMPLOYEE stored procedure is also available under the Procedures node. However, if you generate schema for the stored procedure from under the Procedures node, the response message schema is not available at design-time but is received with the response message after you execute the stored procedure.

      In this tutorial, you will map the response schema of the stored procedure to the input schema of the Insert operation on the Purchase_Order table. Therefore, you will need the schema for the UPDATE_EMPLOYEE stored procedure at design-time and you must select the stored procedure from under the Strongly-Typed Procedures. By doing so, you will get the schema of the stored procedure at design-time.

    4. From the Select a category box, expand the Tables node, and click the node for Purchase_Order table. From the Available categories and operations box, select Insert, click Add, and then click OK.

What did I just do?

In this step, you generated schemas for Notification (inbound operation), UPDATE_EMPLOYEE stored procedure, and Insert operation on the Purchase_Order table. After you generate the schema, the Consume Adapter Service Add-in adds the following files to your BizTalk project:

  • XSD files that contain schema for the request message to invoke operations on SQL Server.

  • XML binding files that you can use to create WCF-Custom send and receive ports in BizTalk Server Administration console.

For more information about generating schemas, see Browsing, Searching, and Retrieving Metadata for SQL Server Operations.

Next Steps

You create messages in the BizTalk project for the schemas in Step 2: Create Messages for BizTalk Orchestrations.

See Also

Other Resources

Lesson 1: Generate Schemas and Create Messages


Step 2: Create Messages for BizTalk Orchestrations
Step 2 of 2

Time to complete: 5 minutes

Objective: In this step, you add an orchestration to the BizTalk project and create messages for the schemas you generated in Step 1: Generate Schema for Operations.

Prerequisites

You must have completed Step 1: Generate Schema for Operations.

To create messages in an orchestration

  1. Add a BizTalk orchestration to the BizTalk project in Visual Studio:

    1. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item.

    2. In the Add New Item dialog box, from the Categories box, click Orchestration Files. From the Templates box, click BizTalk Orchestration.

    3. Type a name for the BizTalk orchestration, and then click Add. For this tutorial, enter the name EmployeeOrch.odx.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. Add messages to the orchestration.

    1. In the Orchestration View, right-click Messages, and then click New Message.

    2. Right-click the newly created message, and then select Properties Window.

    3. In the Properties pane for Message_1, do the following:

      Use this To do this

      Identifier

      Type NotifyReceive.

      Message Type

      From the drop-down list, expand Schemas, and select Employee_PurchaseOrder.Notification, where Employee_PurchaseOrder is the name of your BizTalk project. Notification is the schema generated for the Notification operation.

    4. Repeat the previous step to add four new messages—a request-response message set for invoking the UPDATE_EMPLOYEE stored procedure and another request-response message set for performing the Insert operation on Purchase_Order table.

      Set Identifier to Set Message Type to

      UpdateEmployee

      Employee_PurchaseOrder.TypedProcedure_dbo.UPDATE_EMPLOYEE, where TypedProcedure_dbo.UPDATE_EMPLOYEE is the schema for the UPDATE_EMPLOYEE stored procedure.

      UpdateEmployeeResponse

      Employee_PurchaseOrder.TypedProcedure_dbo.UPDATE_EMPLOYEEResponse

      InsertPO

      Employee_PurchaseOrder.TableOperation_dbo_Purchase_Order.Insert, where TableOperation_dbo_Purchase_Order.Insert is the schema for the Insert operation on the Purchase_Order table.

      InsertPOResponse

      Employee_PurchaseOrder.TableOperation_dbo_Purchase_Order.InsertResponse

    5. Save the orchestration file and the BizTalk project.

What did I just do?

In this step, you created messages for invoking performing inbound and outbound operations on SQL Server using the SQL adapter.

Next Steps

You add orchestration shapes to receive notification from SQL Server and filter notifications for Insert operation, as described in Lesson 2: Receive and Filter Notifications.

See Also

Tasks

Step 1: Generate Schema for Operations

Other Resources

Lesson 1: Generate Schemas and Create Messages


Lesson 2: Receive and Filter Notifications

In this lesson, you start creating an orchestration that receives notifications for changes to the Employee table. After the orchestration receives the notification, it extracts the type of notification and if the notification type is for an Insert operation on the Employee table, an “if” condition is used to perform subsequent tasks. In this lesson, you will perform the following tasks:

  1. Add a one-way receive port and a Receive shape to the orchestration to receive the notification message.

  2. Add an Expression shape that contains an xpath query to extract the type of notification.

  3. After the notification type is known, add a filter to the orchestration by including a Decide shape. This shape decides whether the notification is for an Insert notification and then performs subsequent operations. If the notification is not for an Insert operation, the orchestration does not do anything.

In This Section

  • Step 1: Add Orchestration Shapes to Receive Notification

  • Step 2: Extract Notification Type from Notification Message

  • Step 3: Add a Filter for Insert Notifications


Step 1: Add Orchestration Shapes to Receive Notification
Step 1 of 3

Time to complete: 5 minutes

Objective: In this step, you add orchestration shapes to receive notification for changes to the Employee table.

Prerequisites

You must have completed the steps in Lesson 1: Generate Schemas and Create Messages.

To receive notification messages

  1. Open the BizTalk orchestration, EmployeeOrch.odx, you added in Step 2: Create Messages for BizTalk Orchestrations.

  2. Add a Receive shape to the orchestration. From the orchestration Toolbox, drag the Receive shape to the orchestration design surface, and drop it into the space indicated between the Begin (green circle) and End (red octagon) shapes.

    Set this property To this value

    Activate

    True

    Message

    NotifyReceive

    Name

    ReceiveNotification

  3. Add a one-way receive port to the orchestration. You will use this port to receive notification messages from the SQL Server database. Set the following properties for the port.

    Set this property To this value

    Communication Direction

    Receive

    Communication Pattern

    One-Way

    Identifier

    ReceiveNotification

    Also, change the operation name from Operation_1 to Notification.

  4. Connect the ReceiveNotification port to the ReceiveNotification action shape. In Orchestration Designer, on the design surface, drag the green arrow-shaped handle for the port to the corresponding green handle of the action shape.

    Note
    In this step, you use the drag-and-drop method to connect ports to action shapes. You could instead use the operation property of an action shape to connect the action shape to a port.

  5. The following figure shows the in-progress orchestration.

    Orchestration to receive notification messages

What did I just do?

In this step, you added orchestration shapes and receive port to receive notification from the SQL Server database.

Next Steps

You add an expression shape to the orchestration to extract the type of notification received from the SQL Server database, as described in Step 2: Extract Notification Type from Notification Message.

See Also

Tasks

Step 2: Extract Notification Type from Notification Message

Other Resources

Lesson 2: Receive and Filter Notifications


Step 2: Extract Notification Type from Notification Message
Step 2 of 3

Time to complete: 5 minutes

Objective: In this step, you add an expression shape to extract the type of notification received from the SQL Server database.

Prerequisites

You must have completed Step 1: Add Orchestration Shapes to Receive Notification.

To extract the notification type from the notification message

  1. Add a variable to the BizTalk orchestration you created in Step 1: Add Orchestration Shapes to Receive Notification.

    1. From the Orchestration View, right-click Variables, and then click New Variable.

    2. Right-click the new variable, Variable_1, and click Properties Window. Set the following properties for the variable.

      Set this property To this value

      Identifier

      NotificationType

      Type

      System.String

  2. Add an Expression shape to the BizTalk orchestration. From the orchestration Toolbox, drag the Expression shape to the orchestration design surface, and drop it after the Receive shape

    Within the Expression shape, you will add an xpath query to extract the type of notification message received from SQL Server. Before creating an xpath query, let us look at the format of a notification message. A typical notification message resembles the following:

    Copy Code
    <Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Insert</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>

  3. As you see, the information about the type of the notification is available within the <info> tag, within the parent <Notification> tag. So, add the following xpath query within the Expression shape:

    Copy Code
    NotificationType = xpath(NotifyReceive,"string(/*[local-name()='Notification']/*[local-name()='Info']/text())");

    Here, NotificationType is the variable you created to store the value extracted by the xpath query. NotifyReceive is the message you created in Step 2: Create Messages for BizTalk Orchestrations to receive notification messages.

  4. The following figure shows the in-progress orchestration with the Expression shape included.

    Add an Expression shape to the orchestration

What did I just do?

In this step, you added an Expression shape to extract the kind of notification received from the SQL Server database.

Next Steps

You add a Decide shape to filter for Insert notifications, as described in Step 3: Add a Filter for Insert Notifications.

See Also

Tasks

Step 1: Add Orchestration Shapes to Receive Notification
Step 3: Add a Filter for Insert Notifications

Other Resources

Lesson 2: Receive and Filter Notifications


Step 3: Add a Filter for Insert Notifications
Step 3 of 3

Time to complete: 5 minutes

Objective: In this step, you add a Decide shape to the orchestration to filter for notification messages for Insert operation. Subsequent operations in the orchestration are performed only if the notification received is of Insert type.

Prerequisites

You must have completed Step 2: Extract Notification Type from Notification Message.

To filter for notification messages

  1. Add a Decide shape to the orchestration, after the Expression shape. From the Toolbox, drag the Decide shape onto the connecting line directly below the Expression shape.

    The Decide shape expands to show a branch for the If statement (Rule_1) and a branch for the Else statement.

  2. On the design surface, right-click the Decide shape, and then click Properties Window.

  3. In the Properties pane for the Decide shape, in the Name property, type CheckNotification.

  4. On the design surface, right-click the Rule_1 shape (inside of the Decide shape), and then click Properties Window.

  5. In the Properties pane for Rule_1, in the Name property, type Insert.

  6. Right-click the Insert shape, and then click Edit Boolean Expression.

  7. In the BizTalk Expression Editor, type the following:

    Copy Code
    NotificationType.Equals("Insert")

    This condition tells the orchestration to perform subsequent operations only if the value in the NotificationType variable is Insert.

    Note
    You added this variable in Step 2: Extract Notification Type from Notification Message to extract the type of notification from the notification message received from the SQL Server database.

  8. The following figure shows the in-progress orchestration with the Decide shape included.

    Add a Decide shape to the orchestration

What did I just do?

In this step, you added a Decide shape to filter the notification messages to perform subsequent operations only if the notification received is for Insert operations.

Next Steps

In the next step, you add orchestration shapes to invoke the UPDATE_EMPLOYE stored procedure on the Employee table, as described in Lesson 3: Execute a Stored Procedure to Select New Employees Added.

See Also

Tasks

Step 2: Extract Notification Type from Notification Message

Other Resources

Lesson 2: Receive and Filter Notifications


Lesson 3: Execute a Stored Procedure to Select New Employees Added

Before understanding the tasks performed in this lesson, you must first understand why these tasks are required. The Employee table to which the records are inserted to add a new employee is defined in such a way that a Status column is always set to “0” every time a new employee is added. This is done so that you can use this column to query for newly added employees and also get notifications. In SQL Server, you would query this by running the following SQL statement:

Copy Code
SELECT Employee_ID, Name, Designation FROM Employee WHERE Status = 0

After receiving the list of newly added employees, you must also update the Status column to “1” so that the next time new employees are added and you run the same query, you do not get records for old employees as well. To make sure that the above Select statement gives only the newly added employees, you will update the Employee table using the following SQL statement:

Copy Code
UPDATE Employee SET Status = 1 WHERE Status = 0

So, the Status column for the old employees is set to “1” while new employees will always be “0.”

In this lesson, you will execute a stored procedure, UPDATE_EMPLOYEE, which in turn executes the Select and Update statements. After you have finished this lesson, your orchestration will do the following:

  1. Receives notification for any changes to the Employee table.

  2. Extracts the type of notification from the notification message received.

  3. If the notification message is for an Insert operation, the orchestration executes the UPDATE_EMPLOYEE stored procedure.

  4. The stored procedure reads the newly entered records in the Employee table. After reading the new records, the stored procedure also sets the Status column for those records to “1.”

Now you know why you need to execute the stored procedure. You now need to think about how to execute this as part of the orchestration. The orchestration needs a request message for the UPDATE_EMPLOYEE stored procedure. In this tutorial, you will create a custom class library that will create the message on the fly and then provide it to the orchestration. After the orchestration receives the message, it will send the message to the SQL Server using the SQL adapter and receive the response.

In This Section

  • Step 1: Create the Request Message for UPDATE_EMPLOYEE Stored Procedure

  • Step 2: Send the Request Message to SQL Server and Receive Response


Step 1: Create the Request Message for UPDATE_EMPLOYEE Stored Procedure
Step 1 of 2

Time to complete: 10 minutes

Objective: In this step, you add a C# class library project to your solution. This library creates an in-memory request message for the UPDATE_EMPLOYEE stored procedure. In later steps, the orchestration sends this message to SQL Server to execute the stored procedure.

Prerequisites

You must have completed the steps in Lesson 2: Receive and Filter Notifications.

To create a request message for UPDATE_EMPLOYEE stored procedure

  1. Add a Visual C# class library project to your solution. For the name of the project, type UpdateEmployeeMessageCreator.

  2. Rename Class1.cs to UpdateEmployeeMessageCreator.cs.

  3. Copy the following code to the .cs file:

    Copy Code
    using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;

namespace UpdateEmployeeMessageCreator
{
    public class UpdateEmployeeMessageCreator
    {
        private static XmlDocument Message;
        private static string XmlFileLocation;
        private static string ResponseDoc;

        public static XmlDocument XMLMessageCreator()
        {
            XmlFileLocation = "C:\\TestLocation\\CreateEmployeeMessage";
            try
            {
                ResponseDoc = (Directory.GetFiles(XmlFileLocation, "*.xml", SearchOption.TopDirectoryOnly))[0];
            }
            catch (Exception ex)
            {
                Console.WriteLine("Trying to get XML from: " + XmlFileLocation);
                Console.WriteLine("EXCEPTION: " + ex.ToString());
                throw ex;
            }

            //Create Message From XML
            Message = new XmlDocument();

            Message.PreserveWhitespace = true;

            Message.Load(ResponseDoc);

            return Message;
        }
    }
}

    This code snippet expects a request message for the UPDATE_EMPLOYEE stored procedure to be present at C:\TestLocation\CreateEmployeeMessage. The code uses the request message to create a similar request message at run time.

  4. Add a strong-name key file to the project. For instructions on creating a strong-name key file, see Create a Strong-Name Key File.

    1. In the Solution Explorer, right-click the UpdateEmployeeMessageCreator project, and then click Properties.

    2. In the Property window, click Signing.

    3. In the Signing tab, select the Sign the assembly check box.

    4. From the Choose a strong-name key file list, click <Browse>.

    5. Navigate to the folder where you created the strong-name key file, and then click Open.

    6. Click Save on the Standard menu bar. Close the Property window.

  5. Build the project. Right-click the project, and then click Build.

  6. Add a reference of this project to the BizTalk project in the solution.

    1. In the Solution Explorer, expand the BizTalk project, right-click References, and then click Add Reference.

    2. In the Add Reference dialog box, click the Projects tab.

    3. From the list of project names, select UpdateEmployeeMessageCreator, click Add, and then click OK.

  7. Building the project creates the assembly DLL under \bin\Debug folder of the project. You must add this DLL to the Global Assembly Cache (GAC).

    1. Start a Visual Studio Command Prompt (2012).

    2. From the command prompt, navigate to the \bin\Debug\ folder of the UpdateEmployeeMessageCreator project.

    3. Run the following command on the command prompt:

      Copy Code
      gacutil /i UpdateEmployeeMessageCreator.dll

What did I just do?

In this step, you added an UpdateEmployeeMessageCreator class library project that creates request message at run-time. You added the reference to this project in the BizTalk project and also added the assembly DLL to the GAC.

Next Steps

You send the request message to SQL Server and receive the response, as described in Step 2: Send the Request Message to SQL Server and Receive Response.

See Also

Other Resources

Lesson 3: Execute a Stored Procedure to Select New Employees Added


Step 2: Send the Request Message to SQL Server and Receive Response
Step 2 of 2

Time to complete: 10 minutes

Objective: In this step, you send the request message to execute the UPDATE_EMPLOYEE stored procedure and receive the response.

Prerequisites

You must have completed Step 1: Create the Request Message for UPDATE_EMPLOYEE Stored Procedure.

To send the request message and receive a response

  1. To the existing orchestration, under the Insert block of the Decide shape, add a Message Assignment shape. From the Toolbox, drag the Message Assignment shape to the space indicated.

    Note
    When you drop the Message Assignment shape onto the design surface, Orchestration Designer creates the enclosing Construct Message shape for you.

  2. On the design surface, right-click the ConstructMessage_1 shape, and then click Properties Window.

  3. In the Properties pane for the ConstructMessage_1 shape, specify the following values.

    Set this property To this value

    Messages Constructed

    UpdateEmployee

    Name

    ConstructRequestMessage

  4. Double-click the MessageAssignment shape to open the BizTalk Expression Editor.

  5. In the BizTalk Expression Editor, add the following:

    Copy Code
    UpdateEmployee = UpdateEmployeeMessageCreator.UpdateEmployeeMessageCreator.XMLMessageCreator();
UpdateEmployee(WCF.Action) = "TypedProcedure/dbo/UPDATE_EMPLOYEE";

    Here, UpdateEmployee is the message you created in Step 2: Create Messages for BizTalk Orchestrations for sending request messages for UPDATE_EMPLOYEE stored procedure. In the MessageAssignment shape, you invoke the UpdateEmployeeMessageCreator class to create a request message. Also, you set the WCF action for the request message.

  6. Add the following shapes to the orchestration under the Message Assignment shape.

    Shape Shape Type Properties

    SendUpdateMessage

    Send

    • Set Message to UpdateEmployee

    • Set Name to SendUpdateMessage

    ReceiveUpdateResponse

    Receive

    • Set Activate to False

    • Set Message to UpdateEmployeeResponse

    • Set Name to ReceiveUpdateResponse

  7. Add a request-response send port to the orchestration. You will use this port to send request messages to the SQL Server and receive response. Set the following properties for the port.

    Set this property To this value

    Communication Direction

    Send-Receive

    Communication Pattern

    Request-Response

    Identifier

    SQLOutboundPort

    Also, change the operation name from Operation_1 to UpdateEmp.

  8. Connect the port to action shapes. In Orchestration Designer, on the design surface, drag the green arrow-shaped handle for the port to the corresponding green handle of the action shape.

    Note
    In this step, you use the drag-and-drop method to connect ports to action shapes. You could instead use the operation property of an action shape to connect the action shape to a port.

    Connect the ports and action shapes as follows:

    • Connect the SendUpdateMessage action shape to the Request handle of the SQLOutboundPort.

    • Connect the ReceiveUpdateResponse action shape to the Response handle of the SQLOutboundPort.

  9. The following figure shows the in-progress orchestration.

    Updated orchestration to send update message

What did I just do?

In this step, you updated the orchestration by adding a MessageAssignment shape, Send and Receive shapes, and a port. You connected the shapes and ports to send request message to execute the UDPATE_EMPLOYEE request message and receive the response.

Next Steps

In the next step, you add orchestration shapes to invoke the Insert operation on the Purchase_Order table, as described in Lesson 4: Perform an Insert Operation on the Purchase Order Table.

See Also

Tasks

Step 1: Create the Request Message for UPDATE_EMPLOYEE Stored Procedure

Other Resources

Lesson 3: Execute a Stored Procedure to Select New Employees Added


Lesson 4: Perform an Insert Operation on the Purchase Order Table

In Lesson 3: Execute a Stored Procedure to Select New Employees Added, you executed the UPDATE_EMPLOYEE stored procedure and received a response message that contains the details of the newly inserted employee record. In this lesson, you will build on the previous lesson and update the orchestration to perform the following steps:

  1. Within the orchestration, you build the message to perform an Insert operation on the Purchase_Order table. This step is similar to Step 1: Create the Request Message for UPDATE_EMPLOYEE Stored Procedure.

  2. After you build the request message, you map the response message of the UPDATE_EMPLOYEE stored procedure to the request message for the Insert operation on the Purchase_Order table. By mapping the messages, you pass the values received from the response messages to the request message for Insert operation.

  3. You send the message to insert a record in the Purchase_Order table and receive a response.

  4. You send the response to a send port.

In This Section

  • Step 1: Create the Request Message for Insert Operation on Purchase_Order Table

  • Step 2: Map the UPDATE_EMPLOYEE Response Message to Insert Operation Request Message

  • Step 3: Send the Request Message to Insert Records and Receive a Response

  • Step 4: Build the Project


Step 1: Create the Request Message for Insert Operation on Purchase_Order Table
Step 1 of 4

Time to complete: 10 minutes

Objective: In this step, you add a C# class library project to your solution. This library creates an in-memory request message for the Insert operation on the Purchase_Order table. In later steps, the orchestration sends this message to SQL Server to insert records in the table.

Prerequisites

You must have completed the steps in Lesson 3: Execute a Stored Procedure to Select New Employees Added.

To create a request message for Insert operation

  1. Add a Visual C# class library project to your solution. For the name of the project, type UpdatePOMessageCreator.

  2. Rename Class1.cs to UpdatePOMessageCreator.cs.

  3. Copy the following code to the .cs file:

    Copy Code
    using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;

namespace UpdatePOMessageCreator
{
    public class UpdatePOMessageCreator
    {
        private static XmlDocument Message;
        private static string XmlFileLocation;
        private static string ResponseDoc;

        public static XmlDocument XMLMessageCreator()
        {
            XmlFileLocation = "C:\\TestLocation\\CreatePOMessage";
            try
            {
                ResponseDoc = (Directory.GetFiles(XmlFileLocation, "*.xml", SearchOption.TopDirectoryOnly))[0];
            }
            catch (Exception ex)
            {
                Console.WriteLine("Trying to get XML from: " + XmlFileLocation);
                Console.WriteLine("EXCEPTION: " + ex.ToString());
                throw ex;
            }

            //Create Message From XML
            Message = new XmlDocument();

            Message.PreserveWhitespace = true;

            Message.Load(ResponseDoc);

            return Message;
        }
    }
}

    This code snippet expects a request message for the Insert operation on the Purchase_Order table to be present at C:\TestLocation\CreatePOMessage. The code uses the request message to create a similar request message at run time.

  4. Add a strong-name key file to the project. For instructions on creating a strong-name key file, see Create a Strong-Name Key File.

    1. In the Solution Explorer, right-click the UpdatePOMessageCreator project and click Properties.

    2. In the Property window, click Signing.

    3. In the Signing tab, select the Sign the assembly check box.

    4. From the Choose a strong-name key file list, click <Browse>.

    5. Navigate to the folder where you created the strong-name key file, and then click Open.

    6. Click Save on the Standard menu bar. Close the Property window.

  5. Build the project. Right-click the project and click Build.

  6. Add a reference of this project to the BizTalk project in the solution.

    1. In the Solution Explorer, expand the BizTalk project, right-click References, and then click Add Reference.

    2. In the Add Reference dialog box, click the Projects tab.

    3. From the list of project names, select UpdatePOMessageCreator, click Add, and then click OK.

  7. Building the project creates the assembly DLL under \bin\Debug folder of the project. You must add this DLL to the Global Assembly Cache (GAC).

    1. Start a Visual Studio Command Prompt (2012).

    2. From the command prompt, navigate to the \bin\Debug\ folder of the UpdatePOMessageCreator project.

    3. Run the following command on the command prompt:

      Copy Code
      gacutil /i UpdatePOMessageCreator.dll

What did I just do?

In this step, you added an UpdatePOMessageCreator class library project that creates request message at run-time. You added the reference to this project in the BizTalk project and also added the assembly DLL to the GAC.

Next Steps

You map the response message for the UPDATE_EMPLOYEE stored procedure to the request message for the Insert operation on Purchaser_Order table.

See Also

Tasks

Step 2: Map the UPDATE_EMPLOYEE Response Message to Insert Operation Request Message

Other Resources

Lesson 4: Perform an Insert Operation on the Purchase Order Table


Step 2: Map the UPDATE_EMPLOYEE Response Message to Insert Operation Request Message
Step 2 of 4

Time to complete: 10 minutes

Objective: In this step, you create the request message to perform an Insert operation on the Purchase_Order table and then map the response message for the UPDATE_EMPLOYEE stored procedure to the request message for the Insert operation. By doing so, you pass on the values in the response message to be inserted in the Purchase_Order table.

Prerequisites

You must have completed Step 1: Create the Request Message for Insert Operation on Purchase_Order Table.

To map the messages

  1. To the existing orchestration, in the Insert block of the Decide shape, under the ReceiveUpdateResponse shape, add a Message Assignment shape. From the Toolbox, drag the Message Assignment shape to the space indicated.

    Note
    When you drop the Message Assignment shape onto the design surface, Orchestration Designer creates the enclosing Construct Message shape for you.

  2. On the design surface, right-click the ConstructMessage_1 shape, and then click Properties Window.

  3. In the Properties pane for the ConstructMessage_1 shape, specify the following values.

    Set this property To this value

    Messages Constructed

    InsertPO

    Name

    ConstructInsertMessage

  4. Double-click the MessageAssignment shape to open the BizTalk Expression Editor.

  5. In the BizTalk Expression Editor, add the following:

    Copy Code
    InsertPO = UpdatePOMessageCreator.UpdatePOMessageCreator.XMLMessageCreator();
InsertPO(WCF.Action) = "TableOp/Insert/dbo/Purchase_Order";

    Here, InsertPO is the message you created in Step 2: Create Messages for BizTalk Orchestrations for sending request messages for Insert operation on the Purchase_Order table. In the MessageAssignment shape, you invoke the UpdatePOMessageCreator class to create a request message. Also, you set the WCF action for the request message.

  6. Within the Construct Message shape and after the Message Assignment shape, add a Transform shape.

  7. In the Transform Configuration dialog box, from the left pane, under the Transform label, click Source.

  8. From the Source Transform box on the right, click the space under the Variable Name, and then select UpdateEmployeeResponse.

    Pick the source schema for the mapping

  9. In the Transform Configuration dialog box, from the left pane, under the Transform label, click Destination.

  10. From the Destination Transform box on the right, click the space under the Variable Name, and then select InsertPO.

    Pick the destination schema for mapping

  11. Click OK. The map file opens.

  12. Expand the nodes in the source and destination schemas.

  13. Map the Employee_ID and name fields in both the schemas.

    • Map the Employee_ID node in the source schema (UPDATE_EMPLOYEEResponse) to the Employee_ID node in the destination schema (Insert).

    • Map the Name node in the source schema to the Employee_Name in the destination schema.

    The following figure shows the mapped schemas.

    Map the source and destination schemas

    Save and close the map.

  14. The following figure shows the in-progress orchestration.

    Orchestration with the transform shape

What did I just do?

In this step, you created a message to insert records into the Purchase_Order table and then mapped the response message from the UPDATE_EMPLOYEE stored procedure to the request message for the Insert operation.

Next Steps

You send the request message to perform an Insert operation on the Purchase_Order table and receive a response, as described in Step 3: Send the Request Message to Insert Records and Receive a Response.

See Also

Tasks

Step 1: Create the Request Message for Insert Operation on Purchase_Order Table

Other Resources

Lesson 4: Perform an Insert Operation on the Purchase Order Table


Step 3: Send the Request Message to Insert Records and Receive a Response
Step 3 of 4

Time to complete: 10 minutes

Objective: In this step, you send the request message to insert records into the Purchase_Order table and receive a response.

Prerequisites

You must have completed Step 2: Map the UPDATE_EMPLOYEE Response Message to Insert Operation Request Message.

To send the request message and receive a response

  1. Add the following shapes to the orchestration under the Construct Message shape.

    Shape Shape Type Properties

    SendInsertMessage

    Send

    • Set Message to InsertPO

    • Set Name to SendInsertMessage

    ReceiveInsertResponse

    Receive

    • Set Activate to False

    • Set Message to InsertPOResponse

    • Set Name to ReceiveInsertResponse

    SaveInsertResponse

    Send

    • Set Message to InsertPOResponse

    • Set Name to SaveInsertResponse

  2. Modify the SQLOutboundPort you created in Step 2: Send the Request Message to SQL Server and Receive Response.

    1. Right-click the port in the Orchestration Designer, and then click New Operation. The port shape changes to add a new operation, Operation_1.

    2. Click Operation_1 and in the properties window, change the value of Identifier to InsertPO.

  3. Add a one-way send port to the orchestration. You will use this port to send the response message for the Insert operation. Set the following properties for the port.

    Set this property To this value

    Communication Direction

    Send

    Communication Pattern

    One-Way

    Identifier

    SaveResponsePort

    Also, change the operation name from Operation_1 to InsertPO.

  4. Connect the port to action shapes. In Orchestration Designer, on the design surface, drag the green arrow-shaped handle for the port to the corresponding green handle of the action shape.

    Note
    In this step, you use the drag-and-drop method to connect ports to action shapes. You could instead use the operation property of an action shape to connect the action shape to a port.

    Connect the ports and action shapes as follows:

    • Connect the SendInsertMessage action shape to the Request handle of the InsertPO operation of the SQLOutboundPort.

    • Connect the ReceiveInsertResponse action shape to the Response handle of the InsertPO operation of the SQLOutboundPort.

    • Connect the SaveInsertResponse action shape to the Request handle of the SaveResponsePort.

  5. The following figure shows the in-progress orchestration.

What did I just do?

You sent the request to insert records into the Purchase_Order table and receive a response.

Next Steps

You build the project, as described in Step 4: Build the Project.

See Also

Tasks

Step 2: Map the UPDATE_EMPLOYEE Response Message to Insert Operation Request Message
Step 4: Build the Project

Other Resources

Lesson 4: Perform an Insert Operation on the Purchase Order Table


Step 4: Build the Project
Step 4 of 4

Time to complete: 5 minutes

Objective: In this step, you compile the BizTalk orchestration project.

Prerequisites

You must have completed Step 3: Send the Request Message to Insert Records and Receive a Response.

To build the BizTalk orchestration project

  1. In the Solution Explorer, right-click the BizTalk project name, and then click Properties.

  2. In the property pages dialog box, in the tree pane, expand Common Properties, click Assembly, and then in the properties list, click the Assembly Key File ellipsis […].

  3. Specify a path to the assembly key file you created as described in Create a Strong-Name Key File, and then click Open.

  4. In the property pages dialog box, in the tree pane, expand Configuration Properties, click Deployment, and then do the following:

    1. For the Application Name property, type SampleApplication.

    2. For the Redeploy property, select True.

    Click OK.

  5. On the File menu, click Save All.

  6. In Solution Explorer, right-click the solution name, and then click Build Solution.

    The Output pane at the bottom of the screen should read: Build: 3 succeeded or up-to-date, 0 failed, 0 skipped.

What did I just do?

In this step, you compiled the solution containing the BizTalk project and two class library projects.

Next Steps

You deploy the solution, as described in Lesson 5: Deploy the Solution.

See Also

Tasks

Step 3: Send the Request Message to Insert Records and Receive a Response

Other Resources

Lesson 4: Perform an Insert Operation on the Purchase Order Table


Lesson 5: Deploy the Solution

In this lesson, you deploy the BizTalk solution using the BizTalk Server Administration console. In the BizTalk orchestration designer, you created logical ports. You will now create the physical ports and then configure the BizTalk application by mapping the logical ports to the physical ports.

After you have configured the application, you will start and test the application.

In This Section

  • Step 1: Deploy the Orchestration

  • Step 2: Configure the Ports

  • Step 3: Configure and Start the Application

  • Step 4: Test the Application


Step 1: Deploy the Orchestration
Step 1 of 4

Time to complete: 5 minutes

Objective: In this step, deploy the orchestration solution.

Prerequisites

You must have completed the steps in Lesson 4: Perform an Insert Operation on the Purchase Order Table.

To deploy the solution

  1. In Solution Explorer, right-click the solution name, and then click Properties.

  2. In the properties pages dialog box, in the tree control, expand Configuration Properties, and then click Configuration.

  3. On the Configuration page, in the Deploy column, select the check box against the BizTalk project, and then click OK.

  4. In Solution Explorer, right-click the solution name, and then click Deploy Solution.

    The Output pane at the bottom of the screen should read: Deploy: 1 succeeded, 0 failed, 0 skipped.

What did I just do?

In this step, you deployed the BizTalk orchestration to BizTalk Server Administration console.

Next Steps

You create the physical ports in BizTalk Server Administration console, as described in Step 2: Configure the Ports.

See Also

Tasks

Step 2: Configure the Ports

Other Resources

Lesson 5: Deploy the Solution

© 2013 Microsoft Corporation. All rights reserved.


Step 2: Configure the Ports
Step 2 of 4

Time to complete: 15 minutes

Objective: In this step, you create the physical ports in BizTalk Server Administration console. You create a physical port for each logical port you created in the orchestration. You will create the following ports:

  • A one-way WCF-Custom receive port to receive notification messages for changes to Employee table in a SQL Server database.

  • A request-response WCF-Custom send port to send request messages and receive response for invoking the UPDATE_EMPLOYEE stored procedure and for performing the Insert operation on the Purchase_Order table. In the orchestration, you used the same send port to perform both the operations. Similarly, in the BizTalk Server Administration console, you will use a single send port for both operations.

  • A one-way send port to send the response for the Insert operation. In this tutorial, because you need to inform the Purchases department through an e-mail, you create this send port as an SMTP port.

Prerequisites

You must have completed Step 1: Deploy the Orchestration.

To create a physical one-way receive port

  1. Start the BizTalk Server Administration console.

  2. In the console tree on the left hand side, expand BizTalk Server Administration, right-click BizTalk Group, and then click Refresh.

  3. Expand BizTalk Group, expand Applications, and expand SampleApplication. For this tutorial, you create all the ports and application within the SampleApplication application.

  4. Follow the instructions under the “Deploying Adapters for Receiving Messages from SQL Server” section of Configuring a Port Using the WCF-Custom Adapter. Name the port as NotifyReceivePort.

  5. Make sure you set the following binding properties to configure the adapter to receive notifications for changes to the Employee table.

    Binding property Value

    InboundOperationType

    Set this to Notification.

    NotificationStatement

    Set this to:

    Copy Code
    SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
    Note
    You must specifically specify the column names in the statement as shown in this Select statement. Also, you must always specify the table name along with the schema name, for example, dbo.Employee.

    NotifyOnListenerStart

    Set this to True.

    For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

To create a request-response send port for two operations

  1. Follow the instructions under the “Deploying Adapters for Sending Messages to SQL Server” section of Configuring a Port Using the WCF-Custom Adapter. Name the port as SQLOutboundPort.

  2. Because you are performing two operations using the same send port, you must use dynamic action mapping to specify the action for the operation. While configuring the port, in the Action box, specify the action mapping in the following manner:

    Copy Code
    <BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Operation Name="UpdateEmp" Action="TypedProcedure/dbo/UPDATE_EMPLOYEE" />
  <Operation Name="InsertPO" Action="TableOp/Insert/dbo/Purchase_Order" />
</BtsActionMapping>

    Note that in the orchestration, you created two operations for the request-response send port: UpdateEmp and InsertPO. So, in the physical port configuration you provide the same operation names in the dynamic action mapping. In the above excerpt, the action for UpdateEmp operation is TypedProcedure/dbo/UPDATE_EMPLOYEE. Similarly, the action for InsertPO operation is TableOp/Insert/dbo/Purchase_Order.

  3. You must also configure the send port to use the Mapper you created in the orchestration to map the response message of UPDATE_EMPLOYEE stored procedure to the request message for the Insert operation on Purchase_Order table. To do so:

    1. Right-click the SQLOutboundPort in BizTalk Server Administration console, and then click Properties.

    2. From the SQLOutboundPort – Send Port Properties dialog box, from the left pane, click Outbound Maps.

    3. From the right-pane, in the Outbound Maps box, click the cell under the Map column, and from the drop-down list, select Transform_1. This is the name of the map you created in the BizTalk orchestration in Visual Studio.

      Click OK.

      Configure outbound map

To create an SMTP send port

  1. Follow the instructions under the “How to Configure an SMTP Send Port with the BizTalk Server Administration Console” section at http://go.microsoft.com/fwlink/?LinkId=141549. Name the port as EmailResponse.

  2. As part of the port configuration, specify the e-mail address for the Purchases department for the To property.

What did I just do?

In this step you created a WCF-Custom receive port for receiving notifications from SQL Server, WCF-Custom send port for performing operations on SQL Server, and an SMTP port for sending the response from SQL Server as an e-mail to the Purchases department.

Next Steps

You configure and start the BizTalk application, as described in Step 3: Configure and Start the Application.

See Also

Tasks

Step 1: Deploy the Orchestration
Step 3: Configure and Start the Application

Other Resources

Lesson 5: Deploy the Solution

© 2013 Microsoft Corporation. All rights reserved.


Step 3: Configure and Start the Application
Step 3 of 4

Time to complete: 10 minutes

Objective: In this step, you configure and start the SampleApplication application. When you configure the SampleApplication application, you associate the logical artifacts you created in Visual Studio with their physical counterparts.

Prerequisites

You must have completed Step 2: Configure the Ports.

To configure and start the application

  1. Start the BizTalk Server Administration console.

  2. In the console tree on the left hand side, expand BizTalk Server Administration, right-click BizTalk Group, and then click Refresh.

  3. Expand BizTalk Group, expand Applications, right-click SampleApplication, and then click Configure.

  4. In the Configure Application dialog box, on the EmployeeOrch tab, do the following:

    1. For Host drop-down list, select BizTalkServerApplication.

    2. Double-click the cell across ReceiveNotification and select NotifyReceivePort from the drop-down list.

    3. Double-click the cell across SQLOutboundPort and select SQLOutboundPort from the drop-down list.

    4. Double-click the cell across SaveResponsePort and select EmailResponse from the drop-down list.

  5. The following figure shows a configured application.

  6. In the Configure Application dialog box, click OK.

  7. In the console tree, right-click SampleApplication, and then click Start.

  8. In the console tree, click Applications.

  9. In the Applications details pane, check that the Status of SampleApplication is Started.

What did I just do?

You configured and started the SampleApplication application

Next Steps

You test the application by inserting new employees in the Employee table, as described in Step 4: Test the Application.

See Also

Tasks

Step 2: Configure the Ports
Step 4: Test the Application

Other Resources

Lesson 5: Deploy the Solution

© 2013 Microsoft Corporation. All rights reserved.


Step 4: Test the Application
Step 4 of 4

Time to complete: 10 minutes

Objective: In this step, you test the application by inserting a record in the Employee table of the ADAPTER_SAMPLES database. If the application is working properly, the orchestration receives a notification for changes to the Employee table. The orchestration then extracts the type of notification received. If the notification is for an Insert operation, the orchestration executes the UPDATE_EMPLOYEE stored procedure and receives a response. The orchestration extracts the values of Employee_ID and Name from the response and inserts them into the Purchase_Order table.

Prerequisites

Before starting with this step, you must ensure the following:

  • A request message to invoke the UPDATE_EMPLOYEE stored procedure is available at C:\TestLocation\CreateEmployeeMessage. The request message looks like the following:

    Copy Code
    <UPDATE_EMPLOYEE xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo" />
  • A request message to invoke the Insert operation on the Purchase_Order table is available at C:\TestLocation\CreatePOMessage. The request message looks like the following:

    Copy Code
    <Insert xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Purchase_Order">
  <Rows>
    <Purchase_Order xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
      <Employee_ID>10</Employee_ID><Employee_Name>Employee_Name</Employee_Name>
    </Purchase_Order>
  </Rows>
</Insert>
    Note
    The values for the Employee_ID and Employee_Name fields are placeholders. The actual values are inserted by the orchestration at run-time.

  • You must have completed Step 3: Configure and Start the Application.

To test the application

  1. Insert a record in the Employee table. You can do so by running the following statement from SQL Server Management Studio.

    Copy Code
    INSERT INTO [ADAPTER_SAMPLES].[dbo].[Employee] ([Name] ,[Designation] ,[Salary])
VALUES('John Smith' ,'Manager' ,500000)

  2. Check the Employee table in the database. You will notice that the new record is added by the Status column is “0.”

  3. Keep refreshing the Employee table records. You will notice that the Status column for the new record is now set to “1.”

  4. Check the Purchase_Order table. You will notice that a record with the same employee name and designation, as you provided in the Insert statement, is added to the table.

  5. If you provided your e-mail alias in the SMTP port configuration, you will also receive an e-mail with the response message for the Insert operation.

What did I just do?

Tested the SampleApplication application by inserting a record in the Employee table.

Next Steps

If the test worked, congratulations! You have completed the SQL adapter tutorial.

If the test did not work, carefully check your work to make sure that you added all of the necessary objects and set their properties correctly.

See Also

Tasks

Step 3: Configure and Start the Application

Other Resources

Lesson 5: Deploy the Solution

© 2013 Microsoft Corporation. All rights reserved.


Community Resources

There are two principal sources of information from Microsoft about the BizTalk Adapter Pack:

  • The documentation and samples installed with the BizTalk Adapter Pack.

  • The Microsoft BizTalk Adapter Pack forums.

BizTalk Adapter Pack Documentation

You can install the BizTalk Adapter Pack documentation when you install the BizTalk Adapter Pack. (For information about how to install the BizTalk Adapter Pack, see the installation guide. The installation guide is typically available at <installation drive>:\Program Files\Microsoft BizTalk Adapter Pack\Documents.) The core documentation covers the concepts and procedures required to use the BizTalk Adapter Pack.

After you install the BizTalk Adapter Pack Setup program, you can access the documentation through the Microsoft BizTalk Adapter Pack program group on the Start menu.

BizTalk Adapter Pack Samples

This BizTalk Adapter Pack release will provide samples demonstrating how to use the adapters with:

  • BizTalk Server.

  • The Windows Communication Foundation (WCF) channel model.

  • The WCF service model.

In addition, migration samples are provided.

The samples are available at http://go.microsoft.com/fwlink/?LinkId=196854.

BizTalk Adapter Pack Forums

You can post your queries about the BizTalk Adapter Pack on the forums.

Resource | Location
BizTalk Adapter Pack Forums | http://go.microsoft.com/fwlink/?LinkId=87695

See Also

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


Frequently Asked Questions

This section contains frequently asked questions (FAQs) related to Microsoft BizTalk Adapter for SQL Server and the BizTalk Adapter Pack in general that you might come across while learning or using the product. The FAQs are divided into four categories: General, BizTalk Server, WCF Service Model, and WCF Channel Model.

However, if you have specific questions related to Microsoft BizTalk Adapter for SQL Server or BizTalk Adapter Pack that are not listed in this section, you can post your query on the BizTalk Adapter Pack forum at http://go.microsoft.com/fwlink/?LinkId=87695.

In This Section

  • General

  • BizTalk Server

  • WCF Service Model

  • WCF Channel Model

See Also

Other Resources

Getting Started

© 2013 Microsoft Corporation. All rights reserved.


General

The following are some frequently asked questions (FAQs) related to Microsoft BizTalk Adapter for SQL Server and the BizTalk Adapter Pack in general.

What are the supported BizTalk versions for the BizTalk Adapter Pack?

The BizTalk Adapter Pack is supported with Microsoft BizTalk Server 2013.

In which user context should the setup wizard be run?

You must always run the BizTalk Adapter Pack Setup Wizard under a user context with administrative privileges on the computer.

What is WCF? Where can I read more about it?

WCF stands for Windows Communication Foundation. WCF is a programming framework developed by Microsoft for building service-oriented applications. WCF is a part of .NET framework, and enables developers to build secure, reliable, and transacted solutions that integrate across platforms and interoperate with existing investments.

For more information about WCF, see http://go.microsoft.com/fwlink/?LinkId=19696.

What is WCF LOB Adapter SDK? Where can I read more about it?

The WCF LOB Adapter SDK is a collection of tools and components that provide a consistent framework for developing reusable, metadata-rich adapters for line-of-business systems. Adapters written using the WCF LOB Adapter SDK are surfaced as custom WCF bindings and can be consumed by a WCF-capable client.

For more information about WCF LOB Adapter SDK, see the WCF LOB Adapter SDK documentation, which is installed along with the WCF LOB Adapter SDK at the following location on your computer: <installation drive>:\Program Files\WCF LOB Adapter SDK\Documents.

How do I get started using the adapter?

To get started with using the SQL adapter, you must figure out a role that suits you as a user of the adapter. The potential roles that are users of the SQL adapter are the following: Developers, IT professionals, and Independent Software Vendors (ISVs). For information about the prerequisites for each of these roles, see Prerequisite Skills and Knowledge. For a list of tasks that are applicable for various users of the SQL adapter, see Common Administrative Tasks and Common Developer Tasks.

How can I use the SQL adapter to communicate with the SQL Server database?

You can use the SQL adapter to communicate with the SQL Server database either by developing BizTalk applications, using the WCF service model or using the WCF channel model. For more information, see Overview of BizTalk Adapter for SQL Server.

What interfaces are supported by the SQL adapter for retrieving metadata?

The SQL adapter supports two interfaces for retrieving metadata:

  • MetadataExchange provided by WCF. WCF provides a metadata-exchange endpoint for all WCF bindings, which enables clients to get metadata from the SQL Server database.

  • IMetadataRetrievalContract provided by the WCF LOB Adapter SDK, which supports the metadata browsing and searching capabilities of the adapter.

How does the SQL adapter support high availability of data?

While specifying the connection URI to connect to a SQL Server database, the SQL adapter allows you to specify the name of a failover SQL Server database to connect to if the primary SQL Server database is not available. The failover SQL Server database is specified using an optional parameter, FailoverPartner, in the connection URI.

Can I migrate BizTalk projects created using the previous version of the SQL adapter to use the WCF-based SQL adapter? How?

Yes. To know the steps for migrating BizTalk projects created using the previous version of the SQL adapter to use the WCF-based SQL adapter, see SQL Adapter Tutorials.

Does the SQL adapter provide a secure way of communicating with the SQL Server database? Are there any best practices to ensure security of data?

The SQL adapter supports Enterprise Single Sign-On (SSO) and Integrated Security for authentication on the connections that it establishes with the SQL Server database. With SSO, the credentials are encrypted and stored in the registry. The system uses these credentials to determine access instead of requiring the user to enter them where they might be seen by unauthorized actors. Integrated Security uses the credentials of the logged on user to access the SQL server. This also eliminates the need for users to enter credentials. The database administrator must configure SQL to accept users’ credentials for Integrated Security to work correctly.

The SQL adapter also does not allow you to enter the user credentials in the connection URI for the SQL Server database while working with the Add Adapter Service Reference Visual Studio Plug-in and Consume Adapter Service BizTalk Project Add-in to prevent credentials from appearing in clear text. Moreover, the password is not written to the configuration file (generated by the Add Adapter Service Reference Visual Studio Plug-in) and the binding file (generated by the Consume Adapter Service BizTalk Project Add-in).

For more information about:

  • Data security in the SQL adapter, see Security and Protection.

  • Best practices to ensure data security in the SQL adapter, see Best Practices.

Is there a GUI provided by the SQL adapter to view and perform operations on the artifacts in my underlying SQL Server database?

The Consume Adapter Service BizTalk Project Add-in and the Add Adapter Service Reference Visual Studio Plug-in provide a dialog box where you can view and perform operations on the artifacts in the underlying SQL Server database. For more information about the GUI provided by the SQL adapter, see Browsing, Searching, and Retrieving Metadata for SQL Server Operations.

What are binding properties in the SQL adapter? Where can I find information about all the binding properties in SQL adapter?

Adapter clients can use binding properties in the SQL adapter to configure and control the adapter’s behavior. For information about all the binding properties surfaced in the SQL adapter, see Working with BizTalk Adapter for SQL Server Binding Properties.

What is MSDTC? Do I need to bother about it before using SQL adapter?

MSDTC stands for Microsoft Distributed Transaction Coordinator. MSDTC coordinates various transactions among multiple resource managers such as databases, file systems, and message queues. To use the SQL adapter with BizTalk Server, you must enable MSDTC. For detailed information about configuring MSDTC, see Configure MSDTC on SQL Server and Adapter Client.

Where can I find information about the SQL Server data types that are supported in the SQL adapter?

To know about the SQL Server data types that are supported in the SQL adapter, see Basic SQL Server Data Types.

Which approach (BizTalk Server, WCF service model or WCF channel model) can I use to perform various operations using the SQL adapter?

To know about the approach that you can use to perform various operations using the SQL adapter, see Development.

Does the Microsoft BizTalk Adapter Pack support tracing?

Microsoft BizTalk Adapter Pack enables adapter clients to activate Windows Communication Foundation (WCF) tracing and adapter-specific tracing. For more information about tracing, see Diagnostic Tracing and Message Logging.

Where are the trace files stored?

The trace files are stored at a location that the adapter clients specify. The adapter clients can specify this location while enabling tracing. For more information about tracing, see Diagnostic Tracing and Message Logging.

How do I view the traces?

You can use the WCF Service Trace Viewer tool to view the traces. For more information about the tool, see “Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting” at http://go.microsoft.com/fwlink/?LinkId=91243.

Are performance counters available for adapters?

The BizTalk Adapter Pack provides an "LOB Time (Cumulative)" performance counter to measure the time, in milliseconds, that the LOB client library takes to complete an action initiated by the adapter. For more information about performance counters, see Using Performance Counters.

How do I enable performance counters for adapters?

You can enable or disable the performance counters by setting the EnablePerformanceCounters binding property. To enable performance counters, set the EnablePerformanceCounters binding property to True. To disable performance counters, set EnablePerformanceCounters to False. By default, EnablePerformanceCounters is set to False.

See Also

Other Resources

Frequently Asked Questions

© 2013 Microsoft Corporation. All rights reserved.


BizTalk Server

The following are some frequently asked questions (FAQs) related to Microsoft BizTalk Adapter for SQL Server and the BizTalk Server.

Which BizTalk Server tools are used while working with SQL adapter? Where can I know more about these tools?

You should have a working knowledge of the following BizTalk Server tools: BizTalk Explorer, Orchestration Designer, Pipeline Designer, BizTalk Mapper, and BizTalk Server Administration console. To know more about these tools, see Learn About BizTalk Server Tools.

Can I reuse bindings of a BizTalk application? How?

A binding creates a mapping between a logical endpoint such as an orchestration port or a role link and a physical endpoint such as a send and receive port. This enables communication between different components of a BizTalk business solution. The binding information is stored in an XML file that contains binding information for each BizTalk orchestration in the scope of a BizTalk assembly, application, or group. You can export the bindings of a BizTalk assembly, application, or group, and then reuse it by importing into any other BizTalk application or group. For more information, see Reusing Adapter Bindings.

What is Transaction Isolation Level? How to configure it?

The transaction isolation level determines the degree to which a transaction is isolated from the data changes made by other transactions. It defines the locking behavior of the Transact-SQL commands issued by a connection to SQL Server. For more information about the transaction isolation level, see http://go.microsoft.com/fwlink/?LinkId=126985.

For instructions about configuring transaction isolation level in BizTalk Server, see Configure Transaction Isolation Level and Transaction Timeout.

See Also

Other Resources

Frequently Asked Questions

© 2013 Microsoft Corporation. All rights reserved.


WCF Service Model

The following are some frequently asked questions (FAQs) related to Microsoft BizTalk Adapter for SQL Server and the Windows Communication Foundation (WCF) service model.

What is the WCF service model?

The WCF service model is a programming model provided by WCF in which the LOB system (SQL Server database) is exposed as a WCF service. The service contract that exists between a client and a service is represented as a .NET interface, and operations are represented as methods on this interface. The WCF service model generates a proxy class—the WCF client class—through which your code can invoke operations and receive data using the SQL adapter. For more information about the WCF service model, see Developing Applications by Using the WCF Service Model.

When would I want to use the WCF service model rather than the WCF channel model?

The WCF service model presents a model that is familiar to .NET programmers and that hides the underlying complexities of SOAP message exchange over a channel. Moreover, the Add Adapter Service Reference Plug-in is integrated with the Visual Studio design experience, and presents a standard Microsoft Windows interface that provides powerful browsing and searching capabilities on operations exposed by the adapter. Therefore, the WCF service model is often the best choice to develop programming solutions for the SQL adapter.

How do I get started with the WCF service model?

You can use either of the following tools provided by the WCF service model to generate a WCF client class or a WCF service contract and associated helper code from the service metadata that the SQL adapter exposes:

  • The ServiceModel Metadata Utility Tool (svcutil.exe), which ships with WCF.

  • The Add Adapter Service Reference Visual Studio Plug-in, which ships with the SQL adapter.

For more information about how to generate a WCF client or a WCF service contract, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

See Also

Other Resources

Frequently Asked Questions

© 2013 Microsoft Corporation. All rights reserved.


WCF Channel Model

The following are some frequently asked questions (FAQs) related to Microsoft BizTalk Adapter for SQL Server and the Windows Communication Foundation (WCF) channel model.

What is the WCF channel model?

The WCF channel model is a low-level abstraction of the SOAP message exchange between clients and services. It provides interfaces and types that enable you to send and receive messages by using a layered protocol stack called a channel stack. Each layer of the stack is composed of a channel, and each channel is created from a WCF binding. The SQL adapter is a WCF custom transport binding that exposes a SQL database as a WCF service. For more information about the WCF channel model, see Overview of Using the WCF Channel Model with the Adapter.

Why would I want to use the WCF channel model rather than the WCF service model?

You would want to use the WCF channel model over the WCF service model because:

  • The WCF channel model provides more fine-grained control over the operations that you perform on the SQL Server database because in the WCF channel model, you directly control the contents of the messages that you send over the channel.

  • The WCF channel model provided more comprehensive support for end-to-end streaming of SQL large object (LOB) data types than the WCF service model. This is because in the WCF channel model, you directly control how you provide the message body on outgoing messages and how you process the message body on incoming messages.

How do I get started with the WCF channel model?

Using the WCF channel model, you can invoke operations and receive the results of a polling query by exchanging SOAP messages with the Microsoft BizTalk Adapter for SQL Server over a WCF channel. To get started, you need to create outbound (client) and inbound (service) channels. For more information about creating channels in the WCF channel model, see Creating a Channel.

See Also

Other Resources

Frequently Asked Questions

© 2013 Microsoft Corporation. All rights reserved.


Planning and Architecture

This section describes:

  • The architecture of end-to-end solutions that use the SQL adapter to operate on a SQL Server database.

  • The internal architecture of the SQL adapter.

Understanding the architecture will help you:

  • Understand the relationship between the SQL adapter and the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK.

  • Understand security boundaries, so that you can improve data security in your solution.

  • Understand the SQL adapter binding properties.

  • Troubleshoot installation issues.

In This Section

  • Architecture of BizTalk Adapter for SQL Server

  • SQL Adapter and the WCF LOB Adapter SDK

Reference

SQL Server Developer Center

© 2013 Microsoft Corporation. All rights reserved.


Architecture of BizTalk Adapter for SQL Server

The Microsoft BizTalk Adapter for SQL Server is a Windows Communication Foundation (WCF) custom binding. This binding contains a single custom transport binding element that enables communication with a SQL Server database. The SQL adapter is wrapped by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK run time and is exposed to applications through the WCF channel architecture. The SQL adapter communicates with the SQL Server database through ADO.NET.

The following figure shows the end-to-end architecture for solutions that are developed by using the SQL adapter.

Consuming the Adapter

The SQL adapter exposes the SQL Server database as a WCF service to client applications. To perform operations and access data on the SQL Server database, client applications exchange SOAP messages with the SQL adapter through WCF channels. The preceding figure shows four ways in which the SQL adapter can be consumed.

  • Through a WCF channel model application. A WCF channel model application performs operations on the SQL Server database by using the WCF channel model to exchange SOAP messages directly with the SQL adapter.

  • Through a WCF service model application. A WCF service model application calls methods on a WCF client to perform operations on the SQL Server database. A WCF client models the operations exposed by the SQL adapter as .NET methods. You can use the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK or the WCF ServiceModel Metadata Utility Tool (svcutil.exe) to create a WCF client class from metadata exposed by the SQL adapter.

  • Through a BizTalk receive location or send port that is configured to use the Microsoft BizTalk WCF-Custom adapter. The WCF-Custom adapter enables the use of WCF extensibility features. By using the WCF-Custom adapter you can select and configure the SQL DB Binding and the behavior for the receive location or send port. For more information about how to use the SQL adapter in BizTalk Server solutions, see Developing BizTalk Applications.

  • Through an IIS-hosted Web service. In this scenario, a WCF service proxy generated by using the adapter is hosted in IIS using the standard WCF Http Binding. This exposes the service contract as a Web service to external users. IIS automatically hosts the adapter at run time, which, in turn, communicates with the SQL Server database.

The SQL Adapter and WCF

WCF presents a programming model based on the exchange of SOAP messages over channels between clients and services. These messages are sent between endpoints exposed by a communicating client and service. An endpoint consists of:

  • An endpoint address, which specifies the location at which messages are received.

  • A binding, which specifies the communication protocols used to exchange messages.

  • A contract, which specifies the operations and data types exposed by the endpoint.

A binding consists of one or more binding elements that stack on top of each other to define how messages are exchanged with the endpoint. At a minimum, a binding must specify the transport and encoding that are used to exchange messages with the endpoint. Message exchange between endpoints occurs over a channel stack that is composed of one or more channels. Each channel is a concrete implementation of one of the binding elements in the binding configured for the endpoint. For more information about WCF and the WCF programming model, see the WCF Help documentation at http://go.microsoft.com/fwlink/?LinkId=196855.

The Microsoft BizTalk Adapter for SQL Server exposes a WCF custom binding, the SQL DB Binding (Microsoft.Adapters.SQLDB.SQLDBBinding). By default, this binding contains a single custom transport binding element, the SQL DB Adapter Binding Element (Microsoft.Adapters.SQLDB.SQLDBAdapter), which enables operations on a SQL Server database.

Microsoft.Adapters.SQLDB.SQLDBBinding (the SQL DB Binding) and Microsoft.Adapters.SQLDB.SQLDBAdapter (the SQL DB Adapter Binding Element) are public classes and are also exposed to the configuration system. Because the SQL DB Adapter Binding Element is exposed publicly, you can build your own custom WCF bindings capable of extending the functionality of the SQL adapter. For example, you could implement a custom binding to support Enterprise Single Sign-on (SSO) in a WCF channel or service model solution. The reasons for doing this would be to aggregate database operations into a single multifunction operation or to perform schema transformation between operations implemented by a custom application and operations on the SQL Server database.

The SQL adapter is built on top of the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, and runs on top of the WCF LOB Adapter SDK run time. The WCF LOB Adapter SDK provides a software framework and tooling infrastructure that the SQL adapter uses to provide a rich set of features to users and adapter clients.

ADO.NET

The SQL adapter connects with the SQL Server database through ADO.NET. ADO.NET provides consistent access to data sources such as SQL Server, and facilitates retrieval, handling, and modification of the data in the data sources. For information about ADO.NET, see http://go.microsoft.com/fwlink/?LinkId=147356.

The SQL client provides connectivity to the SQL Server database. You establish a connection to a SQL Server database by providing a connection URI to the SQL adapter. This connection URI contains the name of the computer on which the SQL Server is installed and the name of the database. For more information about the connection URI, see Establishing a Connection to SQL Server.

See Also

Other Resources

Planning and Architecture
Understanding BizTalk Adapter for SQL Server


SQL Adapter and the WCF LOB Adapter SDK

The Microsoft BizTalk Adapter for SQL Server implements a set of core components that leverage functionality provided by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK and provide connectivity to the SQL Server database through ADO.NET.

The WCF LOB Adapter SDK serves as the software layer through which the SQL adapter interfaces with the Windows Communication Foundation (WCF); ADO.NET serves as the layer through which the SQL adapter interfaces with the SQL Server database. The following figure shows the relationships between the internal components of the SQL adapter and between these components and ADO.NET.

See Also

Other Resources

Planning and Architecture

© 2013 Microsoft Corporation. All rights reserved.


Security and Protection

SQL Server databases often contain sensitive business information such as customer account details. Applications that use the Microsoft BizTalk Adapter for SQL Server to access and modify this information either locally or across a distributed network might inadvertently expose it to access by unauthorized actors, unless efforts are made to protect and secure the data during transmission. Data protection and security are usually thought of in the following terms:

  • Authorization controls access to a resource based on the identity of the requestor.

  • Authentication provides mechanisms for verifying the identity of a requestor.

  • Data confidentiality provides mechanisms for protecting the privacy of data through encryption.

  • Data integrity provides mechanisms to digitally sign data, so that the receiver can ensure that the data has not been altered in-transit.

Another important area of concern is the user-name password credentials that you supply to the SQL adapter. The adapter uses these credentials to open connections to the SQL system. The SQL adapter does not allow credentials to be supplied in the connection URI. This prevents the credentials from getting exposed inadvertently. The SQL adapter provides two alternative methods to supply these credentials in a more secure manner:

Integrated Security. In this case, the SQL adapter uses the Microsoft BizTalk Adapter Pack credentials. You must configure the SQL server to accept these credentials for this method to work.

Enterprise Single Sign-on (SSO). For more information about using SSO, see Security Considerations When Using the Adapter with BizTalk Server.

The topics in this section provide guidelines to help you better secure the solutions that you develop with the SQL adapter.

In This Section

  • Security Considerations Between the SQL Server and Adapter

  • Security Considerations When Using the Adapter with BizTalk Server

  • Security Considerations When Programming on the Adapter

  • Best Practices


Security Considerations Between the SQL Server and Adapter

The SQL adapter is compatible with the standard methods, such as SSO and IPSEC used to secure data exchanges with the database server. Unsecured data exchanges can expose data to unauthorized actors. For information about security issues with SQL Server, see the MSDN article Security Considerations for SQL Server.

You can improve the security of data exchanges by using Internet Protocol Security (IPsec). IPsec is a framework of open standards for protecting communications over Internet Protocol (IP) networks. With IPSec, any data exchanged between the SQL adapter and the SQL server over the network is encrypted, making it difficult for unauthorized actors to use the data. For more information about IPsec and about using IPsec with Microsoft products, see the Microsoft TechNet article IPsec.

The SQL adapter supports SSO and Integrated Security for authentication on the connections that it establishes with the database. With SSO, the credentials are encrypted and stored in the registry. The system uses these credentials to determine access instead of requiring the user to enter them where they might be seen by unauthorized actors. Integrated Security uses the credentials of the logged on user to access the SQL server. This also eliminates the need for users to enter credentials. The database administrator must configure SQL to accept the users credentials for Integrated Security to work correctly.

See Also

Other Resources

Security and Protection

© 2013 Microsoft Corporation. All rights reserved.


Security Considerations When Using the Adapter with BizTalk Server

When you configure a send port or a receive port (location) by using the BizTalk Server Administration console or use the Consume Adapter Service BizTalk Project Add-in to retrieve message schemas for a BizTalk solution, you must provide credentials for the SQL Server database. It is important to supply these credentials in a secure way to help prevent them from being revealed to potentially malicious actors. This topic discusses how to most securely supply credentials for the Microsoft BizTalk Adapter for SQL Server for BizTalk Server solutions.

A more general discussion of security in the context of BizTalk solutions is an expansive topic and is beyond the scope of this documentation. For information about how you can make your BizTalk solutions more secure, see “Security and Protection” at http://go.microsoft.com/fwlink/?LinkID=101135 in the BizTalk Server Help documentation.

How Do I Protect Credentials When I Use the Consume Adapter Service BizTalk Project Add-in?

When you use the Consume Adapter Service Add-in to retrieve message schemas for a BizTalk solution, you must supply the user name and password from the Security tab on the Configure Adapter dialog box. The Consume Adapter Service Add-in will not allow you to set credentials in the Configure a URI field. This improves security by preventing credentials from appearing in clear text. For more information about how to retrieve message schemas by using the Consume Adapter Service Add-in, including how to enter a user name and password for the SQL Server database, see Retrieving Metadata for SQL Server Operations in Visual Studio.

How Do I Protect Credentials When I Configure a Send Port or a Receive Location?

BizTalk solutions use the Microsoft BizTalk WCF-Custom adapter to consume WCF services. The SQL adapter is a WCF custom binding that enables clients to consume the SQL Server database as if it were a WCF service. BizTalk solutions consume the SQL adapter through send ports and receive locations that are configured to use the WCF-Custom adapter. The WCF-Custom adapter is, in turn, configured to use the SQL adapter as its transport. For more information about how to configure send ports and receive ports (receive locations), including how to configure the WCF-Custom adapter, see Manually Configuring a Physical Port Binding to the SQL Adapter.

You configure the SQL Server database credentials from the Credentials tab of the WCF-Custom Transport Properties dialog box for send ports or from the Other tab of the WCF-Custom Transport Properties dialog box for receive locations. Because the WCF-Custom adapter supports Enterprise Single Sign-On (SSO), you can also choose to provide either a user name and password or an SSO affiliate application on either of these tabs. The following topics discuss both options.

User Name Password Credentials

You should only supply a user name and password from the Credentials tab (for send ports) or the Other tab (for receive locations) in the WCF-Custom Transport Properties dialog box. This ensures the following:

  • Your credentials will not be displayed in the Address (URI) field of the dialog box. This prevents those who have access to your screen (or who have permissions that enable them to view the send port or receive location properties) from seeing your credentials.

  • Your password will not be written to the binding file if you export the send port or receive port binding. This prevents anyone with access to the file from viewing your password.

Enterprise Single Sign-On and SSO Affiliate Applications

You can configure the WCF-Custom adapter so that it uses Enterprise Single Sign-on (SSO) to get the credentials for the SQL Server database. SSO uses a database and a master secret to encrypt and store user credentials. It also provides services to map Microsoft Windows accounts to secondary credentials that are used to access a back-end system. By using SSO, you can map a Windows account to a user name and password on the SQL Server database.

SSO uses affiliate applications and SSO mappings to map credentials to the back-end system. An affiliate application is a logical entity in SSO that refers to a system or an application that requires secondary credentials. An SSO mapping is associated with an affiliate application. It maps a Windows account to the secondary credentials used by that account to access the affiliate system or application. An SSO mapping can be associated with a Windows user account or with a group.

To use SSO with the SQL adapter, you must do the following.

  1. Create an affiliate application in SSO to hold the user name password credentials for the SQL Server database. This step is often performed by someone with special types of SSO administrative privileges.

  2. Create a user or group mapping for the affiliate application that maps your Windows account to the user name and password that are used to establish a connection with the SQL Server database. Depending on your installation, a user might be able to perform this step, or it might require someone with special types of SSO administrative privileges.

Note
When configured for SSO, the WCF-Custom adapter uses services provided by SSO to get the SQL Server user name and password from the SSO database. It provides these (unencrypted) to the SQL adapter, so that the adapter can open a connection to the SQL Server database. SSO provides no encryption or protection across the connection between the SQL adapter and the SQL Server database.

For information about how to use SSO, including information about how to create affiliate applications and SSO mappings, see the "Using SSO" topic in the BizTalk Server documentation at http://go.microsoft.com/fwlink/?LinkId=103052. For more general information about SSO, see the "Implementing Enterprise Single Sign-On" topic in the BizTalk Server documentation at http://go.microsoft.com/fwlink/?LinkId=103054.

The AcceptCredentialsInUri Binding Property

The SQL adapter does not support AcceptCredentialsInUri binding property. Credentials are never permitted in the connection URI.

See Also

Concepts

Best Practices

Other Resources

Security and Protection

© 2013 Microsoft Corporation. All rights reserved.


Security Considerations When Programming on the Adapter

How Do I Protect Credentials When I Use the Add Adapter Service Reference Visual Studio Plug-in?

When you use the Add Adapter Service Reference Plug-in to create a WCF client, you might have to supply a user name and password for the SQL Server database. You must enter credentials from the Security tab on the Configure Adapter dialog box. The SQL adapter does not provide an option to specify the user name and password as part of the connection URI. This ensures the following:

  • The credentials will not be displayed in the Configure a URI field of the Add Adapter Service Reference Plug-in dialog box where anyone with access to your computer screen can read them.

  • The credentials will not appear in the configuration file that the Add Adapter Service Reference Plug-in generates.

For more information about how to generate a WCF client by using the Add Adapter Service Reference Plug-in, including how to enter a user name and password for the SQL Server database, see Retrieving Metadata for SQL Server Operations in Visual Studio.

What Are Best Practices for Setting Credentials in Code?

WCF provides the ClientCredentials class to help you configure the credentials that a client communication object, such as a ChannelFactory, uses to authenticate itself with a service. By using the ClientCredentials class, you ensure that WCF takes whatever authentication mechanisms are specified in that object’s channel stack and applies them to the exchange between your client and the service.

Because the SQL adapter is hosted in-process with its consuming application, it is not imperative to use the ClientCredentials class to set credentials on the client communication objects that the consuming application uses. It is, however, considered good practice to do so.

The SQL adapter requires the use of the ClientCredentials class for programmatically passing credentials. The AcceptCredentialsInUri binding property is ignored by the SQL adapter to prevent passing credentials in the URI.

The following example shows how to use the Credentials property to set credentials for the SQL Server database on a ChannelFactory.

Copy Code
// Create binding and endpoint
SqlAdapterBinding binding = new SqlAdapterBinding();
EndpointAddress address = new EndpointAddress("mssql://mysqlserver//mydatabase?");

// Create the channel factory
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, endpointAddress))

// Set user name and password
factory.Credentials.UserName.UserName = "myuser";
factory.Credentials.UserName.Password = "mypassword";

// Open the channel factory
factory.Open();

The following example shows how to use the ClientCredentials class to set credentials for the SQL Server database on a WCF client.

Copy Code
// Initialize a new client for the SELECT operation on the Employee table
SqlAdapterBinding binding = new SqlAdapterBinding();
EndpointAddress address = new EndpointAddress("mssql://mysqlserver//mydatabase?");
TableOp_dbo_EmployeeClient client = new TableOp_dbo_EmployeeClient(binding,address);

// Set user name and password
client.ClientCredentials.UserName.UserName = "myuser";
client.ClientCredentials.UserName.Password = "mypassword";

// Open the client
client.Open();

How Can I Provide for More Secure Data Exchange Across Process Boundaries?

The SQL adapter is hosted in-process with the application or service that consumes it. Because the adapter is hosted in-process with the consumer, there is no need to provide security on messages exchanged between the consumer and the SQL adapter. However, if the consuming application or service sends messages that contain sensitive database information across a process boundary to another service or client, you should take measures to provide adequate protection for this data in your environment. Windows Communication Foundation (WCF) provides many options for helping to secure messages sent between clients and services. For more information about helping to secure messages sent between clients and services in WCF, see "Securing Services and Clients" at http://go.microsoft.com/fwlink/?LinkId=89725. For more general information about security features that WCF provides, see "Windows Communication Foundation Security" at http://go.microsoft.com/fwlink/?LinkId=89726.

See Also

Concepts

Best Practices

Other Resources

Security and Protection

© 2013 Microsoft Corporation. All rights reserved.


Best Practices

This section provides best practices that you should follow to more completely protect sensitive data when you use or develop applications that consume the Microsoft BizTalk Adapter for SQL Server.

Security Best Practices for the Connection between the SQL Adapter and the SQL Server Database

  • The SQL adapter provides no support for helping to secure communication between it and the SQL Server database. You must provide a mechanism to help ensure an adequate level of security for data exchanged between the adapter and the SQL Server database.

  • For security reasons, the SQL adapter does not allow you to provide user name password credentials for the SQL Server database in the connection URI. See the remainder of this topic for alternative methods of providing credentials to the SQL adapter.

  • The SQL adapter also enables you to use Windows Authentication while connecting to SQL Server to generate metadata and perform operations, either through Visual Studio or BizTalk Server. Before using Windows Authentication, you must add the Windows user as a user in SQL Server Management Studio. For more information, see Connecting to SQL Server Using Windows Authentication.

For more information, see Security Considerations Between the SQL Server and Adapter.

Security Best Practices for Consuming the SQL Adapter with BizTalk Server

  • The SQL adapter does not allow you to provide user name password credentials for the SQL Server database in the connection URI.

  • When you use the Consume Adapter Service Add-in, enter the user name password credential for the SQL Server database from the Security tab of the Configure Adapter dialog box.

  • When you configure the BizTalk WCF-Custom adapter for the SQL adapter on a send port, enter the user name password credential for the SQL Server database from the Credentials tab of the WCF-Custom Transport Properties dialog box.

  • When you configure the BizTalk WCF-Custom adapter for the SQL adapter on a receive location, enter the user name password credential for the SQL Server database from the Other tab of the WCF-Custom Transport Properties dialog box.

  • While using Consume Adapter Service Add-in to generate metadata, configuring send port, or configuring receive port, you can also use Windows Authentication. Before using Windows Authentication, you must add the Windows user as a user in SQL Server Management Studio. For more information, see Connecting to SQL Server Using Windows Authentication.

For more information, see Security Considerations When Using the Adapter with BizTalk Server.

Security Best Practices for Consuming the SQL Adapter with Programming Solutions

  • It is sometimes necessary to provide the user name password credentials for the SQL Server database in the connection URI; however, if possible, you should avoid doing this.

  • When you use the Add Adapter Service Reference Visual Studio Plug-in, enter the user name password credential for the SQL Server database from the Security tab of the Configure Adapter dialog box.

  • In WCF channel model programming, use the Credentials property on the channel factory to set the user name password credential for the SQL Server database.

  • In WCF service model programming, use the ClientCredentials property on the WCF client to set the user name password credential for the SQL Server database.

  • If an application that consumes the SQL adapter sends messages that contain sensitive database information across a process boundary to another service or client, ensure that these messages have sufficient security measures applied to provide adequate data protection in your environment.

  • While using Add Adapter Service Reference Plug-in or connecting to SQL Server from a .NET application, you can also use Windows Authentication. Before using Windows Authentication, you must add the Windows user as a user in SQL Server Management Studio. For more information, see Connecting to SQL Server Using Windows Authentication.

For more information, see Security Considerations When Programming on the Adapter.

Security Best Practices for Hosting the SQL Adapter in IIS

Hosting the SQL adapter in Microsoft Internet Information Services (IIS) as a Web service exposes operations surfaced by the SQL adapter to Web clients. These operations might involve exchanging sensitive data over the Internet, so you should take measures to help ensure that this data is as secure as possible.

WCF provides two standard bindings for HTTP transport: the BasicHttpBinding provides basic HTTP transport with no security mechanisms; the WSHttpBinding supports both transport-level and message-level security mechanisms.

You can either use the BasicHttpBinding over an HTTPS connection, or use the WSHttpBinding to help protect your data. The WCF LOB Adapter SDK includes the WCF LOB Adapter Service Development Wizard to generate WCF service for LOB artifacts. This wizard only supports use of BasicHttpBinding.

You can also develop a custom HTTP binding to leverage additional security mechanisms that your environment provides. For more information about the security features that WCF provides, see "Securing Services and Clients" at http://go.microsoft.com/fwlink/?LinkId=89725.

When hosting the SQL adapter as a Web service, Web developers should take measures to prevent strings typed in by users from being passed directly to the SQL Server database. For example, if a Web site lets the user enter a value that will be part of a WHERE clause in a SELECT statement, the input string should be scanned to prevent adding other commands to the statement.

Security Best Practices for WCF Diagnostic Tracing and Message Logging

WCF supports diagnostic tracing and message logging. You configure diagnostic tracing and message logging either through configuration files or by using Windows Management Instrumentation (WMI). Depending on the configuration options you set, WCF diagnostic tracing or message logging can emit sensitive information to log files, where it could potentially be exposed to observation by unauthorized users.

Follow the recommendations provided in the WCF documentation to mitigate potential security threats exposed by enabling these features. At a minimum, you should observe the following best practices for diagnostic tracing and message logging:

  • Do not enable “verbose” or “information” tracing in a production environment. This may lead to performance degradation. However, you must enable “warning” and “error” tracing in a production environment. If you enable tracing, you must take proper security measures to protect your data. See the WCF documentation for more information.

  • Ensure that log files and configuration files are protected by access control lists (ACLs).

The following warnings apply specifically to the messages that are exchanged between a client application and the SQL adapter:

  • WCF diagnostic tracing can log the header (but not the body) of messages exchanged with the SQL adapter. Because the message action is in the message header, this reveals the operations invoked on the SQL adapter by the client.

  • If WCF message logging is enabled and logMessagesAtServiceLevel is true, the message header (but not the message body) of messages exchanged between the adapter client and the SQL adapter are logged. Because the message action is in the message header, this reveals the operations that the client invoked on the SQL adapter. If logEntireMessage is also true, the message body will be logged. This can reveal sensitive database information.

For more information about improving security when you enable diagnostic tracing, see "Security Concerns and Useful Tips for Tracing" at http://go.microsoft.com/fwlink/?LinkId=89796. For more information about improving security when you enable message logging, see "Security Concerns for Message Logging" at http://go.microsoft.com/fwlink/?LinkId=89797.

See Also

Other Resources

Security and Protection

© 2013 Microsoft Corporation. All rights reserved.


Development

The Microsoft BizTalk Adapter for SQL Server is a Windows Communication Foundation (WCF) binding. Client applications can consume the SQL adapter to invoke operations on SQL Server artifacts. The SQL adapter can be consumed:

  • Through a physical port binding in a BizTalk Server solution.

  • By invoking methods on an instance of a client proxy.

  • As a hosted WCF service.

  • By sending SOAP messages over a channel instance in code that uses the WCF channel model.

The following table:

  • Lists the different operations that can be performed on SQL Server using the SQL adapter.

  • Provides links to the topics containing information about performing the task using the chosen approach (BizTalk Server, WCF service model, WCF channel model).

Task | BizTalk Server | WCF Service Model | WCF Channel Model
Performing basic Insert, Update, Delete, and Select operations on tables and views | Performing Basic Insert, Update, Delete, and Select Operations by Using BizTalk Server | Performing Insert, Update, Delete, and Select Operations by Using the WCF Service Model | Performing an Insert Operation on a Table Using the WCF Channel Model
Performing operations on tables and views with large data type columns (Also includes information about FILESTREAM operations using the adapter) | Performing Operations on Tables and Views with Large Data Types by Using BizTalk Server | Performing Operations on Tables and Views with Large Data Types by Using the WCF Service Model | -
Executing stored procedures | Executing Stored Procedures in SQL Server by Using BizTalk Server | Invoking Stored Procedures Using the WCF Service Model | -
Executing stored procedures with single parameters without using a BizTalk orchestration | Executing Stored Procedures With a Single XML Parameter | - | -
Executing stored procedures that contain a FOR XML clause in the definition | Executing Stored Procedures Having a FOR XML Clause | - | -
Performing composite operations on SQL Server | Performing Composite Operations on SQL Server by Using BizTalk Server | - | -
Invoking scalar functions in SQL Server | Invoking Scalar Functions in SQL Server by Using BizTalk Server | Invoking Scalar Functions in SQL Server by Using the WCF Service Model | -
Invoking table-valued functions in SQL Server | Invoking Table-Valued Functions in SQL Server by Using BizTalk Server | Invoking Table-Valued Functions in SQL Server by Using the WCF Service Model | -
Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery operations | Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using BizTalk Server | Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using WCF Service Model | -
Receiving polling-based data-change messages | Polling SQL Server by Using the SQL Adapter with BizTalk Server | Polling SQL Server by Using the SQL Adapter with WCF Service Model | Receiving Polling-based Data-changed Messages from SQL Server by Using the WCF Channel Model
Receiving SQL Server notifications | Receiving Query Notifications by Using BizTalk Server | Receiving Query Notifications Using the WCF Service Model | -

The topics in this section provide information, procedures, and examples to help you develop applications that consume the SQL adapter in both BizTalk Server and .NET programming solutions. The topics also provide information on other key aspects of using the adapters such as:

  • Connecting to SQL Server.

  • Retrieving metadata from SQL Server.

  • Using binding properties to configure the adapter.

In This Section

  • Establishing a Connection to SQL Server

  • Retrieving Metadata for SQL Server Operations in Visual Studio

  • Working with BizTalk Adapter for SQL Server Binding Properties

  • Before Developing Applications Using the SQL Adapter

  • Developing BizTalk Applications

  • Developing Applications by Using the WCF Service Model

  • Developing Applications by Using the WCF Channel Model

  • Samples

  • How Do I?


Establishing a Connection to SQL Server

The Microsoft BizTalk Adapter for SQL Server is a Windows Communication Foundation (WCF) custom binding. As such, it enables communication to a SQL Server database through a WCF endpoint address. In WCF, the endpoint address identifies the network location of a service and is typically expressed as a Uniform Resource Identifier (URI). The SQL adapter expresses this location as a connection URI, which contains properties that the SQL adapter uses to establish a connection to the SQL Server database. You must specify a connection URI when you:

  • Create a channel factory or a channel listener using the WCF channel model or when you create a WCF client or service host using the WCF service model.

  • Create a physical port binding in a BizTalk Server solution.

  • Use the Add Adapter Service Reference Visual Studio Plug-in to generate a WCF client class or WCF service interface for a WCF service model solution.

  • Use the Consume Adapter Service BizTalk Project Add-in to retrieve message schemas from the SQL adapter for a BizTalk Server solution.

  • Use the ServiceModel Metadata Utility tool (svcutil.exe) to generate a WCF client class or WCF service interface for a WCF service model solution.

The topics in this section describe how to establish a connection between the Microsoft BizTalk Adapter for SQL Server and the SQL Server database by providing you with:

  • Information about the connection properties and the structure of the SQL Server connection URI.

  • Links to topics that show how to specify a connection URI by using the SQL adapter.

  • Information about connecting to SQL Server using Windows Authentication.

In This Section

  • SQL Server Connection URI

  • Connecting to SQL Server Using Windows Authentication

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


SQL Server Connection URI

The Microsoft BizTalk Adapter for SQL Server connection URI contains properties that the adapter uses to establish a connection to the SQL Server database. This topic provides information about the SQL Server connection URI, and provides links to other topics that explain how to specify a URI in different programming scenarios.

The Connection URI for the SQL Adapter

A typical endpoint address URI in WCF is represented as: scheme://hostinfoparams?query_string, where:

  • scheme is the scheme name.

  • hostinfoparams is information required to establish the connection to the host; for example, a server name.

  • query_string is an optional name-value collection of parameters delimited by a question mark (?).

The SQL adapter connection URI adheres to this basic format and is implemented as follows:

Copy Code
mssql://[Server_Name[:Portno]]/[Database_Instance_Name]/[Database_Name]?FailoverPartner=[Partner_Server_Name]&InboundId=[Inbound_ID]

where, mssql is the scheme for the SQL Server connection URI.

The following table explains the properties contained in the connection URI.

Connection URI Property | Category | Description
[SERVER_NAME] | hostinfoparams | Name of the server on which SQL Server is installed. If you do not specify a value, the adapter assumes the server name as “localhost” and establishes a connection with the SQL Server database on the local server.
[PORTNO] | hostinfoparams | The port number where the connection is established. If you do not specify a value, the adapter connects through the default port.
[DATABASE_INSTANCE_NAME] | hostinfoparams | Name of the SQL Server instance to connect to. If you do not specify a value, the adapter connects to the default database instance.
[DATABASE_NAME] | hostinfoparams | Name of the database to connect to. If you do not specify a value, the adapter connects to the default database.
[PARTNER_SERVER_NAME] | query_string | Name of the failover SQL Server database to connect to if the primary SQL Server database is not available. For more information about high availability with respect to SQL Server, see “Using Database Mirroring” at http://go.microsoft.com/fwlink/?LinkID=196852.
[INBOUND_ID] | query_string | An identifier that you add to the connection URI to make it unique. You must provide this connection parameter if you want to generate metadata for the TypedPolling inbound operation. Also, in a BizTalk application, if you have multiple receive locations polling the same database, the inbound ID makes the connection URI unique, thereby enabling adapter clients to receive polling messages from the same database on different receive locations. For more information, see Receiving Polling Messages Across Multiple Receive Ports.

Note
For more information about these connection string properties, see “SqlConnection.ConnectionString Property” at http://go.microsoft.com/fwlink/?LinkId=196958.

SQL Server Credentials and the Connection URI

The SQL adapter does not support specifying credentials in the connection URI. For more information about specifying credentials in your applications that use the SQL adapter, see Security and Protection.

Using Special Characters in the Connection URI

The SQL adapter does not support specifying a connection URI that has special characters for any of the parameter values. If the connection parameter values contain special characters, make sure you do one of the following:

  • If you are specifying the URI in Visual Studio using Add Adapter Service Reference Plug-in or Consume Adapter Service Add-in, you must specify them as-is in the URI Properties tab, that is, without using any escape characters. If you specify the URI directly in the Configure a URI field and the connection parameters contain special characters, you must specify the connection parameters using proper escape characters.

    For example, if the connection URI has a parameter with name sql server, you must specify it as sql%20server.

  • If you are specifying the URI while creating a send or receive port in BizTalk Server Administration console, and the connection parameters contain special characters, you must specify the connection parameters using proper escape characters.

Using the Connection URI to Connect to the SQL Server Database

The following is a sample connection URI for the SQL adapter.

Copy Code
mssql://sql_server/sql_server_instance//

In the preceding example, “sql_server” is the name of the computer on which SQL Server is installed whereas “sql_server_instance” is the name of the database instance to connect to. Because no database name is specified, the adapter will connect to the default database.

The following is an example of a connection URI where the SQL Server database is installed on the same computer as the SQL adapter. In this example, the adapter connects to the database “my_database” for the “sql_server_instance” database instance on the local computer.

Copy Code
mssql://localhost/sql_server_instance/my_database/

In this example, the adapter connects to the default database for the default instance running on the local computer.

Copy Code
mssql://localhost///

For information about how to specify a connection to the SQL Server database when you:

  • Use the Consume Adapter Service BizTalk Project Add-in or the Add Adapter Service Reference Visual Studio Plug-in, see Connecting to SQL Server in Visual Studio.

  • Configure a send port or receive port (location) in a BizTalk Server solution, see Manually Configuring a Physical Port Binding to the SQL Adapter.

  • Use the WCF channel model in a programming solution, see Creating a Channel.

  • Use the WCF service model in a programming solution, see Specifying a Client Binding for the SQL Adapter.

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Connecting to SQL Server Using Windows Authentication

The SQL adapter enables adapter clients to use Windows Authentication to establish a connection with SQL Server. To use Windows Authentication adapter clients must specify an empty user name and password. For more information about connecting to SQL Server using Windows Authentication, see Connecting to SQL Server in Visual Studio.

To enable adapter clients to use Windows Authentication to connect to SQL Server, you must perform the following tasks on the computer running SQL Server.

Note
The steps provided here are for SQL Server 2008 and SQL Server 2005. Refer to SQL Server documentation for more information.

To enable Windows Authentication on SQL Server

  1. Start SQL Server Management Studio and in the Connect to Server dialog box, specify a SQL Server name and administrator credentials to connect to the server.

  2. In Object Explorer, expand the SQL Server.

  3. Expand Security, right-click Logins, and then click New Login.

  4. In the Login – New window, for the Login name text box, specify the Windows user name in the format domain\username.

  5. In the left pane, click User Mapping. In the right pane, select a database to associate with the user. In the Database role membership for box, select the db_owner check box.

  6. Click OK.

After you have added the user to SQL Server, the user can connect to SQL Server using the SQL adapter, logging in with a blank username and password.

See Also

Other Resources

Establishing a Connection to SQL Server

© 2013 Microsoft Corporation. All rights reserved.


Retrieving Metadata for SQL Server Operations in Visual Studio

The Microsoft BizTalk Adapter for SQL Server provides three Visual Studio components that you can use to help you develop solutions using the adapter—the Consume Adapter Service BizTalk Project Add-in, the Add Adapter Metadata Wizard, and the Add Adapter Service Reference Visual Studio Plug-in. Adapter clients must use these components to connect to SQL Server and then generate metadata for the operations they want to perform.

All these Visual Studio components simplify development by:

  • Providing a Microsoft Windows interface through which you can browse and search for operations that you want to use in your solution.

  • Retrieving metadata exposed by the adapter for these target operations.

  • Converting that metadata, which is expressed as a Web Services Description Language (WSDL) document by the adapter, into a form that you can use in your solution (XSD message schemas for BizTalk projects or a .NET object representation of a service contract for the WCF service model) and adding it to your project.

This section provides instructions about how to use the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, and the Add Adapter Service Reference Plug-in.

In This Section

  • Connecting to SQL Server in Visual Studio

  • Browsing, Searching, and Retrieving Metadata for SQL Server Operations


Connecting to SQL Server in Visual Studio

This section provides instructions about how to use the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, and the Add Adapter Service Reference Plug-in.

  • The Consume Adapter Service BizTalk Project Add-in is available in BizTalk Server projects and is installed as part of the WCF LOB Adapter SDK installation. You use the Consume Adapter Service Add-in to generate message schemas (XSDs) for operations that you want to target in your BizTalk solution. For more information about developing solutions with BizTalk Server, see Developing BizTalk Applications.

  • The Add Adapter Metadata Wizard is available in the BizTalk Server projects and is installed as part of the BizTalk Server installation. You use the Add Adapter Metadata Wizard to generate message schemas (XSDs) for operations that you want to target in your BizTalk solution. For more information about developing solutions with BizTalk Server, see Developing BizTalk Applications.

    Note
    Because the SQL adapter is exposed both as a WCF-Custom binding and as BizTalk adapter, you can use either the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard from a BizTalk project to connect to SQL Server.

  • The Add Adapter Service Reference Visual Studio Plug-in is available in non-BizTalk programming projects. You use the Add Adapter Service Reference Plug-in to generate a WCF client class or a WCF service callback interface when you develop solutions using the WCF service model. For more information about developing solutions with the WCF service model, see Developing Applications by Using the WCF Service Model.

To use the Consume Adapter Service BizTalk Project Add-in, Add Adapter Metadata Wizard, or the Add Adapter Service Reference Visual Studio Plug-in, you must first connect to SQL Server. All three methods present a dialog box through which you configure a connection by setting the following:

  • Connection parameters. These are the parameters that are used to build the connection URI such as the SQL Server name, the database instance name, and the database name.

  • User name password credentials for SQL Server. These are used to authenticate you on SQL Server when the connection is established. You must specify a user name and password.

  • Binding properties. Binding properties are optional, and whether you specify them depends primarily on whether you target operations that require specific binding properties to be set. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

At a minimum, when you configure the connection to SQL Server, you only have to specify binding properties and connection parameters that are needed to establish the connection and that affect the metadata returned by the SQL adapter for the operations you want to target. However, you might also want to specify values for any additional binding properties and connection parameters that will be used at run time. This is because:

  • The Consume Adapter Service Add-in creates a BizTalk port binding file from the binding properties and connection parameters that you specify when you configure the connection and adds this file to your project.

  • The Add Adapter Service Reference Plug-in creates an app.config file from the binding properties and connection properties that you specify when you configure the connection and adds this file in your project directory.

In This Section

  • Connecting to SQL Server in Visual Studio Using Consume Adapter Service Add-in

  • Connecting to SQL Server in Visual Studio Using Add Adapter Metadata Wizard

  • Connecting to SQL Server in Visual Studio Using Add Adapter Service Reference Plug-in


Connecting to SQL Server in Visual Studio Using Consume Adapter Service Add-in

The Consume Adapter Service BizTalk Project Add-in is installed when you install WCF LOB Adapter SDK. The Consume Adapter Service Add-in loads all the WCF-Custom bindings installed on the computer. To connect to SQL Server using the WCF-based SQL adapter in a BizTalk project, you must use the sqlbinding.

This topic provides instructions on how to use the Consume Adapter Service Add-in.

Connecting to SQL Server Using Consume Adapter Service Add-in

Perform the following steps to connect to SQL Server using the Consume Adapter Service Add-in.

To connect to SQL Server

  1. To connect using the Consume Adapter Service Add-in in a BizTalk solution:

    1. Create a BizTalk project using Visual Studio.

    2. Right-click the project name in Solution Explorer, point to Add, and then click Add Generated Items.

    3. In the Add Generated Items dialog box, do the following:

      Use this To do this

      Categories

      Click Consume Adapter Service.

      Templates

      Click Consume Adapter Service.

    4. Click Add. The Consume Adapter Service Add-in opens.

  2. From the Select a binding drop-down list, select sqlBinding, and then click Configure.

  3. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  4. Click the URI Properties tab, and then specify values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

    Note
    If the connection parameters contain any reserved characters, you must specify them as-is in the URI Properties tab, that is, without using any escape characters. However, if you specify the URI directly in the Configure a URI field and the connection parameters contain reserved characters, you must specify the connection parameters using proper escape characters.

    Note
    If you do not specify any values in the URI property tab, the Consume Adapter Service Add-in puts the URI as mssql://.//. In such a case, the adapter connects to the default database and the default database instance on the local computer.

  5. Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target.

  6. Click OK.

  7. Click Connect. After the connection is established, the connection status is shown as Connected.

    The following figure shows the Consume Adapter Service Add-in immediately after the connection is established.

    Connect to SQL Server

    The Consume Adapter Service Add-in displays different nodes containing various operations that can be performed on SQL Server. For example, the Procedures node contains all the procedures available for the database you connected to. Similarly, the Tables node contains all the tables in the database you connected to, and the operations that can be performed on a table. For more information about these nodes, see Metadata Node IDs.

See Also

Other Resources

Connecting to SQL Server in Visual Studio


Connecting to SQL Server in Visual Studio Using Add Adapter Metadata Wizard

The SQL adapter is also exposed as a BizTalk adapter and, therefore, you can use the Add Adapter Metadata Wizard to generate schema for the operations you want to perform on SQL Server using the adapter.

Connecting to SQL Server Using Add Adapter Metadata Wizard

Perform the following steps to connect to SQL Server using the Add Adapter Metadata Wizard.

To connect to SQL Server

  1. To connect using the Add Adapter Metadata Wizard in a BizTalk solution:

    1. Create a BizTalk project using Visual Studio.

    2. Right-click the project name in Solution Explorer, point to Add, and then click Add Generated Items.

    3. In the Add Generated Items dialog box, do the following:

      Use this To do this

      Categories

      Click Add Adapter.

      Templates

      Click Add Adapter Metadata.

    4. Click Add. The Add Adapter Metadata Wizard opens.

    5. In the Add Adapter Wizard, select WCF-SQL. Select the computer on which BizTalk Server is installed and the name of the BizTalk database.

      Important
      If you already have a WCF-SQL port configured in BizTalk, select the port from the Port list.

    6. Click Next.

  2. From the Select a binding drop-down list, select sqlBinding, and then click Configure.

  3. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  4. Click the URI Properties tab, and then specify values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

    Note
    If the connection parameters contain any reserved characters, you must specify them as-is in the URI Properties tab, that is, without using any escape characters. However, if you specify the URI directly in the Configure a URI field and the connection parameters contain reserved characters, you must specify the connection parameters using proper escape characters.

    Note
    If you do not specify any values in the URI property tab, the Consume Adapter Service Add-in puts the URI as mssql://.//. In such a case, the adapter connects to the default database and the default database instance on the local computer.

  5. Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target. For more information about binding properties see, Working with BizTalk Adapter for SQL Server Binding Properties.

    Note
    If you are generating metadata using Add Adapter Metadata Wizard and you selected an existing WCF-SQL send port, you need not specify the binding properties. The binding properties are picked from the send port configuration. However, you may choose to specify the binding properties that are required at design-time, if any. In such case, the new values for binding properties will be used at design-time while generating the metadata. However, at run-time the values specified for binding properties in the send port configuration will be applicable.

  6. Click OK.

  7. Click Connect. After the connection is established, the connection status is shown as Connected.

    The following figure shows the Consume Adapter Service Add-in immediately after the connection is established. The graphical user interface is same for the Add Adapter Metadata Wizard.

    Connect to SQL Server

    The Consume Adapter Service Add-in displays different nodes containing various operations that can be performed on SQL Server. For example, the Procedures node contains all the procedures available for the database you connected to. Similarly, the Tables node contains all the tables in the database you connected to, and the operations that can be performed on a table. For more information about these nodes, see Metadata Node IDs.

See Also

Other Resources

Connecting to SQL Server in Visual Studio


Connecting to SQL Server in Visual Studio Using Add Adapter Service Reference Plug-in

To connect to SQL Server using the SQL adapter in a .NET programming solution, you must use the Add Adapter Service Reference Visual Studio Plug-in. This topic provides instructions on how to use the Add Adapter Service Reference Plug-in.

Connecting to SQL Server Using Add Adapter Service Reference Plug-in

Perform the following steps to connect to SQL Server using the Add Adapter Service Reference Plug-in.

To connect to SQL Server

  1. To connect using the Add Adapter Service Reference Plug-in in a programming solution:

    1. Create a project in Visual Studio.

    2. Right-click the project in Solution Explorer, and then click Add Adapter Service Reference. The Add Adapter Service Reference Plug-in opens.

  2. From the Select a binding drop-down list, select sqlBinding, and then click Configure.

  3. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  4. Click the URI Properties tab, and then specify values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

    Note
    If the connection parameters contain any reserved characters, you must specify them as-is in the URI Properties tab, that is, without using any escape characters. However, if you specify the URI directly in the Configure a URI field and the connection parameters contain reserved characters, you must specify the connection parameters using proper escape characters.

    Note
    If you do not specify any values in the URI property tab, the Consume Adapter Service Add-in puts the URI as mssql://.//. In such a case, the adapter connects to the default database and the default database instance on the local computer.

  5. Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target.

  6. Click OK.

  7. Click Connect. After the connection is established, the connection status is shown as Connected.

    The following figure shows the Consume Adapter Service Add-in immediately after the connection is established. The graphical user interface is same for the Add Adapter Service Reference Plug-in.

    Connect to SQL Server

    The Add Adapter Service Reference Plug-in displays different nodes containing various operations that can be performed on SQL Server. For example, the Procedures node contains all the procedures available for the database you connected to. Similarly, the Tables node contains all the tables in the database you connected to, and the operations that can be performed on a table. For more information about these nodes, see Metadata Node IDs.

See Also

Other Resources

Connecting to SQL Server in Visual Studio


Browsing, Searching, and Retrieving Metadata for SQL Server Operations

This section provides information about how to use the Consume Adapter Service BizTalk Project Add-in, the Add Adapter Metadata Wizard, and the Add Adapter Service Reference Visual Studio Plug-in. By using these Visual Studio components, you can:

  • Browse for operations for which to retrieve metadata.

  • Search for operations for which to retrieve metadata.

  • Add message schemas for selected operations and port binding configuration files to a BizTalk Server project when using the Consume Adapter Service Add-in.

  • Add a WCF client class or a WCF service contract (interface) for selected operations and a configuration file (app.config) to a non-BizTalk programming project when using the Add Adapter Service Reference Plug-in.

Note
The Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, and the Add Adapter Service Reference Plug-in present essentially the same interface when you browse and search for operations, so all three components are covered in the same topics.

Prerequisites

You must connect to SQL Server before you can browse, search, or retrieve metadata for target operations. For information about how to connect to SQL Server when you use the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in, see Connecting to SQL Server in Visual Studio.

Browsing for Operations

You can use the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in to browse for outbound and inbound operations that can be performed on SQL Server using the SQL adapter.

Outbound Operations

The SQL adapter enables clients to perform the following outbound operations.

  • Insert, Select, Update, and Delete operations on tables and views.

  • Set<column_name> operations on tables and views. This operation is exposed on tables that have columns of varchar(max), nvarchar(max), or varbinary(max). Such operations enable streaming of large objects.

  • Stored procedures, both weakly and strongly-typed as operations.

  • Scalar and table valued functions as operations.

The adapter also exposes the generic outbound operations such as ExecuteReader, ExecuteScalar, and ExecuteNonQuery at the root level.

Inbound Operations

The SQL adapter enables clients to perform the following inbound operations.

  • Polling operation to receive polling-based data-change messages from SQL Server. The messages received for this operation are not strongly typed.

  • TypedPolling operation to receive polling-based data-change messages from SQL Server. The messages received for this operation are strongly typed.

  • Notification operation to receive query notifications from SQL Server.

Note
The adapter also supports an XmlPolling inbound operation to enable polling on SQL Server database using SELECT statements and stored procedures that contain a FOR XML clause. However, the adapter does not expose a specific inbound operation for this. For more information about XmlPolling, see Receiving Polling Messages Using SELECT Statements with FOR XML Clause.

For more information about these operations, see What Operations Can Be Performed Using the Adapter?.

Note
By using the Consume Adapter Service Add-in or the Add Adapter Service Reference Plug-in, you can browse category and operation nodes using a Windows interface.

For more information about browsing metadata, see How Does the Adapter Surface SQL Server Metadata?.

To browse outbound operations on SQL Server

  1. Connect to SQL Server using the Consume Adapter Service Add-in, Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in. See Connecting to SQL Server in Visual Studio for instructions.

  2. From the Select contract type list, for outbound operations select Client (Outbound operations).

  3. The Select a category box lists the artifacts available in the SQL Server database you connect to. Click an artifact to view the operations available for that artifact in the Available categories and operations box.

    Tip
    You can directly go to the “immediate” category node or subcategory nodes in the tree, by typing the name of the artifact, while the focus is on the tree view in the Select a category box. For example, to jump to the Employee table node, keep the focus on the Tables node, and then type Employee.

    The following figure shows the Consume Adapter Service Add-in. The root node (/) is selected, and the general category nodes available under the root node are listed in the Available categories and operations box.

    Operations and categories available at root level
    Note
    The standard SQL Server operations such as ExecuteReader, ExecuteScalar, and ExecuteNonQuery are also available at the root level. For more information about these operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

  4. To see the procedures available in the SQL Server database, click the Procedures node. In the following figure, the Procedures node is selected in the Select a category box, and the corresponding procedures are listed in the Available categories and operations box.

    Browse procedures in the SQL Server

    Note
    The same set of procedures that are listed under the Procedures node are also available under the Strongly-Typed Procedures node. The difference is in the way schema is generated. For a procedure under the Procedure node, the schema is weakly typed. However, for a procedure under the Strongly-Typed Procedure node, the schema is strongly typed. Strongly-typed schema is useful if you want to map schema of one operation to another operation using BizTalk mapper because the schema is available to you at design-time while creating the BizTalk project. For weakly-typed procedures, the schema for the procedure is received at run time as part of the response message.

  5. To see the tables in the SQL Server database, click the Tables node. Alternatively, expand the Tables node.

  6. To see the operations supported on the table, click a table name.

    The following figure shows a list of tables in the Select a category box. The Available categories and operations box lists the operations supported for a selected table.

    Browse tables in a SQL Server database
    Note
    If a SQL Server table contains columns of type varchar(max), nvarchar(max), and varbinary(max), the adapter also exposes a specific operation to update data in that column. The name of this operation is Set<column_name>. For example, if the table has a column “Job_Description” of type varchar(MAX), the name of the operation is “SetJob_Description”.

  7. To see the views in the SQL Server database, click the Views node. Alternatively, expand the Views node.

  8. To see the operations supported on the view, click a view name.

    The following figure shows a list of views in the Select a category box. The Available categories and operations box lists the operations supported for a selected view.

    Browse views in a SQL Server database
    Note
    If a view contains columns of type varchar(max), nvarchar(max), and varbinary(max), the adapter also exposes a specific operation to update data in that column. The name of this operation is Set<column_name>. For example, if the table has a column “Job_Description” of type varchar(max), the name of the operation is “SetJob_Description”.

  9. To see the list of scalar functions defined in the SQL Server database in the Available categories and operations box, click the Scalar Functions node.

    In the following figure, the Scalar Functions node is selected in the Select a category box, and the corresponding functions are listed in the Available categories and operations box.

    Browse scalar functions in SQL Server

  10. To see the list of table valued functions defined in the SQL Server database in the Available categories and operations box, click the Table Valued Functions node.

    In the following figure, the Table Valued Functions node is selected in the Select a category box, and the corresponding functions are listed in the Available categories and operations box.

    Browse table valued functions in SQL Server

To browse inbound operations on SQL Server

  1. Connect to SQL Server using the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in. See Connecting to SQL Server in Visual Studio for instructions.

  2. From the Select contract type list, for inbound operations, select Service (Inbound operations).

  3. All the inbound operations supported by the SQL adapter are available at the root node. Click the root node (/) to view the available inbound operations.

    Inbound operations supported by the adapter

Searching for Operations

You can use the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in to search for specific artifacts in the SQL Server database. When searching SQL Server metadata, the SQL adapter:

  • Supports wildcard and escape characters in the search expression.

  • Enables search immediately under the node at which the search operation is performed. For example, to search for a table, you must be searching under \Table. Multi-level search is not supported.

The following table lists the special characters that can be used for searching artifacts and their interpretation by the SQL adapter.

Special character Interpretation Example

_ (underscore)

Matches exactly one character

“A_” matches AB, AC, AD.

%

Matches zero or more characters

“A%” matches A, AB, AC.

[ ]

  • Escapes the special meaning of % and _

  • Specifies a range or set of characters to be present

  • %[%]% matches all names that include a % symbol.

  • [a-f] matches all names that have characters between (and including) ‘a’ and ‘f’.

  • [abc] matches all names that have characters ‘a’, ‘b’, and ‘c’.

[^]

Specifies a range or set of characters not to be present

  • [^a-f] matches all names that do not have characters between (and including) ‘a’ and ‘f’.

  • [^abc] matches all names that do not have characters ‘a’, ‘b’, and ‘c’.

Note
Escape character is a character that is put in front of a wildcard character to indicate that the wildcard should be interpreted as a regular character and not as a wildcard.

For more information, see How Does the Adapter Surface SQL Server Metadata?.

To search metadata in SQL Server using the Consume Adapter Service Add-in, perform the following steps.

To search metadata in SQL Server

  1. Connect to SQL Server using the Consume Adapter Service Add-in, the Add Adapter Metadata Wizard, or the Add Adapter Service Reference Plug-in. See Connecting to SQL Server in Visual Studio for instructions.

  2. From the Select contract type list, select the type of contract based on whether you are searching for inbound or outbound operations.

  3. In the Select a category box, click the category node under which you want to search for a specific artifact. For example, to search for a table, click the Tables node.

  4. In the Search in category box, type a search expression to search for a specific artifact. For example, to search for tables that have "Customer" in their name, type %Customer%.

    Note
    The search string is case-sensitive.

  5. To start the search, click the button with the right-arrow icon. After the search is complete, the Available categories and operations box lists the artifacts that satisfy the search criteria.

    The following figure shows the SQL Server tables that contain “Customer” in their name.

    Search metadata in SQL Server

Generating Schema for BizTalk Projects

You can use the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard to generate schema for selected SQL Server artifacts. Once you have browsed and searched for the artifacts you want to invoke, you can generate schema for those artifacts and send messages, conforming to the schema, to SQL Server.

Note
You can select category nodes to return all the operations in that category's sub-tree—for example, you can select an entire table (to generate schema for all the operations in the table) or a select specific operations on a table (for example, Insert and Delete) to generate schema for only those operations on a table. For more information about the nodes, see Metadata Node IDs.

To generate schema for SQL Server artifacts

  1. Connect to SQL Server using the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard. See Connecting to SQL Server in Visual Studio for instructions.

    Important
    To generate schema for performing operations using BizTalk Server you must set the EnableBizTalkCompatibilityMode binding property to True. You must set this binding property while establishing a connection to the SQL Server database.

  2. From the Select contract type list, select the type of contract based on whether you are generating schema for inbound or outbound operations.

  3. Click the category node for which you want to generate metadata. For example, if you want to generate metadata for a table, click Tables.

  4. Expand the category node, and select the specific item within that node for which you want to generate metadata. For example, to generate metadata for operations on the “CustomerTable” table, expand the Tables node, and then click CustomerTable.

  5. In the Available categories and operations box, select the operations that you want to perform on SQL Server, and then click Add. The selected operations are listed in the Added categories and operations box. For example, to perform Insert and Select operations on the “CustomerTable” table, click the operation names, and then click Add.

    The following figure shows the Consume Adapter Service Add-in, which lists the selected operations.

    Retrieve metadata from SQL Server

    If you want to generate schema for multiple operations, there may be some duplicate element definitions among these schema that may cause failure in compiling the BizTalk project. For example, consider a scenario where you generate schema for an operation “Op1”. The schema for “Op1” contains a parameter of data type “CT1”. After generating the schema for “Op1” you close the Consume Adapter Service Add-in and re-open it to generate schema for another operation “Op2”. Assume that “Op2” also contains a parameter of data type “CT1”. After you exit the Consume Adapter Service Add-in and compile the project, you will get compilation errors because the complex data type “CT1” is defined twice in different XSD files. In such situations, we recommend the following:

    • Generate schema for all the operations in a single run of Consume Adapter Service Add-in. This ensures that the Consume Adapter Service Add-in generates only one definition for the complex data type “CT1”.

    • If you want to generate schema for multiple operations across different runs of Consume Adapter Service Add-in, make sure you select the Generate unique schema types check box, so that the generated XSD files contain unique namespaces for the complex data type “CT1”.

  6. Click OK. The schema file is saved with an .xsd extension at the same location as the BizTalk project.

    Note
    If you are using the Consume Adapter Service Add-in to generate metadata for SQL Server artifacts, by default the files are created with a specific naming convention. The generated WSDL contains a fileNameHint annotation tag that includes the name that should be assigned to the XSD file. For example, a file name hint for a schema file for table operation follows the convention TableOperation.<schema>.<tablename>. If you want to customize the name of the generated XSD file, you can provide a prefix in the Filename prefix box. Finally, the name of an XSD file is arrived upon as Filename prefix + fileNameHint + unique integer (if required, to ensure that the filename is unique).

    Note
    The Consume Adapter Service Add-in also creates a binding file (an XML file) containing the binding properties that you specified when generating the schema for an operation and the SOAP action to invoke the operation. You can import this binding file in the BizTalk Server Administration console to create a WCF-Custom port or a BizTalk SQL adapter port with the connection URI, binding properties, and the SOAP action set. For more information, see Configuring a Physical Port Binding Using a Port Binding File.

    You have successfully generated metadata for SQL Server artifacts. You can use the metadata to send messages to SQL Server to perform specific operations. See Developing BizTalk Applications for more information about how to perform these operations.

Generating a WCF Client or WCF Service Contract Using the Add Adapter Service Reference Plug-in

You can use the Add Adapter Service Reference Plug-in to generate either WCF client code for outbound operations or WCF service code for the inbound operations.

To generate WCF client class or service contract for SQL Server operations

  1. In the Add Adapter Service Reference Plug-in, from the Select contract type drop-down list, select the type of contract based on whether you will be performing inbound or outbound operations.

  2. Browse or search for categories (such as a database table) or for the specific operations for which you want to generate a WCF client (or WCF service contract).
    For example, to browse for the operations in the Employee table, in the Select a category box:

    1. Expand the root node (/) to see the categories under which the operations are surfaced for a SQL Server database.

    2. Under the root node, expand the Tables node to see the available tables.

  3. Click the Employee table node, and in the Available categories and operations box, select the operations or categories for which you want to generate a WCF client (or WCF service contract), and then click Add. The selected operations are listed in the Added categories and operations box.

    The following figure shows the Add Adapter Service Reference Plug-in with the Insert and Select operations for the Employee table selected.

    Generate WCF client or service contract

    Important
    Depending on the outbound operations (or categories) that you select, more than one WCF client class may be generated. For more details, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

  4. For most scenarios the default serialization options are sufficient; however, if needed, you can control several aspects about the code that is generated and the type of serializer that is used. To set these options:

    1. Click Advanced Options to open the Advanced Options box.

    2. In the Advanced Options box under Choose options for generated proxy, select the options that you want. For example, you can select whether asynchronous methods are generated for the WCF client or disable the generation of a configuration file.

    3. Under Serializer select the serializer that should be used.

    The following figure shows the Advanced Options box with the default selections (Auto is selected for the serializer and no other options are selected).

    The Advanced Options box default settings

    The options that you can configure in the Advanced Options box are equivalent to some of the options available when you use the ServiceModel Metadata Utility Tool (svcutil.exe). For more information about these options, see "ServiceModel Metadata Utility Tool (Svcutil.exe)" at http://go.microsoft.com/fwlink/?LinkId=99821.

  5. Click OK. The Add Adapter Service Reference Plug-in saves the WCF client class (or WCF service interface) and helper code for the operations and categories that you have selected in your project directory. By default, a configuration file is also saved. Slightly different files are generated for inbound and outbound operations; for more information, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

You can select any node that is listed in the Available categories and operations box. If you select a category node then all of the operations available under that node and its sub-nodes will be selected. For example, to generate a WCF client for all of the operations surfaced for the Employee table, you can select the Employee node.

See Also

Other Resources

Retrieving Metadata for SQL Server Operations in Visual Studio


Working with BizTalk Adapter for SQL Server Binding Properties

This topic was last updated on: June 05, 2009

The Microsoft BizTalk Adapter for SQL Server surfaces several binding properties. By setting these properties, you can control some of the adapter's behavior. This section describes the binding properties exposed by the SQL adapter. It also shows how you can access them by using .NET programming or by setting properties on a BizTalk Server physical port binding.

The Adapter Binding Properties

The following table shows SQL adapter binding properties grouped by category. The category refers to the node under which each binding property appears in the dialog boxes that are presented by different applications to configure the adapter (or binding).

Binding Property Category Description .NET Type

XmlStoredProcedureRootNodeName

(FOR XML)

Specifies the name of the root node for the response schema for stored procedures that have a FOR XML clause in the SELECT statement. This root node encapsulates the XML response received from SQL Server after executing such stored procedures. You must add this root node to the response schema as described in the topic Executing Stored Procedures Having a FOR XML Clause.

Important
You must set this binding property while executing stored procedures with FOR XML clause.

string

XmlStoredProcedureRootNodeNamespace

(FOR XML)

Specifies the target namespace of the root node for the response schema for stored procedures that have a FOR XML clause in the SELECT statement.

string

CloseTimeout

(General)

The WCF connection close timeout. The default is 1 minute.

System.TimeSpan

Name

(General)

A read-only value that returns the name of the file generated by the Add Adapter Service Reference Visual Studio Plug-in to hold the WCF client class. The Add Adapter Service Reference Plug-in forms the file name by appending "Client" to the value of the Name property. The default value for this property is "SqlAdapterBinding"; for this value, the generated file will be named "SqlAdapterBindingClient".

string

OpenTimeout

(General)

Specifies the WCF connection open timeout. The default is 1 minute.

Important
The SQL adapter always uses OpenTimeout to set the connection open timeout when it opens a connection to SQL Server. The adapter ignores any timeout (System.TimeSpan) parameters passed when you open a communication object. For example, the adapter ignores any timeout parameters passed when opening a channel.

System.TimeSpan

ReceiveTimeout

(General)

Specifies the WCF message receive timeout. Essentially, this means the maximum amount of time the adapter waits for an inbound message. The default is 10 minutes.

Important
For inbound operations such as polling, we recommend setting the timeout to the maximum possible value, which is 24.20:31:23.6470000 (24 days). When using the adapter with BizTalk Server, setting the timeout to a large value does not impact the functionality of the adapter.

System.TimeSpan

SendTimeout

(General)

Specifies the WCF message send timeout. The default is 1 minute.

System.TimeSpan

EnableBizTalkCompatibilityMode

BizTalk

Indicates whether the adapter is being used with BizTalk Server or a .NET application.

  • When using the adapters from BizTalk Server (or generating metadata for operations on SQL Server using the adapter in a BizTalk project), you must always set the property to True. This ensures that the schema generated for System.Data.DataSet is in a format compatible with BizTalk Server, otherwise your BizTalk project will fail to compile.

  • When using the adapters from Visual Studio in a .NET application, you must set the property to False if you want to use the response as a DataSet. This ensures that the schema generated for System.Data.DataSet is in a format compatible with the WCF DataContractSerializer.

bool (System.Boolean)

BatchSize

Buffering

Specifies the batch size for multiple record Insert, Update, and Delete operations on a table or view in a SQL Server database. The default is 20. For values of BatchSize greater than one, the SQL adapter batches the specified number of records into a single call. A higher value may improve performance, but affects memory consumption.

int (System.Int32)

ChunkSize

Buffering

Specifies the buffer size used for Set<column_name> operations. The default is 4194304 bytes. A higher value may improve performance, but affects memory consumption.

Note
For more information about Set<column_name> operations, see Operations on Tables and Views That Contain Large Data Types.

int (System.Int32)

Encrypt

Connection

Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client. Default is false.

bool (System.Boolean)

MaxConnectionPoolSize

Connection

Specifies the maximum number of connections allowed in a connection pool for a specific connection string. The default is 100. This property is used for performance tuning.

Important
You must set MaxConnectionPoolSize judiciously. It is possible to exhaust the number of connections available, if this value is set too large.

int (System.Int32)

WorkstationId

Connection

Specifies a unique ID for the workstation (client computer) that connects to the SQL Server database using the SQL adapter. The value for this binding property, if specified, is used for the Workstation ID keyword of SqlConnection.ConnectionString property. For more information, see “SqlConnection.ConnectionString Property” at http://go.microsoft.com/fwlink/?LinkID=196958.

string

EnablePerformanceCounters

Diagnostics

Specifies whether to enable the WCF LOB Adapter SDK performance counters and the SQL adapter LOB latency performance counter. The default is False; performance counters are disabled. The LOB latency performance counter measures the total time spent by the SQL adapter in making calls to the SQL Server database.

For more information about performance counters for the SQL adapter, see Using Performance Counters.

int (System.Int32)

InboundOperationType

Inbound

Specifies whether you want to perform Polling, TypedPolling, XmlPolling, or Notification inbound operation. Default is Polling.

For more information about Polling, TypedPolling, and XmlPolling see Support for Polling. For more information about Notification, see Receiving Query Notifications.

enum

UseDatabaseNameInXsdNamespace

Metadata

Specifies whether the XSD generated for a particular artifact contains the database name. Set this to True to include the database name. Otherwise, set this to False. Default is False.

This is useful in scenarios where a single application wants to execute operations on identically named artifacts with different metadata in different databases. If there is no database name in the namespace, the generated metadata will conflict. By setting this binding property you can include the database name in the namespace, thereby making them unique. Here is an example highlighting the change in namespace.

UseDatabaseNameInXsdNamespace = False

Copy Code
http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee

UseDatabaseNameInXsdNamespace = True

Copy Code
http://schemas.microsoft.com/Sql/2008/05/TableOp/MyDatabase/dbo/Employee

Notice that the database name is included in the namespace when the binding property is set to True.

enum

AllowIdentityInsert

Miscellaneous

Specifies whether the adapter can insert values for identity columns during Insert and Update operations. Set this property to True to insert or update values for identity columns. Otherwise set this to False. Default is False.

Note
Setting this property to True translates to the adapter using “SET IDENTITY_INSERT <table_name> ON”. For more information, see http://go.microsoft.com/fwlink/?LinkId=124620.

While using this binding property, you must consider the following points:

  • The adapter does not validate the value you are passing for the identity column. For example, if a table has an identity column that has “Identity Seed” set to 100 and “Identity Increment” set to 1, and the adapter client passes a value, say 95, for the identity column, the adapter simply passes on this value to SQL Server.

  • Even if you set AllowIdentityInsert to True, it is not mandatory for an adapter client to specify a value for the identity column in the request message. If a value is present for the identity column, the adapter passes it on to SQL Server. If a value is not present, SQL Server will insert a value based on the specification for the identity column.

bool (System.Boolean)

NotificationStatement

Notification (Inbound)

Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications. Note that you must specifically specify the column names in the statement as shown in this SELECT statement.

Copy Code
SELECT Employee_ID,Designation FROM dbo.Employee WHERE Status=0
Note
You must specify the database object name along with the schema name. For example, dbo.Employee.

The adapter gets a notification message from SQL Server only when the result set for the specified SQL statement changes.

string

NotifyOnListenerStart

Notification (Inbound)

Specifies whether the adapter sends a notification message to the adapter clients, informing that the receive location is running, when the listener starts. Default is True.

The notification message you receive looks like the following:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>ListenerStarted</Info>
  <Source>SqlBinding</Source>
  <Type>Startup</Type>
</Notification>

bool (System.Boolean)

PolledDataAvailableStatement

Polling (Inbound)

Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database. The specified statement must return a result set consisting of rows and columns. The value in the first cell of the result set indicates whether the adapter executes the SQL statement specified for the PollingStatement binding property. If the first cell of the result contains a positive value, the adapter executed the polling statement. Following are examples of some valid statements that you can specify for this binding property:

  • If you are specifying a SELECT statement:

    Copy Code
    SELECT COUNT(*) from <table_name>
  • If you are specifying a stored procedure, your stored procedure might be defined as:

    Copy Code
    CREATE PROCEDURE <procedure_name>
AS
BEGIN
     SELECT COUNT(*) FROM <table_name>
END
GO
    or

    Copy Code
    CREATE PROCEDURE <procedure_name>
AS
BEGIN
     DECLARE @count int
     SELECT @count = SELECT(*) FROM <table_name>
     SELECT @count
END
GO
    If you are using a stored procedure, you would specify the PolledDataAvailableStatement as EXEC <procedure_name>.

Important
The statement you specify for this binding property is not executed within an adapter initiated transaction, and might be called multiple times before the actual polling statement is executed (even if executing the statement indicated that there are rows available for polling).

string

PollingIntervalInSeconds

Polling (Inbound)

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter is inactive for the remaining time in the interval.

int (System.Int32)

PollingStatement

Polling (Inbound)

Specifies the SQL statement to poll a SQL Server database table. You can specify a simple SELECT statement or stored procedures for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property.

You can specify any number of SQL statements separated by a semicolon. You can use the polling statement to read or update data in a SQL Server database table. The SQL adapter executes the polling statements inside one transaction. When the adapter is used with BizTalk Server, the same transaction is used to submit messages from SQL Server to the BizTalk message box.

string

PollWhileDataFound

Polling (Inbound)

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

Consider a scenario where the polling interval is set to 60 seconds, and the statement specified for PolledDataAvailableStatement returns that data is available for polling. The adapter then executes the statement specified for the PollingStatement binding property. Assuming that the adapter takes just 10 seconds to execute the polling statement, it will now have to wait for 50 seconds before executing the PolledDataAvailableStatement again, and then subsequently execute the polling statement. Instead, to optimize the performance you can set the PollWhileDataFound binding property to true so that the adapter can start executing the next polling cycle as soon as the previous polling cycle ends.

bool (System.Boolean)

UseAmbientTransaction

Transaction

Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller. Default is true, which means that the adapter always performs the operations in a transactional context. If there are other resources participating in the transaction, and SQL Server also joins the transaction, the transaction gets elevated to an MSDTC transaction.

However, there can be scenarios where you do not want the adapter to perform operations in a transactional context. For example:

  • While performing a simple Select operation on a SQL Server database

  • While specifying a polling statement that performs a Select operation, and does not involve any changes to the table either through a Delete statement or by invoking a stored procedure.

Both these operations do not make any updates to the database table and, hence, elevating these operations to use an MSDTC transaction can be a performance overhead. In such scenarios, you can set the binding property to false so that the SQL adapter does not perform the operations in a transactional context.

Note
Not performing operations in a transactional context is advisable only for operations that do not make changes to the database. For operations that update data in the database, we recommend setting the binding property to true; otherwise you might either experience message loss or duplicate messages, depending on whether you are performing inbound or outbound operations.

bool (System.Boolean)

How Do I Set SQL Server Binding Properties?

You can set the SQL Server binding properties when you specify a connection to SQL Server. For information about how to set binding properties when you:

  • Use the Consume Adapter Service BizTalk Project Add-in or the Add Adapter Service Reference Visual Studio Plug-in, see Connecting to SQL Server in Visual Studio.

    Important
    While using the Consume Adapter Service Add-in or the Add Adapter Service Reference Plug-in, if you do not specify a value for a binding property of type string and whose default value is null then that binding property will not be available in the binding file (an XML file) or the app.config file respectively. You must manually add the binding property and its value in the binding file or the app.config file, if required.

  • Configure a send port or receive port (location) in a BizTalk Server solution, see Manually Configuring a Physical Port Binding to the SQL Adapter.

  • Use the WCF channel model in a programming solution, see Creating a Channel.

  • Use the WCF service model in a programming solution, see Specifying a Client Binding for the SQL Adapter.

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Before Developing Applications Using the SQL Adapter

This section provides information about what you must do before developing applications using the SQL adapter.

In This Section

  • Configure MSDTC on SQL Server and Adapter Client


Configure MSDTC on SQL Server and Adapter Client

The operations performed on SQL Server using the SQL adapter (through BizTalk Server, the WCF service model, or the WCF channel model) can be performed within a transaction scope. If the client program has more than one transactional resource as part of the same transaction, the transaction gets elevated to an MSDTC transaction. To enable the adapter to perform operations within the scope of an MSDTC transaction, you must configure MSDTC both on the computer running the SQL adapter and SQL Server. Also, you must add MSDTC to the exceptions list of Windows Firewall. This section provides information about how to perform these tasks on computers running the adapter client and SQL Server.

Note
Performing operations on SQL Server using BizTalk Server always involves two resources—the adapter connecting to SQL Server and the BizTalk Message Box residing on SQL Server. Hence, all operations performed using BizTalk Server are performed within the scope of an MSDTC transaction. So, to use the SQL adapter with BizTalk Server, you must always enable MSDTC.

Note
For operations where the adapter client does not write any data to the SQL Server database, such as a Select operation, you might not want the additional overhead of performing the operations inside a transaction. In such cases, you can configure the SQL adapter to perform operations without a transactional context by setting the UseAmbientTransaction binding property to false. For more information about the binding property, see Working with BizTalk Adapter for SQL Server Binding Properties. In such cases, you do not need to configure MSDTC as well.

Configuring MSDTC

  • To configure MSDTC on computers running Windows Vista or Windows Server 2008, refer to http://go.microsoft.com/fwlink/?LinkId=139016.

Enabling Firewall Exceptions for MSDTC

  • To enable firewall exceptions for MSDTC on computers running Windows Vista or Windows Server 2008, refer to http://go.microsoft.com/fwlink/?LinkId=138685.

See Also

Other Resources

Before Developing Applications Using the SQL Adapter


Developing BizTalk Applications

Developing BizTalk applications involves creating a BizTalk project in Visual Studio and using the Consume Adapter Service BizTalk Project Add-in or Add Adapter Metadata Wizard to generate XML schema. Once you have generated the schema, you can either use Content-Based Routing (CBR) or create BizTalk orchestrations to send and receive messages that conform to the generated schema.

CBR can be used in scenarios where the messages being sent to SQL Server do not require any intensive processing. For example, if you know that the receive port will receive messages only of a certain type, you can add a filter to the send port to route messages that match the filter expression to the send port.

In BizTalk orchestrations, you create send and receive ports to send and receive messages to and from the WCF-Custom adapter, which in turn sends the messages to BizTalk Server. This section provides information about using BizTalk orchestrations to perform operations on SQL Server using the SQL adapter. The SQL adapter in turn uses the WCF-Custom adapter, which can interact with a WCF binding.

Important
To use the SQL adapter with Microsoft BizTalk Server, you must always set the EnableBizTalkCompatibilityMode binding property to True. For information about how to set binding properties, see Specifying Binding Properties.

In This Section

  • Before You Develop BizTalk Applications

  • Building Blocks for Developing BizTalk Applications

  • Performing Basic Insert, Update, Delete, and Select Operations by Using BizTalk Server

  • Performing Operations on Tables and Views with Large Data Types by Using BizTalk Server

  • Executing Stored Procedures in SQL Server by Using BizTalk Server

  • Executing Stored Procedures With a Single XML Parameter

  • Executing Stored Procedures Having a FOR XML Clause

  • Performing Composite Operations on SQL Server by Using BizTalk Server

  • Invoking Scalar Functions in SQL Server by Using BizTalk Server

  • Invoking Table-Valued Functions in SQL Server by Using BizTalk Server

  • Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using BizTalk Server

  • Polling SQL Server by Using the SQL Adapter with BizTalk Server

  • Receiving Query Notifications by Using BizTalk Server

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Before You Develop BizTalk Applications

This section provides information about what you must do before developing BizTalk applications using the SQL adapter. This section also points you to the BizTalk Server tools that are used to develop BizTalk applications.

In This Section

  • Create a Strong-Name Key File

  • Learn About BizTalk Server Tools


Create a Strong-Name Key File

You must create a strong-name key file to build projects in Microsoft Visual Studio. A strong name consists of the project's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. The strong-name key file contains the public key and the private key.

Important
Creating a strong-name key file is a one-time task. You can use the same key for all the BizTalk applications you develop.

Prerequisites

You must have Microsoft Visual Studio installed on the computer where you want to create a strong-name key.

To create a strong-name key file

  1. Start Visual Studio Command Prompt (2012).

  2. At the command prompt, navigate to the location where you want to create the key file. For example, type cd C:\Sample, and then press ENTER.

  3. At the command prompt, type sn -k <key file name>.snk, and then press ENTER.

    Note
    You should receive a message at the command prompt stating that the key pair was written to the strong-name key file.

  4. At the command prompt, type exit, and then press ENTER.

See Also

Concepts

Learn About BizTalk Server Tools

Other Resources

Before You Develop BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Learn About BizTalk Server Tools

The topics on how to use the SQL adapter in Developing BizTalk Applications are written with the assumption that you have working knowledge of a number of BizTalk Server tools. You will use the following tools to develop BizTalk applications using the SQL adapter:

  • Microsoft Visual Studio 2012

  • Orchestration Designer

  • Pipeline Designer

  • BizTalk Mapper

  • BizTalk Server Administration console

Prerequisites

You must install Microsoft BizTalk Server before you can access the BizTalk Server tools.

BizTalk Server Tools

The following table includes topics in the BizTalk Server documentation that explain how to use each of the listed tools.

Tool Topics in BizTalk Server Documentation

Visual Studio

  • Using Visual Studio (http://go.microsoft.com/fwlink/?LinkId=107180)

  • Working with BizTalk Projects (http://go.microsoft.com/fwlink/?LinkId=107181)

  • Deploying BizTalk Assemblies from Visual Studio into a BizTalk Application (http://go.microsoft.com/fwlink/?LinkId=107182)

Learn more about Visual Studio:

  • Introduction to Solutions, Projects, and Items (http://go.microsoft.com/fwlink/?LinkId=196962)

  • Solution Explorer Concepts (http://go.microsoft.com/fwlink/?LinkId=196963)

Orchestration Designer

  • Creating Orchestrations Using Orchestration Designer (http://go.microsoft.com/fwlink/?LinkId=107184)

Pipeline Designer

  • Creating Pipelines Using Pipeline Designer (http://go.microsoft.com/fwlink/?LinkId=107185)

BizTalk Mapper

  • Creating Maps Using BizTalk Mapper (http://go.microsoft.com/fwlink/?LinkId=107186)

BizTalk Server Administration console

  • Using the BizTalk Server Administration Console (http://go.microsoft.com/fwlink/?LinkId=107187)

See Also

Tasks

Create a Strong-Name Key File

Other Resources

Before You Develop BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Building Blocks for Developing BizTalk Applications

To perform operations on SQL Server by using the SQL adapter with BizTalk Server, you must perform a set of design-time and run-time tasks using Visual Studio and BizTalk Server Administration console respectively. This section provides an overview of these tasks. All the topics in this section, which demonstrate how to perform specific operations on SQL Server using BizTalk Server, are modeled on these high-level tasks.

Using Visual Studio

  1. Create BizTalk project, and generate schema. You must create a BizTalk project in Visual Studio, and generate schema for the operation that you will perform on SQL Server. For example, if you want to insert records in a SQL Server table, you must generate schema for the Insert operation for that table. To generate schema, you must use the Consume Adapter Service Add-in or Add Adapter Metadata Wizard. For more information, see Retrieving Metadata for SQL Server Operations in Visual Studio.

  2. Set up an orchestration. Once you have generated the schema, you must set up an orchestration by using the Orchestration Designer. For a basic orchestration, you add the Send and Receive shapes along with the Send and Receive logical ports. In later steps, you map these logical ports to physical ports by using the BizTalk Server Administration console. The orchestration uses these ports to pick messages that an adapter client sends. The orchestration then passes the messages to SQL Server. Once SQL Server sends a response, the orchestration passes the response back to the adapter client.

  3. Create messages, and link to schema. In your orchestration, you must create messages that will be mapped to the schema you generated in the first step. Typically, you create a request message and a response message. These messages are mapped to the corresponding request and response schemas.

  4. Map message shapes to messages and ports. In your orchestration, you must now map each shape that you added in the second step to messages that you created in the third step. You must also map a message shape to the port on which that message will be sent.

    For example, if the first shape in your orchestration is a Receive shape that will receive a message, you map this shape to a request message and the port that sends the request message.

  5. Build and deploy the BizTalk project. After you have set up the orchestration and mapped messages, ports, and schemas, you must build the BizTalk solution. For building a project in Visual Studio, you need an assembly key file. After you successfully build the solution, you must deploy the solution.

Note
More detailed description of these high-level tasks, including procedural information, is provided in various topics of this section.

Once you have successfully built and deployed the BizTalk project, your tasks in Visual Studio are accomplished. You must now perform certain tasks using the BizTalk Server Administration console.

Using the BizTalk Server Administration Console

  1. Configure the application. The BizTalk project you deployed by using Visual Studio shows up in the BizTalk Server Administration console as an orchestration. You must configure this orchestration by mapping the logical ports you created in Visual Studio to physical ports that you must now create using the BizTalk Server Administration console.

    On the physical ports, you must specify an "action" or "action mapping". This action corresponds to the operation you want to perform on SQL Server. You need to specify the action if you are not using dynamic actions. For more information about actions, see Specifying SOAP Action.

  2. Start the application. After the application is configured, you must start the application, and drop request messages at a defined file location. The orchestration consumes the request messages, passes them to SQL Server, and receives a response. This response is available to the adapter client at another defined file location.

To accomplish these high-level tasks, you must also perform other tasks. For example, when you use the Consume Adapter Service Add-in or Add Adapter Metadata Wizard to generate the schema, you must specify a connection URI to connect to SQL Server. This section provides information on such repetitive tasks that you must perform as you develop BizTalk applications using the SQL adapter.

In This Section

  • Adding the SQL Adapter to BizTalk Server Administration Console

  • Specifying the Connection URI

  • Specifying Credentials for SQL Server

  • Specifying Binding Properties

  • Specifying SOAP Action

  • Manually Configuring a Physical Port Binding to the SQL Adapter

  • Configuring a Physical Port Binding Using a Port Binding File

  • Configuring Dynamic Ports

  • Reusing Adapter Bindings

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Adding the SQL Adapter to BizTalk Server Administration Console

The SQL adapter can be used in BizTalk either as a WCF-Custom port or a WCF-SQL port. If you want to use the SQL adapter through a WCF-Custom port, you do not need to add the WCF-Custom port to the BizTalk Server Administration console because the WCF-Custom port is added to the BizTalk Server Administration console by default. However, if you want to use the SQL adapter through a WCF-SQL port, you must first add the WCF-SQL adapter to the BizTalk Server Administration console.

This topic provides instructions on how to add the WCF-SQL adapter to the BizTalk Server Administration console.

Important
You need not perform these tasks if you want to configure a WCF-Custom port for the SQL adapter.

To add the SQL Adapter

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand the BizTalk Group, expand Platform Settings, and then click Adapters.

  3. Right-click Adapters, point to New, and click Adapter.

    Add an adapter

  4. In the Adapter Properties dialog box, specify a name for the adapter and from the Adapter list, select WCF-SQL.

    Add WCF-SQL adapter to BizTalk

  5. Click OK.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Specifying the Connection URI

A connection URI is a connection string that contains parameters required to connect to SQL Server. While using the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard in Visual Studio, you must specify the URI to connect to SQL Server to generate the metadata. While configuring a send or receive port using the BizTalk Server Administration console, you must specify the URI to connect to SQL Server to perform operations.

Specifying the Connection URI from Visual Studio

From Visual Studio, you can specify the connection URI using the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard.

To specify the connection URI using Consume Adapter Service Add-in

  1. Right-click your BizTalk project, point to Add, and then click Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Consume Adapter Service.

    Templates

    Click Consume Adapter Service.

  3. To start the Consume Adapter Service dialog box, click Add.

  4. In the Consume Adapter Service dialog box, from the Select a binding list, select sqlBinding, and then click Configure.

  5. In the Configure Adapter dialog box, click the Security tab. From the Client credential type list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  6. Click the URI Properties tab, and specify values for different parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

  7. Click the Binding Properties tab, and specify values for the binding properties, if any, which are required before generating the schema. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

  8. Click OK.

To specify the connection URI using Add Adapter Metadata Wizard

  1. Right-click the BizTalk project, point to Add, and then click Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Add Adapter.

    Templates

    Click Add Adapter Metadata.

  3. Click Add. The Add Adapter Metadata Wizard opens.

  4. In the Add Adapter Wizard, select WCF-SQL. Select the computer on which BizTalk Server is installed and the name of the BizTalk database.

    Important
    If you already have a WCF-SQL port configured in BizTalk, select the port from the Port list.

  5. Click Next.

  6. In the Consume Adapter Service dialog box, from the Select a binding drop-down list, select sqlBinding, and then click Configure.

  7. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list box, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  8. Click the URI Properties tab, and then specify values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

  9. Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

    Note
    If you selected an existing WCF-SQL send port, you need not specify the binding properties. The binding properties are picked from the send port configuration. However, you may choose to specify the binding properties that are required at design-time, if any. In such case, the new values for binding properties will be used at design-time while generating the metadata. However, at run-time the values specified for binding properties in the send port configuration will be applicable.

  10. Click OK.

Specifying the Connection URI from the BizTalk Server Administration Console

From the BizTalk Server Administration console, you can specify the connection URI as part of the WCF-Custom or a WCF-SQL port configuration.

To specify the connection URI for the WCF-Custom port

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  3. In the port properties dialog box, from the Type drop-down list, select WCF-Custom, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  4. In the WCF-Custom Transport Properties dialog box, click the General tab.

  5. In the Address (URI) text box, specify the connection URI to connect to SQL Server. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

  6. In the WCF-Custom Transport Properties dialog box, click the Binding tab. From the Binding Type drop-down list, select sqlBinding.

  7. If you are creating a send port, in the WCF-Custom Transport Properties dialog box, click the Credentials tab, and do one of the following:

    • Select the Do not use Single Sign-On option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Use Single Sign-On option, and specify an affiliate Enterprise Single Sign-on (SSO) application.

  8. If you are creating a receive port, in the WCF-Custom Transport Properties dialog box, click the Other tab, and do one of the following:

    • Select User account option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select Get credentials from affiliate application option, and specify an affiliate SSO application.

  9. Click OK.

To specify the connection URI for the WCF-SQL port

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  4. In the port properties dialog box, from the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  5. In the transport properties dialog box, click the General tab.

  6. Click the Configure button and provide values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

  7. In the transport properties dialog box, click the Binding tab and specify values for binding properties.

    Note
    The binding properties are displayed based on whether you are configuring a send port or a receive port. For example, binding properties related to notifications are not available while configuring a send port because notifications are inbound operations and require a receive port configuration.

  8. If you are creating a send port, in the transport properties dialog box, click the Credentials tab, and do one of the following:

    • Select the Do not use Single Sign-On option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Use Single Sign-On option, and specify an affiliate Enterprise Single Sign-on (SSO) application.

  9. If you are creating a receive port, in the transport properties dialog box, click the Other tab, and do one of the following:

    • Select User account option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select Get credentials from affiliate application option, and specify an affiliate SSO application.

  10. Click OK.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Specifying Credentials for SQL Server

The SQL adapter requires the adapter clients to provide client credentials. The adapter uses these credentials to authenticate the user with SQL Server and to establish a connection.

Adapter clients can provide the client credentials both when using Visual Studio and when using the BizTalk Server Administration console. When using Visual Studio, credentials are required to generate the metadata. When using the BizTalk Server Administration console, credentials are required to perform operations on SQL Server.

This section provides information about specifying client credentials in Visual Studio and the BizTalk Server Administration console.

Specifying Credentials from Visual Studio

From Visual Studio, you can specify the credentials using the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard.

To specify credentials using Consume Adapter Service Add-in

  1. Right-click your BizTalk project, point to Add, and then select Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Consume Adapter Service.

    Templates

    Click Consume Adapter Service.

  3. To start the Consume Adapter Service dialog box, click Add.

  4. In the Consume Adapter Service dialog box, from the Select a binding list, select sqlBinding, and then click Configure.

  5. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  6. Click OK.

To specify credentials using Add Adapter Metadata Wizard

  1. Right-click your BizTalk project, point to Add, and then select Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Add Adapter.

    Templates

    Click Add Adapter Metadata.

  3. Click Add. The Add Adapter Metadata Wizard opens.

  4. In the Add Adapter Wizard, select WCF-SQL. Select the computer on which BizTalk Server is installed and the name of the BizTalk database.

    Important
    If you already have a WCF-SQL port configured in BizTalk, select the port from the Port list.

  5. Click Next.

  6. In the Consume Adapter Service dialog box, from the Select a binding list, select sqlBinding, and then click Configure.

  7. In the Configure Adapter dialog box, click the Security tab, and from the Client credential type list, do one of the following:

    Note
    If you are connecting to SQL Server using Windows Authentication, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    Click this To do this

    None

    Connect to SQL Server by using Windows authentication.

    Windows

    Connect to SQL Server by using Windows authentication.

    Username

    Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive.

    Note
    If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.

  8. Click OK.

Specifying Credentials from the BizTalk Server Administration Console

From the BizTalk Server Administration console, you can specify the credentials as part of the WCF-Custom or WCF-SQL port configuration.

To specify credentials for the WCF-Custom port

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  3. In the port properties dialog box, from the Type drop-down list, select WCF-Custom, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  4. If you are creating a send port, in the WCF-Custom Transport Properties dialog box, click the Credentials tab, and do one of the following:

    • Select the Do not use Single Sign-On option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Use Single Sign-On option, and specify an affiliate Enterprise Single Sign-on (SSO) application.

  5. If you are creating a receive port, in the WCF-Custom Transport Properties dialog box, click the Other tab, and do one of the following:

    • Select the User account option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Get credentials from affiliate application option, and specify an affiliate SSO application.

  6. Click OK.

To specify credentials for the WCF-SQL port

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  4. In the port properties dialog box, from the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  5. If you are creating a send port, in the transport properties dialog box, click the Credentials tab, and do one of the following:

    • Select the Do not use Single Sign-On option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Use Single Sign-On option, and specify an affiliate Enterprise Single Sign-on (SSO) application.

  6. If you are creating a receive port, in the transport properties dialog box, click the Other tab, and do one of the following:

    • Select the User account option, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

      Note
      If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

    • Select the Get credentials from affiliate application option, and specify an affiliate SSO application.

  7. Click OK.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Specifying Binding Properties

The SQL adapter surfaces several binding properties that enable you to control some of its behavioral characteristics. This section provides information about setting the binding properties from Visual Studio and from the BizTalk Server Administration console. From Visual Studio, you must specify the binding properties to generate schema for specific operations. From BizTalk Server, you must specify the binding properties as part of the send or receive port for sending or receiving messages from SQL Server.

For information about the binding properties, including a list of binding properties for the SQL adapter, see Working with BizTalk Adapter for SQL Server Binding Properties.

Specifying Binding Properties from Visual Studio

From Visual Studio, you can specify the binding properties using the Consume Adapter Service Add-in or the Add Adapter Metadata Wizard.

To specify binding properties using Consume Adapter Service Add-in

  1. Right-click your BizTalk project, and then select Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Consume Adapter Service.

    Templates

    Click Consume Adapter Service.

  3. To start the Consume Adapter Service dialog box, click Add.

  4. In the Consume Adapter Service dialog box, from the Select a binding drop-down list, select sqlBinding, and then click Configure.

  5. In the Configure Adapter dialog box, click the Binding Properties tab, and then specify the different binding properties.

  6. Click OK.

To specify the binding properties using Add Adapter Metadata Wizard

  1. Right-click the BizTalk project, point to Add, and then click Add Generated Items.

  2. In the Add Generated Items dialog box, do the following:

    Use this To do this

    Categories

    Click Add Adapter.

    Templates

    Click Add Adapter Metadata.

  3. Click Add. The Add Adapter Metadata Wizard opens.

  4. In the Add Adapter Wizard, select WCF-SQL. Select the computer on which BizTalk Server is installed and the name of the BizTalk database.

    Important
    If you already have a WCF-SQL port configured in BizTalk, select the port from the Port list.

  5. Click Next.

  6. In the Consume Adapter Service dialog box, from the Select a binding drop-down list, select sqlBinding, and then click Configure.

  7. Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

    Note
    If you selected an existing WCF-SQL send port, you need not specify the binding properties. The binding properties are picked from the send port configuration. However, you may choose to specify the binding properties that are required at design-time, if any. In such case, the new values for binding properties will be used at design-time while generating the metadata. However, at run-time the values specified for binding properties in the send port configuration will be applicable.

  8. Click OK.

Specifying Binding Properties from the BizTalk Server Administration Console

From the BizTalk Server Administration console, you can specify the binding properties as part of the WCF-Custom or WCF-SQL port configuration.

To specify binding properties for WCF-Custom port

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  3. In the port properties dialog box, from the Type drop-down list, select WCF-Custom, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  4. In the WCF-Custom Transport Properties dialog box, click the Binding tab.

  5. From the Binding Type list, select sqlBinding.

  6. In the Configuration box, specify the values for the different binding properties, and then click OK.

To specify the binding properties for the WCF-SQL port

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, then expand Applications, and then expand the application under which you want to create a port, and click Send Ports or Receive Ports. In the right pane, you can choose to create a port or select an existing port.

  4. In the port properties dialog box, from the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

    Note
    To see the location properties dialog box for a receive port, click the Receive Location tab on the left pane of the port properties dialog box, and then click New.

  5. In the transport properties dialog box, click the Binding tab and specify values for binding properties.

    Note
    The binding properties are displayed based on whether you are configuring a send port or a receive port. For example, binding properties related to notifications are not available while configuring a send port because notifications are inbound operations and require a receive port configuration.

  6. Click OK.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Specifying SOAP Action

To perform any operation on SQL Server using the WCF-based SQL adapter, you must specify a SOAP action. The SOAP action communicates to the adapter what action should be performed. You can specify the SOAP action either from Visual Studio or from the BizTalk Server Administration console. However, if you specify the SOAP action from both locations, the action you specified from Visual Studio will be overridden.

For more information about specifying SOAP action, see http://go.microsoft.com/fwlink/?LinkId=102063.

Specifying SOAP Action from Visual Studio

From Visual Studio, you must specify the SOAP action as part of the orchestration by using an Expression shape.

To specify SOAP action from Visual Studio

  1. In the BizTalk orchestration, include an Expression shape by dragging it from the BizTalk Orchestration toolbox.

  2. Double-click the Expression shape to open BizTalk Expression Editor.

  3. Specify the action in BizTalk Expression Editor. For example:

    Copy Code
    OutboundMessage(WCF.Action)="TableOp/Insert/dbo/Employee"

    For more information about the Expression shape and BizTalk Expression Editor, see http://go.microsoft.com/fwlink/?LinkId=102064.

Specifying SOAP Action from the BizTalk Server Administration Console

From the BizTalk Server Administration console, you can specify the SOAP action as part of the WCF-Custom or WCF-SQL port configuration.

To specify a SOAP action for the WCF-Custom port

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, then expand Applications, and then click Send Ports. In the right pane, you can choose to create a port or select an existing port.

  3. In the port properties dialog box, from the Type drop-down list, select WCF-Custom, and then click Configure.

  4. In the WCF-Custom Transport Properties dialog box, click the General tab.

  5. In the Action text box, specify the SOAP action for the operation. You can specify the action in the following ways:

    • By using the single action format. Use this format if the WCF-Custom port sends and receive messages for a single operation. For example:

      Copy Code
      TableOp/Insert/dbo/Employee
    • By using the action mapping format. Use this format if a single WCF-Custom port sends and receives messages for more than one operation. For example, if a single WCF-Custom port sends and receives messages for Op1 (to insert records in the Employee table) and Op2 (to update records in the Employee table), the SOAP action can be specified in the following manner:

      Copy Code
      <BtsActionMapping>
  <Operation Name="Op1" Action="TableOp/Insert/dbo/Employee" />
  <Operation Name="Op2" Action="TableOp/Update/dbo/Employee" />
</BtsActionMapping>
      The action mapping approach provides greater flexibility in terms of specifying a set of actions, and hence enabling messages that belong to different action types to flow through the same port.

      The format for the SOAP action is different for each operation. For more information about the action format for each operation, see individual topics under Technical Reference.

To specify a SOAP action for the WCF-SQL port

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, then expand Applications, and then click Send Ports. In the right pane, you can choose to create a port or select an existing port.

  4. In the port properties dialog box, from the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

  5. In the transport properties dialog box, click the General tab.

  6. In the Action text box, specify the SOAP action for the operation. You can specify the action in the following ways:

    • By using the single action format. Use this format if the WCF-SQL port sends and receive messages for a single operation. For example:

      Copy Code
      TableOp/Insert/dbo/Employee
    • By using the action mapping format. Use this format if a single WCF-SQL port sends and receives messages for more than one operation. For example, if a single WCF-SQL port sends and receives messages for Op1 (to insert records in the Employee table) and Op2 (to update records in the Employee table), the SOAP action can be specified in the following manner:

      Copy Code
      <BtsActionMapping>
  <Operation Name="Op1" Action="TableOp/Insert/dbo/Employee" />
  <Operation Name="Op2" Action="TableOp/Update/dbo/Employee" />
</BtsActionMapping>
      The action mapping approach provides greater flexibility in terms of specifying a set of actions, and hence enabling messages that belong to different action types to flow through the same port.

      The format for the SOAP action is different for each operation. For more information about the action format for each operation, see individual topics under Technical Reference.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Manually Configuring a Physical Port Binding to the SQL Adapter

This section provides information about configuring the Microsoft BizTalk Adapter for SQL Server as a WCF custom binding or as a WCF-SQL port by using the BizTalk Server Administration console. After deploying the adapter, you will be able to send and receive messages from SQL Server by using the BizTalk Server Administration console. The steps for deploying the adapter vary depending on:

  • The direction of communication between BizTalk Server and the SQL adapter. You may choose to configure a send, receive, or a send-receive port. Your choices are summarized in the following table.

    Port direction Communication pattern Direction of communication to choose from

    Send

    One-way

    I will always be sending messages on this port.

    Receive

    One-way

    I will always be receiving messages on this port.

    Send-receive

    Request-response

    I will be sending a request and receiving a response.

    Note
    Two-way receive ports are not supported by the SQL adapter.

    For more information, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

  • Whether the adapter sends messages to the SQL Server (outbound operations) or receives messages from SQL Server (inbound operations). Depending on whether you want to send or receive messages, you will create a send or receive port, respectively.

    Note
    You can also configure the send or receive ports by importing a binding configuration file that is created by the Consume Adapter Service Add-in as part of metadata generation. For instructions on configuring ports using this binding file, see Configuring a Physical Port Binding Using a Port Binding File.

In This Section

  • Configuring a Port Using the WCF-Custom Adapter

  • Configuring a Port Using the WCF-SQL Adapter

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Configuring a Port Using the WCF-Custom Adapter

This topic provides instructions on how to configure WCF-Custom send and receive ports to perform outbound and inbound operations on SQL Server using the SQL adapter.

Prerequisites

To perform the procedures in this topic, you must be logged on with an account that is a member of the BizTalk Server Administrators or BizTalk Operators group. For more detailed information about permissions, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

Deploying Adapters for Sending Messages to SQL Server

Perform the following steps to configure a WCF-Custom send port for sending messages to SQL Server using the BizTalk Server Administration console.

To deploy adapters for sending messages to SQL Server

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, and then expand Applications.

  3. Expand the application under which you want to deploy the SQL adapter.

  4. Right-click Send Ports, point to New, and then point to the type of port you want to configure depending on the mode of communication between BizTalk Server and SQL Server.

  5. In the Send Port Properties dialog box, on the General tab, type a name for the send port.

  6. From the Type drop-down list, select WCF-Custom, and then click Configure.

  7. In the WCF-Custom Transport Properties dialog box, do the following:

    1. Click the General tab, and in the Address (URI) field, specify the connection URI for SQL Server. For more information about the connection URI, see SQL Server Connection URI.

    2. On the General tab, in the Action text box, type the action for the operation. See individual topics in Technical Reference for a list of actions for each operation. For example, the action to invoke the Insert operation on a table in a SQL Server database is:

      Copy Code
      TableOp/Insert/dbo/Employee
      Note
      Employee is the name of a table in SQL Server database.

    3. Click the Binding tab, and from the Binding Type list, select sqlBinding. You can specify the different binding properties exposed by the SQL adapter. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

    4. Click the Credentials tab, and then do one of the following:

      • Select the Do not use Single Sign-On option, and the specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

        Note
        If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

      • Select the Use Single Sign-On option, and then specify an affiliate Enterprise Single Sign-on (SSO) application.

        For more information about security with respect to BizTalk Server, see Security Considerations When Using the Adapter with BizTalk Server.

    5. To return to the Send Port Properties dialog box, click OK.

  8. From the Send handler list, select BizTalkServerApplication.

  9. If you chose Static One-Way Send Port in step 4, specify a send pipeline. From the Send pipeline list, select the pipeline that corresponds to XMLTransmit.

  10. If you chose Static Solicit-Response Port in step 4, specify send and receive pipelines.

    1. From the Send pipeline drop-down list, select the pipeline that corresponds to XMLTransmit.

    2. From the Receive pipeline drop-down list, select the pipeline that corresponds to XMLReceive.

  11. Click OK.

Deploying Adapters for Receiving Messages from SQL Server

Perform the following steps to configure a WCF-Custom receive port for receiving messages from SQL Server using the BizTalk Server Administration console.

To deploy adapters for receiving messages from SQL Server

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, and then expand Applications.

  3. Expand the application under which you want to deploy the SQL adapter.

  4. Right-click Receive Ports, point to New, and click One-way Receive Port or Request Response Receive Port, depending on the mode of communication between BizTalk Server and SQL Server.

  5. In the Receive Port Properties dialog box, on the General tab, type a name for the receive port.

  6. On the Receive Locations tab, click New. The Receive Location Properties dialog box appears.

  7. In the Receive Location Properties dialog box, do the following:

    1. Specify a name for the receive location.

    2. From the Type drop-down list, select WCF-Custom, and then click Configure.

  8. In the WCF-Custom Transport Properties dialog box, do the following:

    1. Click the General tab, and in the Address (URI) field, specify the connection URI for SQL Server. For more information about the connection URI, see SQL Server Connection URI.

    2. Click the Binding tab, and from the Binding Type drop-down list, select sqlBinding. You can specify the different binding properties exposed by the SQL adapter. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

    3. Click the Behavior tab to set the transaction isolation level. For more information about setting transaction isolation level, see Configure Transaction Isolation Level and Transaction Timeout.

    4. Click the Other tab, and do one of the following:

      • Select User account, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

        Note
        If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

      • Select Get credentials from affiliate application option, and specify an affiliate SSO application.

        For more information about security with respect to BizTalk Server, see Security Considerations When Using the Adapter with BizTalk Server.

    5. To return to the Receive Location Properties dialog box, click OK.

  9. From the Receive handler drop-down list, select BizTalkServerApplication.

  10. If you chose One-way Receive Port in step 4, specify a receive pipeline. From the Receive pipeline list, select the pipeline corresponding to XMLReceive.

  11. If you chose Request Response Receive Port in step 4, specify send and receive pipelines.

    1. From the Receive pipeline drop-down list, select the pipeline that corresponds to XMLReceive.

    2. From the Send pipeline drop-down list, select the pipeline that corresponds to XMLTransmit.

  12. In the Receive Location Properties dialog box, click OK.

  13. In the Receive Port Properties dialog box, click OK.

See Also

Other Resources

Manually Configuring a Physical Port Binding to the SQL Adapter


Configuring a Port Using the WCF-SQL Adapter

This topic provides instructions on how to configure WCF-SQL send and receive ports to perform outbound and inbound operations on SQL Server using the SQL adapter.

Prerequisites

To perform the procedures in this topic, you must be logged on with an account that is a member of the BizTalk Server Administrators or BizTalk Operators group. For more detailed information about permissions, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

Deploying Adapters for Sending Messages to SQL Server

Perform the following steps to configure a WCF-SQL send port for sending messages to SQL Server using the BizTalk Server Administration console.

To deploy adapters for sending messages to SQL Server

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, and then expand Applications.

  4. Expand the application under which you want to deploy the SQL adapter.

  5. Right-click Send Ports, point to New, and then point to the type of port you want to configure depending on the mode of communication between BizTalk Server and SQL Server.

  6. In the Send Port Properties dialog box, on the General tab, type a name for the send port.

  7. From the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

  8. In the transport properties dialog box, do the following:

    1. Click the General tab, click the Configure button, and provide values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

    2. On the General tab, in the Action text box, type the action for the operation. See individual topics in Technical Reference for a list of actions for each operation. For example, the action to invoke the Insert operation on a table in a SQL Server database is:

      Copy Code
      TableOp/Insert/dbo/Employee
      Note
      Employee is the name of a table in SQL Server database.

    3. Click the Binding tab and specify values for binding properties exposed by the SQL adapter. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      The binding properties are displayed based on whether you are configuring a send port or a receive port. For example, binding properties related to notifications are not available while configuring a send port because notifications are inbound operations and require a receive port configuration.

    4. Click the Credentials tab, and then do one of the following:

      • Select the Do not use Single Sign-On option, and the specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

        Note
        If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

      • Select the Use Single Sign-On option, and then specify an affiliate Enterprise Single Sign-on (SSO) application.

        For more information about security with respect to BizTalk Server, see Security Considerations When Using the Adapter with BizTalk Server.

    5. To return to the Send Port Properties dialog box, click OK.

  9. From the Send handler list, select BizTalkServerApplication.

  10. If you chose to create Static One-Way Send Port in step 5, specify a send pipeline. From the Send pipeline list, select the pipeline that corresponds to XMLTransmit.

  11. If you chose to create Static Solicit-Response Port in step 5, specify send and receive pipelines.

    1. From the Send pipeline drop-down list, select the pipeline that corresponds to XMLTransmit.

    2. From the Receive pipeline drop-down list, select the pipeline that corresponds to XMLReceive.

  12. Click OK.

Deploying Adapters for Receiving Messages from SQL Server

Perform the following steps to configure a WCF-SQL receive port for receiving messages from SQL Server using the BizTalk Server Administration console.

To deploy adapters for receiving messages from SQL Server

  1. Start the BizTalk Server Administration console.

  2. Add the WCF-SQL adapter to the BizTalk Server Administration console. For instructions, see Adding the SQL Adapter to BizTalk Server Administration Console.

  3. In the console tree, expand BizTalk Group, and then expand Applications.

  4. Expand the application under which you want to deploy the SQL adapter.

  5. Right-click Receive Ports, point to New, and click One-way Receive Port or Request Response Receive Port, depending on the mode of communication between BizTalk Server and SQL Server.

  6. In the Receive Port Properties dialog box, on the General tab, type a name for the receive port.

  7. On the Receive Locations tab, click New. The Receive Location Properties dialog box appears.

  8. In the Receive Location Properties dialog box, do the following:

    1. Specify a name for the receive location.

    2. From the Type drop-down list, select the WCF-SQL adapter you added earlier, and then click Configure.

  9. In the transport properties dialog box, do the following:

    1. Click the General tab, click the Configure button, and provide values for the connection parameters. For more information about the connection URI for the SQL adapter, see SQL Server Connection URI.

    2. Click the Binding tab and specify values for binding properties exposed by the SQL adapter. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      The binding properties are displayed based on whether you are configuring a send port or a receive port. For example, binding properties related to notifications are not available while configuring a send port because notifications are inbound operations and require a receive port configuration.

    3. Click the Behavior tab to set the transaction isolation level. For more information about setting transaction isolation level, see Configure Transaction Isolation Level and Transaction Timeout.

    4. Click the Other tab, and do one of the following:

      • Select User account, and specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

        Note
        If you want to connect to SQL Server using Windows authentication, specify a blank user name and password. Before you do this, the Windows user with which you are logged in must be added to SQL Server as described in Connecting to SQL Server Using Windows Authentication.

      • Select Get credentials from affiliate application option, and specify an affiliate SSO application.

        For more information about security with respect to BizTalk Server, see Security Considerations When Using the Adapter with BizTalk Server.

    5. To return to the Receive Location Properties dialog box, click OK.

  10. From the Receive handler drop-down list, select BizTalkServerApplication.

  11. If you chose to create One-way Receive Port in step 5, specify a receive pipeline. From the Receive pipeline list, select the pipeline corresponding to XMLReceive.

  12. If you chose to create Request Response Receive Port in step 5, specify send and receive pipelines.

    1. From the Receive pipeline drop-down list, select the pipeline that corresponds to XMLReceive.

    2. From the Send pipeline drop-down list, select the pipeline that corresponds to XMLTransmit.

  13. In the Receive Location Properties dialog box, click OK.

  14. In the Receive Port Properties dialog box, click OK.

See Also

Other Resources

Manually Configuring a Physical Port Binding to the SQL Adapter


Configuring a Physical Port Binding Using a Port Binding File

When you use the Consume Adapter Service BizTalk Project Add-in to generate metadata for a SQL Server artifact, other than the schema files, the Consume Adapter Service Add-in also generates a port binding file. You can import this binding file into your BizTalk application to create a physical send or receive port. For instructions on importing binding files, see Importing Bindings. If you import this binding file, you do not have to manually create a physical send or receive port.

Important
While using the Consume Adapter Service Add-in, if you do not specify a value for a binding property of type string and whose default value is null then that binding property will not be available in the binding file. You must manually add the binding property and its value in the binding file, if required.

Creating a port using the port binding file always creates a two-way send port or a one-way receive port. If you want to create a one-way send port, you can create it manually by following the procedure mentioned in Manually Configuring a Physical Port Binding to the SQL Adapter. Or, you can follow the workarounds documented in this topic to modify the port binding file to create one-way send ports.

Note
For inbound operations, the port binding file will always create a one-way receive port. This is because the SQL adapter only supports one-way receive port for inbound operations.

Important
Using the Add Adapter Metadata Wizard does not create a port binding file using which you can create a WCF-SQL port. However, you could make some changes to the port binding file generated by the Consume Adapter Service Add-in and use it to create a WCF-SQL port. For more information, see Configuring a WCF-SQL Port Using the Port Binding File Generated Using Consume Adapter Service Add-in.

Following are some key points that you must understand with respect to the binding file that the Consume Adapter Service Add-in generates:

  • The files are created with a specific naming convention. If you generated metadata for outbound operations, that is, to send messages to SQL Server, the name of the file is WcfSendPort_SqlAdapterBinding_Custom.bindinginfo.xml.

    If you generated metadata for inbound operations, that is, to receive messages from SQL Server, the name of the file is WcfReceivePort_SqlAdapterBinding_Custom.bindinginfo.xml.

  • The file contains information about the binding configuration, the binding type, the endpoint URI, and the port action based on the operations for which metadata was generated. When you import this binding file into your BizTalk application to create a port, all the relevant information required to configure a physical port is automatically set on the port.

    Important
    By default, the action on the send port is mapped to the operation name for which you generated metadata. For example, if you generate metadata for the Insert operation on the Customer table, the action on the port is set to <Operation Name="Insert" Action="TableOp/Insert/dbo/CustomerTable" />. However, the operation name on the logical send port you create in the BizTalk orchestration might not be the same. You must ensure that the operation name in the logical send port (in the BizTalk orchestration) and the physical send port (in BizTalk Server Administration console) are the same. If not, you will receive an error while sending messages to SQL Server through the send port.

  • You only need to provide the credentials for the port to connect to SQL Server. Although the binding file does retain the user name with which to connect, for security reasons the binding file does not contain the password.

Key Considerations for Using the Port Binding File

  • When you import the binding file, you might get a dialog message informing that the BizTalk application name in the binding file does not match the application name to which you are importing the binding file. You can safely ignore this message and continue.

  • The binding file also contains names of ports and receive locations. If the BizTalk application to which you are importing the binding file creates a port or a receive location that has the same name as an already existing port in the same BizTalk application, you will get an error. You must manually edit the binding file to specify a unique name for the ports or receive locations.

  • The binding file also contains information about the connection URI. If the binding file creates a receive location that has the same receive URI as an already existing receive location in the same BizTalk application, you will get an error. You must manually edit the binding file to specify a unique URI.

  • By default, the port binding file for outbound operations always contains definitions for a two-way send port. When you import this file in a BizTalk application, it creates a two-way send port. However, you may have an orchestration that has a one-way send port. So, when you configure such an orchestration and use the port created by importing the binding file, the port is not available in the list. This happens because the logical port you created as part of the orchestration is a one-way port while the physical port created in the orchestration is a two-way port. In such cases, you can edit the binding file to make the following changes:

    For this Do this

    To edit the port binding file to configure a one-way send port

    1. In the following excerpt, change the value of the IsTwoWay property to false. Originally, this is set to true.

      Copy Code
      <SendPort Name="port_name" IsStatic="true" IsTwoWay="false" BindingOption="0">
    2. Comment out the following excerpts:

      Copy Code
      <ReceivePipeline Name="Microsoft.BizTalk.DefaultPipelines.XMLReceive"
  FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.XMLReceive,
  Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
  PublicKeyToken=token" Type="1" TrackingOption="None" Description=""/>
      Copy Code
      <ReceivePipelineData xsi:nil="true" />

    Important
    For inbound operations, the port binding file will always create a one-way receive port. This is because the SQL adapter only supports one-way receive port for inbound operations.

Configuring a WCF-SQL Port Using the Port Binding File Generated Using Consume Adapter Service Add-in

The Consume Adapter Service Add-in also creates a port binding file that you can import in BizTalk Server Administration console. You can use the same port binding file to also create the BizTalk WCF-SQL port in BizTalk Server Administration console. However, before creating WCF-SQL port you must perform the following tasks to modify the port binding file.

  1. Open the port binding file in a text editor.

  2. Search and replace “WCF-Custom” with the name with which you added the WCF-SQL adapter in BizTalk Server Administration console. For example, if you added the WCF-SQL adapter as “SQLAdapter”, replace “WCF-Custom” with “SQLAdapter”.

  3. Search for the “ConfigurationClsid” attribute, and replace the existing value of the attribute with “59B35D03-6A06-4734-A249-EF561254ECF7”.

  4. Save and close the binding file.

  5. Import the binding file in BizTalk Server Administration console. For instructions on how to import the binding file, see Importing Bindings.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Configuring Dynamic Ports

In BizTalk Server, you can configure dynamic ports for a WCF-Custom adapter. Because the SQL adapter is a WCF-based adapter, you can dynamically configure a port for the SQL adapter by using message context properties.

For the SQL adapter, the URI, action, and binding may be determined from a property on an incoming message, and then specified in the Expression shape, as shown in the following example:

Copy Code
Request2=Request1;
Request2(WCF.Action)="TableOp/Insert/dbo/CustomerTable";
Request2(WCF.BindingType)="sqlBinding";
Request2(WCF.UserName)="myuser";
Request2(WCF.Password)="mypass";
SendPort(Microsoft.XLANGs.BaseTypes.Address)="mssql://sql_server/my_instance/my_database";
SendPort(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-Custom";
Note
If you are using a WCF-SQL adapter in BizTalk Server Administration console, you can also specify the transport type as SendPort(Microsoft.XLANGs.BaseTypes.TransportType)="SQLAdapter", where SQLAdapter is the name with which you added the WCF-SQL adapter in BizTalk Server Administration console.

In the preceding example,

  • Request2 message is being created from Request1 message. Both messages map to an operation schema, which is generated using the Consume Adapter Service Add-in.

  • SendPort is the name of the logical send port in the BizTalk orchestration.

The Expression shape is part of the BizTalk orchestration. Deploying the orchestration also creates a WCF-Custom send port.

For more information about configuring dynamic ports, see “Configuring Dynamic Send Ports Using WCF Adapters Context Properties” at http://go.microsoft.com/fwlink/?LinkId=106735.

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Reusing Adapter Bindings

A binding creates a mapping between a logical endpoint (such as an orchestration port or a role link) and a physical endpoint (such as a send and receive port). This enables communication between different components of a BizTalk business solution. You can create bindings by using the BizTalk Server Administration console.

What is a Binding File?

A binding file is an XML file that contains binding information for each BizTalk orchestration in the scope of a BizTalk assembly, application, or group. The binding file describes:

  • The host to which each orchestration is bound.

  • The trust level of the host.

  • The settings for each send port, receive port, receive location, and party that has been configured.

You can generate binding files and then apply the bindings that they contain to an assembly, application, or group. This prevents having to manually configure bindings in different deployment environments and speeds up application deployment.

A binding file is not automatically generated for a BizTalk assembly, application, or group. However, you can generate a binding file by exporting bindings. Similarly, you can then import the binding file into an application or group. This section provides instructions on how to import and export bindings.

For more information about bindings and about binding files, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

In This Section

  • Exporting Bindings

  • Importing Bindings

See Also

Tasks

Building Blocks for Developing BizTalk Applications


Exporting Bindings

This section describes how to export bindings for a BizTalk application into an XML file. You can then import the bindings from the XML file into another BizTalk application. Importing bindings overwrites any existing bindings of the same name in the application. You can also add bindings to an application, which does not overwrite existing bindings. The bindings that you add do not take effect until you import the application.

Prerequisites

To perform the procedures in this topic, you must be logged on with an account that is a member of the BizTalk Server Administrators or BizTalk Operators group. For more detailed information about permissions, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

To export bindings using the BizTalk Server Administration console

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, and then expand Applications.

  3. Right-click the application whose bindings you want to export, point to Export, and then click Bindings.

  4. On the Export Bindings page, in Export to file, type the absolute path of the XML file to which to export the bindings.

    Example: C:\Bindings\Application1Bindings.xml.

  5. Ensure that Export all bindings from the current application is selected.

  6. To export all party information for the group, select the Export Global Party information check box.

  7. Click OK.

    The bindings are exported into an XML file in the location that you specified.

Note
For security reasons, when you export a binding file, BizTalk Server removes the passwords for the bindings from the file. After importing the bindings, you must reconfigure passwords for send ports and receive locations before they will function. You configure passwords in the Transport Properties dialog box of the BizTalk Server Administration console for the send port or receive location. For information about specifying user name and passwords, see Specifying Credentials for SQL Server.

See Also

Concepts

Reusing Adapter Bindings

© 2013 Microsoft Corporation. All rights reserved.


Importing Bindings

This topic describes how to use the BizTalk Server Administration console to import bindings into a BizTalk application from an XML file.

Prerequisites

To perform the procedures in this topic, you must be logged on with an account that is a member of the BizTalk Server Administrators or BizTalk Operators group. For more detailed information about permissions, see the BizTalk Server Help documentation at http://go.microsoft.com/fwlink/?LinkID=101130.

To import bindings using the BizTalk Server Administration console

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, and then expand Applications.

  3. Right-click the application into which you want to import bindings, point to Import, and then click Bindings.

  4. Click the binding file, and then click Open.

    The artifacts in the binding file are written to the application. They are displayed in appropriate folders of the application. For example, the send ports that are imported as part of the bindings are displayed under the Send Ports folder.

Note
For security reasons, when you export a binding file, BizTalk Server removes the passwords for the bindings from the file. After importing the bindings, you must reconfigure passwords for send ports and receive locations before they will function. You configure passwords in the Transport Properties dialog box of the BizTalk Server Administration console for the send port or receive location. For information about specifying user name and passwords, see Specifying Credentials for SQL Server.

See Also

Concepts

Reusing Adapter Bindings

© 2013 Microsoft Corporation. All rights reserved.


Performing Basic Insert, Update, Delete, and Select Operations by Using BizTalk Server

The Microsoft BizTalk Adapter for SQL Server surfaces a set of standard operations on SQL Server database tables and views. These are called data manipulation language (DML) operations. By using DML operations, you can perform simple Insert, Update, Select, and Delete operations on tables and views. For more information about how the adapter supports these operations, see Performing Basic Insert, Update, Delete, and Select Operations on Tables and Views. For information about the structure of the SOAP message for these operations, see Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

How to Perform Basic Operations on a SQL Server Database

Performing an operation on a SQL Server database by using SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To perform Insert, Update, Delete, or Select operations on tables and views in SQL Server, these tasks are:

  1. Create a BizTalk project, and generate schema for the operation you want to invoke on a SQL Server database table or view.

  2. Create messages in the BizTalk project for sending and receiving messages from the SQL Server database.

  3. Create an orchestration to invoke the operation on the SQL Server database table or view.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Sample Based On This Topic

A sample, SelectTable, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

This topic demonstrates how to perform basic DML operations by selecting records from the EMPLOYEE table in the SQL Server database. Run the scripts provided with the samples to create the EMPLOYEE table. For more information about the samples, see Samples.

To demonstrate how to select records, schema is generated for the Select operation for the EMPLOYEE table. You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schemas.

Important
If you are generating metadata for operations on a table that has columns of user-defined types (UDTs), make sure the respective assemblies of the UDTs are available at the same location as the Visual Studio executable, devenv.exe. The executable is typically available at <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE. In this example, the EMPLOYEE table has a UDT (Point) column. Make sure you copy the respective assembly at the same location as the Visual Studio executable.

For information about how to create a UDT, see http://go.microsoft.com/fwlink/?LinkId=138066. For information about how to register a UDT in SQL Server, see http://go.microsoft.com/fwlink/?LinkId=138067.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which defined by the corresponding schema. You must now create messages for the orchestration and link them to schemas you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select SelectTable.TableOperation_dbo_Employee.Select, where SelectTable is the name of your BizTalk project. TableOperation_dbo_Employee is the schema generated for the Select operation on the EMPLOYEE table.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select SelectTable.TableOperation_dbo_Employee.SelectResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and to receive responses, respectively. A sample orchestration for the Select operation resembles the following:

Orchestration for Select operation on SQL Server

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.Select.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.Select.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.Select.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.Select.Request

After you have specified these properties, the message shapes and ports are connected, and your orchestration is complete.

You must now build the BizTalk solution and deploy it to BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for selecting records from a SQL Server database table. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to the SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Important
If you are performing operations on a table that has columns of user-defined types (UDTs), make sure the respective assemblies of the UDTs are available at the same location as the BizTalk Server executable, btsntsvc.exe. The executable is typically available at <installation drive>:\Program Files\Microsoft BizTalk Server <version>. In this example, the EMPLOYEE table has a UDT (Point) column. Make sure you copy the respective assembly at the same location as the BizTalk Server executable.

For information about how to create a UDT, see http://go.microsoft.com/fwlink/?LinkId=138066. For information about how to register a UDT in SQL Server, see http://go.microsoft.com/fwlink/?LinkId=196964.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the Select operation that you generated earlier. For example, the request message to select all records from the EMPLOYEE table is:

Copy Code
<Select xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <Columns>*</Columns>
  <Query>where Employee_ID=10001</Query>
</Select>

This request message will retrieve records from the Employee table that satisfy the condition specified in the <Query> element. If you want to retrieve specific columns from the table, you must specify them in the <Columns> element, separated by comma, in the same sequence as they appear in the table definition. If you do not want to specify a condition to retrieve data, leave the <Query> element blank. See Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views for more information about the request message schema for performing basic DML operations on SQL Server database tables and views using the SQL adapter.

The orchestration consumes the message and sends it to SQL Server database. The response from SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<SelectResponse xmlns="mssql://Microsoft.LobServices.Sql/2008/01/TVOp/dbo/Employee">
  <SelectResult>
    <Employee xmlns="mssql://Microsoft.LobServices.Sql/2008/01/Types/Tables/dbo">
      <Employee_ID>10001</Employee_ID>
      <Name>John</Name>
      <DOJ>1983-12-31T00:00:00Z</DOJ>
      <Designation>Manager</Designation>
      <Job_Description>Management</Job_Description>
      <Photo>EjRVYzRFVQ==</Photo>
      <Rating>1,2</Rating>
      <Salary>100000.00</Salary>
      <Last_Modified>AAAAAAAAD6I=</Last_Modified>
    </Employee>
  </SelectResult>
</SelectResponse>

Best Practices

  • After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

  • If you are inserting, updating, or deleting large volumes of data make sure you set the right timeout values for the WCF adapter and for the MSDTC transaction. For more information, see “The adapter fails to insert, update, or delete large volumes of data in a single operation using BizTalk Server” issue in Troubleshooting Operational Issues.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Performing Operations on Tables and Views with Large Data Types by Using BizTalk Server

The SQL adapter enables adapter clients to read and update data in columns of large data types, that is, varchar(max), nvarchar(max), or varbinary(max). To read data from such columns, adapter clients can use the Select operation. To insert or update data into such columns, the adapter exposes a Set<column_name> operation, where <column_name> is the name of the column of type varchar(max), nvarchar(max), or varbinary(max).

Additionally, in SQL Server 2008, you can have the varbinay(max) column store unstructured data such as text documents and images. Such unstructured data is called FILESTREAM data. FILESTREAM data can be stored as files on the file system. The SQL adapter enables the client to enter FILESTREAM data into columns of type varbinary(max). For more information about FILESTREAM storage, see http://go.microsoft.com/fwlink/?LinkId=122485.

This topic provides information about certain tasks you must perform on the computer running SQL Server and the computer running the adapter client to be able to insert or update FILESTREAM data. This topic also provides instructions on performing Set<column_name> operations to insert FILESTREAM data.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

Prerequisites

You must perform the following tasks on the computer running SQL Server 2008 and the computer running the adapter client.

Note
If you are performing Set<column_name> operations on SQL Server 2005, you do not need to perform these tasks. You can directly start with the next section. This is because FILESTREAM is not supported on SQL Server 2005.

  • On the computer running SQL Server 2008

    • You must enable FILESTREAM on the SQL Server instance. For more information, see http://go.microsoft.com/fwlink/?LinkId=122486.

    • You must create a FILESTREAM-enabled database. For more information, see http://go.microsoft.com/fwlink/?LinkId=122487.

    • You must have a table for storing FILESTREAM data. For more information, see http://go.microsoft.com/fwlink/?LinkId=122488.

    • You must configure MSDTC on the computer hosting the SQL Server database. For instruction on how to configure MSDTC, see Configure MSDTC on SQL Server and Adapter Client.

  • On the computer running the adapter client

    • You must have the SQL Client Connectivity SDK installed. You can install the SQL Client Connectivity SDK by running the SQL Server 2008 setup and selecting SQL Client Connectivity SDK in the Feature Selection page of the wizard. The adapter uses the sqlncli10.dll, installed with the SQL Client Connectivity SDK, to perform FILESTREAM operations.

    • You must configure MSDTC on the computer running the adapter client. For instruction on how to configure MSDTC, see Configure MSDTC on SQL Server and Adapter Client.

After you have completed these tasks, you are all set to insert or update FILESTREAM data in SQL Server 2008 database tables.

How This Topic Demonstrates Operations on Large Data Types

To demonstrate how to perform Set<column_name> operations on tables with large data types, take a table, Records, that has columns Id and Document. The Id column is of type uniqueidentifier and takes a GUID. The Document column is of type VARBINARY(MAX). Assume that the Id column already has a GUID ‘438B7B4C-5491-409F-BCC1-78817C399EC3’. To update the Document column, the adapter exposes the SetDocument operation.

Note
For SQL Server 2008, to demonstrate FILESTREAM operations, assume that the Document column can store FILESTREAM data.

How to Perform Operations on a SQL Server Database

Performing an operation on a SQL Server database by using SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To perform operations on tables with large data types, these tasks are:

  1. Create a BizTalk project, and generate schema for the Set<column_name> operation. For this topic, generate schema for the SetDocument operation for the Records table.

  2. Create messages in the BizTalk project for sending and receiving messages from the SQL Server database.

  3. Create an orchestration to invoke the SetDocument operation on the Records table.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Sample Based on This Topic

A sample, FILESTREAMOperation, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

To demonstrate how to update values in columns of large data types, generate schema for the SetDocument operation of the Records table. You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schema.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration and link them to schemas you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select SetOperation.TableOperation_dbo_Records.SetDocument, where SetOperation is the name of your BizTalk project. TableOperation_dbo_Records is the schema generated for the SetDocument operation on the Records table.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select SetOperation.TableOperation_dbo_Records.SetDocumentResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and to receive responses, respectively. A sample orchestration for the SetDocument operation resembles the following:

Orchestration to perform FILESTREAM operations

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.FileStream.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.FileStream.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.FileStream.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.FileStream.Request

After you have specified these properties, the message shapes and ports are connected, and your orchestration is complete.

You must now build the BizTalk solution and deploy it to BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Important
      The operation to enter FILESTREAM data must be performed within a transaction. So, make sure the UseAmbientTransaction binding property is set to True on the WCF-Custom or WCF-SQL send port. For more information about the binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Important
      For performing an operation to insert FILESTREAM data you must always use Windows Authentication to connect to SQL Server on the WCF-Custom or WCF-SQL send port. So, in the Credentials tab in the port properties dialog box, select the Do not use single Sign-On option, and leave the user name and password blank.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for performing the SetDocument operation on the Records table. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to the SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the SetDocument operation that you generated earlier. For example, the request message to update the Document column is:

Copy Code
<SetDocument xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Records">
  <Filter>WHERE Id='438B7B4C-5491-409F-BCC1-78817C399EC3'</Filter>
  <Data>UwBlAHQAdgBfAHYAYQByAGIAaQBuAGEAcgB5AE0AQQBYAA==</Data>
</SetDocument>
Important
The Filter element must contain the WHERE clause based on which the adapter updates the records. The Data element must contain a base64 encoded value that you want to insert into the Document column.

This request message updates the Document column with the specified value. The orchestration consumes the message and sends it to the SQL Server database. The response from the SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from the SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<SetDocumentResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Records" />

The adapter sends an empty response for the Set<column_name> operation.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Executing Stored Procedures in SQL Server by Using BizTalk Server

The Microsoft BizTalk Adapter for SQL Server surfaces the procedures in SQL Server database as operations. Adapter clients can invoke the procedures by using the SQL adapter with BizTalk Server. For more information about how the adapter supports these operations, see Executing Stored Procedures in SQL Server. For information about the structure of the SOAP message for these operations, see Message Schemas for Procedures and Functions.

The SQL adapter also enables adapter clients to invoke:

  • Scalar functions in SQL Server database. See Invoking Scalar Functions in SQL Server by Using BizTalk Server.

  • Table valued functions in SQL Server database. See Invoking Table-Valued Functions in SQL Server by Using BizTalk Server.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

How to Invoke Procedures in SQL Server Database

Performing an operation on SQL Server database using the SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To invoke a procedure in SQL Server database, these tasks are:

  • Create a BizTalk project, and generate schema for the procedure you want to invoke in SQL Server database.

  • Create messages in the BizTalk project for sending and receiving messages to and from SQL Server database.

  • Create an orchestration to invoke the procedure in SQL Server database.

  • Build and deploy the BizTalk project.

  • Configure the BizTalk application by creating physical send and receive ports.

  • Start the BizTalk application.

This topic provides instructions to perform these tasks.

Sample Based on This Topic

A sample, ExecuteStoredProcedure, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

This topic demonstrates how to invoke a procedure, by invoking the ADD_EMP_DETAILS procedure. This procedure is created by running the scripts provided with the samples. The ADD_EMP_DETAILS procedure takes certain parameters, inserts a record into the EMPLOYEE table, and returns an employee ID for the inserted record. For information about the samples and the SQL scripts, see Samples.

To invoke the ADD_EMP_DETAILS procedure, it is necessary to generate schema for the same procedure. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schema.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration, and link them to schemas that you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select ExecProcedure.Procedure_dbo.ADD_EMP_DETAILS, where ExecProcedure is the name of your BizTalk project. Procedure_dbo is the schema generated for invoking the ADD_EMP_DETAILS procedure.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select ExecProcedure.Procedure_dbo.ADD_EMP_DETAILSResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and receive responses, respectively. A sample orchestration for invoking a procedure resembles the following:

Orchestration for invoking procedures

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.Procedure.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.Procedure.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.Procedure.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.Procedure.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for invoking procedures in SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the procedure you generated earlier. For example, the request message to invoke the GET_EMP_DETAILS is:

Copy Code
<ADD_EMP_DETAILS xmlns="mssql://Microsoft.LobServices.Sql/2008/01/Procedures/dbo">
  <emp_name>John</emp_name>
  <emp_desig>Developer</emp_desig>
  <salary>100000</salary>
</ADD_EMP_DETAILS>

See Message Schemas for Procedures and Functions for more information about the request message schema for invoking procedures in SQL Server database using the SQL adapter.

The orchestration consumes the message and sends it to SQL Server database. The response from SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<ADD_EMP_DETAILSResponse xmlns="mssql://Microsoft.LobServices.Sql/2008/01/Procedures/dbo">
  <ADD_EMP_DETAILSResult>
    <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
      <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element msdata:IsDataSet="true" name="NewDataSet">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Employee_ID" type="xs:int" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <NewDataSet xmlns="">
          <NewTable>
            <Employee_ID>10001</Employee_ID>
          </NewTable>
        </NewDataSet>
      </diffgr:diffgram>
    </DataSet>
  </ADD_EMP_DETAILSResult>
  <ReturnValue>0</ReturnValue>
</ADD_EMP_DETAILSResponse>

In the above response the <Employee_ID> element contains the employee ID for the inserted record.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Executing Stored Procedures With a Single XML Parameter

This topic was last updated on: June 05, 2009

Executing a stored procedure that takes a single parameter is similar to executing any other stored procedure as described in Executing Stored Procedures in SQL Server by Using BizTalk Server. However, for the approach described in the preceding link, you need to generate metadata for the stored procedure at design time and create an orchestration to invoke the procedure at run time.

Consider a scenario where you just want to pass one single value to a stored procedure without doing any processing on that value. In such cases, you do not want the overhead of generating metadata, creating an orchestration, deploying the orchestration, and executing the operation. Rather, you can configure a WCF-Custom or WCF-SQL send port to directly invoke the stored procedure. This topic demonstrates how to perform these tasks using the BizTalk Server Administration console.

Note
This topic provides instructions on how to configure a WCF-Custom send port for executing stored procedure that takes a single parameter. You can perform the same steps by configuring a WCF-SQL port. For instructions on configuring WCF-SQL port, see Configuring a Port Using the WCF-SQL Adapter.

How This Topic Demonstrates Invoking Stored Procedures Without an Orchestration

To demonstrate how to execute stored procedures with single parameters without an orchestration, this topic uses the ADD_LAST_EMP_XML_INFO stored procedure. This procedure takes an XML value as a parameter and inserts it into the Address column of the Employee table. You must have the XML value that you will pass to the stored procedure. However, to execute the stored procedure using the adapter, you must send a request message conforming to the schema of the procedure, and containing the XML value for the Address field, to the SQL Server. So, you must create that request message by:

  • Using the Template option in the send port configuration using which you can create a request message using a message template.

  • Putting the XML value for the Address field into the message.

All these steps are described in detail in this topic. You must perform the following set of tasks:

  1. Create a FILE receive port where you will drop the XML file that will be inserted into the Address XML field of the Employee table. Suppose this port is called MessageIn port.

  2. Create a WCF-Custom one-way send port that picks the XML file from the FILE receive port, constructs the message using the message template, and sends it to SQL Server to execute the stored procedure.

This part of the topic provides instructions on configuring a WCF-Custom send port with the message template.

Note
Even though the information in this topic demonstrates how to execute a stored procedure with a single XML parameter, you can perform the tasks to perform any operation that takes a single parameter of any data type. The only difference will be in the way you create a message template for a specific operation. You can create a message template by taking the request message you would use to execute the operation using an orchestration and replacing the value of the parameter with the BizTalk message body.

Configuring a WCF-Custom Send Port

Before creating the WCF-Custom send port, make sure you created the FILE receive port, MessageIn.

To configure a WCF-Custom send port

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand BizTalk Group, and then expand Applications.

  3. Expand the application under which you want to deploy the SQL adapter.

  4. Right-click Send Ports, point to New, and then point to Static One-way Send Port.

  5. In the Send Port Properties dialog box, on the General tab, type a name for the send port.

  6. Configure the port to receive all messages dropped at the FILE receive port, MessageIn.

    1. In the Send Port Properties dialog box, from the left pane, click Filters.

    2. In the right pane, under the Property column, click the grid, and then select BTS.ReceivePortName property.

    3. For the Operator column, select “==”.

    4. For the Value column, specify the name of the FILE receive port, MessageIn.

  7. In the Send Port Properties dialog box, on the General tab, from the Type drop-down list, select WCF-Custom, and then click Configure.

  8. In the WCF-Custom Transport Properties dialog box, do the following:

    1. Click the General tab, and in the Address (URI) field, specify the connection URI for SQL Server. For more information about the connection URI, see SQL Server Connection URI.

    2. On the General tab, in the Action text box, type the action for the operation. See individual topics in Technical Reference for a list of actions for each operation. For example, the action to invoke the ADD_LAST_EMP_XML_INFO is:

      Copy Code
      Procedure/dbo/ADD_LAST_EMP_XML_INFO
    3. Click the Binding tab, and from the Binding Type list, select sqlBinding. You can specify the different binding properties exposed by the SQL adapter. For more information about binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

    4. Click the Credentials tab, and then do one of the following:

      • Select the Do not use Single Sign-On option, and the specify the user name and password to connect to SQL Server. Note that the user name and password are case-sensitive.

        Note
        If you want to connect to SQL Server using Windows authentication, specify a blank user name and password.

      • Select the Use Single Sign-On option, and then specify an affiliate Enterprise Single Sign-on (SSO) application.

        For more information about security with respect to BizTalk Server, see Security Considerations When Using the Adapter with BizTalk Server.

    5. Click the Messages tab, and in the Outbound WCF message body section, choose the Template option.

    6. In the XML text box, specify the template that will be used to construct the WCF message. By doing so, you create a message that conforms to the ADD_LAST_EMP_XML_INFO operation for the WCF-based SQL adapter.

      Specify template for outbound WCF message

      For the ADD_LAST_EMP_XML_INFO stored procedure, you must specify the following template:

      Copy Code
      <ADD_LAST_EMP_XML_INFO xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
<xml_info>
<bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
</xml_info>
</ADD_LAST_EMP_XML_INFO>
      Important
      The encoding in the message template must always be “string” irrespective of the type of the parameter for the operation that will be invoked using the send port. For example, the ADD_LAST_EMP_XML_INFO takes a parameter of type XML, but the encoding in the message template is string.

      Note
      You can create this message template by copying the request message for the stored procedure and replacing the value within the <xml_info> tags with the BizTalk message body. You can get the request message for the stored procedure by generating the schema for the procedure using the Consume Adapter Service Add-in, and then generating an instance of the schema to get the request XML.

    7. To return to the Send Port Properties dialog box, click OK.

  9. From the Send handler list, select BizTalkServerApplication.

  10. From the Send pipeline list, select the pipeline that corresponds to PassThruTransmit.

  11. Click OK.

Starting the Application

To start the BizTalk application, you can start both the FILE receive location and the WCF-Custom send port individually. You must now copy an XML file to the folder mapped to the FILE receive location. The BizTalk application consumes the file, and the XML value is inserted in the Address column of the Employee table. You can verify this by using a SQL Server client and selecting records from the Employee table.

Using a Two-way WCF-Custom Send Port

The instructions in this topic, under the section Configuring a WCF-Custom Send Port, demonstrate how to configure a one-way WCF-Custom send port to execute a stored procedure with a single parameter without using a BizTalk orchestration. However, in such a case, to verify whether the stored procedure is executed successfully you will have to verify in the SQL Server database whether the Address column in the Employee table is updated.

Instead, you can create a two-way WCF-Custom send port that also gets the response from SQL Server if the stored procedure is executed successfully. You must perform a few additional steps if you create a two-way WCF-Custom port. Note that you will still need a FILE receive location, as mentioned in the preceding instructions.

  1. Create a two-way WCF-Custom send port, for example, ExecProcedure. The steps to configure the send port are similar to those for the one-way send port. The only difference is that for the two-way port you must also specify a receive pipeline. Make sure you select PassThruReceive for the receive pipeline.

  2. Create a FILE send port. This port will drop the response message from the SQL Server database to a folder. Using the Filters tab of the port properties dialog box, configure the FILE send port to receive all response messages from the WCF-Custom send port.

    1. In the Send Port Properties dialog box, from the left pane, click Filters.

    2. In the right pane, under the Property column, click the grid, and then select BTS.SPName property.

    3. For the Operator column, select “==”.

    4. For the Value column, specify the name of the WCF-Custom send port, ExecProcedure.

Start all the three ports. Copy an XML file to the folder mapped to the FILE receive location. Look for the response in the folder mapped to the FILE send port.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Executing Stored Procedures Having a FOR XML Clause

This topic was last updated on: June 05, 2009

An SQL SELECT statement can have a FOR XML clause that returns the query result as XML instead of a rowset. You can also have a stored procedure that has a SELECT statement with a FOR XML clause. For more information about the FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

You can use the WCF-based SQL adapter to execute such stored procedures.

Important
The “native” SQL adapter available with BizTalk Server requires stored procedures to have the FOR XML clause as part of the SELECT statement. You can use such stored procedures with the WCF-based SQL adapter without making any changes to the stored procedure definition.

You can always use the schemas generated using the ‘native’ SQL adapter provided with earlier versions of BizTalk Server. For more information, see Using FOR XML queries with the WCF-SQL Adapter (http://go.microsoft.com/fwlink/?LinkId=223428).

How to Invoke Stored Procedures with FOR XML Clause

When you invoke a stored procedure with FOR XML clause in SQL Server Management Studio or using the SQL adapter available with BizTalk Server, the output is in the form of an xml message. To use these procedures with the WCF-based SQL adapter, you must have the schema for the output message. The WCF-based SQL adapter requires this schema while receiving the response message from SQL Server after executing a stored procedure with FOR XML clause. Note that the request message to invoke this stored procedure will be generated by the adapter itself.

Apart from having the schema for the response message, you must also perform certain tasks to invoke a stored procedure with FOR XML clause using the WCF-based SQL adapter.

  1. Generate the schema for the response message for the stored procedure with FOR XML clause. If you already have the response schema generated by the “native” SQL adapter available with BizTalk Server, you can skip this step.

  2. Create a BizTalk project and add the generated schema to the project.

  3. Generate schema for the stored procedure with FOR XML clause using the WCF-based SQL adapter. This provides the schema for the request message that the adapter sends to SQL Server to invoke the stored procedure.

  4. Create messages in the BizTalk project to send and receive messages from SQL Server. The request message must conform to the schema of the request message generated by the adapter. The response message must conform to the schema of the response message obtained either using the “native” SQL adapter or by executing the stored procedure with FOR XML clause in SQL Server Management Studio.

  5. Create an orchestration to invoke the stored procedure in the SQL Server database.

  6. Build and deploy the BizTalk project.

  7. Configure the BizTalk application by creating physical send and receive ports.

  8. Start the BizTalk application.

Generating Schema for the Response Message for Stored Procedure

Note
You do not need to perform this step if you have the response schema generated by the SQL adapter available with BizTalk Server.

You can generate the schema for the response message for the stored procedure, provided the SELECT statement in the stored procedure has the xmlschema clause with the for xml clause. In this topic, we use the GET_EMP_DETAILS_FOR_XML stored procedure that retrieves the employee details for a given employee ID. To retrieve the schema by executing the stored procedure, the SELECT statement looks like the following:

Copy Code
SELECT [Employee_ID] ,[Name] ,[DOJ] ,[Designation] ,[Job_Description] ,[Photo] ,cast([Rating] as varchar(100)) as Rating ,[Salary] ,[Last_Modified] ,[Status] ,[Address]
FROM [Adapt_Doc].[dbo].[Employee] for xml auto, xmlschema

Execute this stored procedure to get the schema for the response message. Note that the response from the stored procedure contains the schema as well as the data from executing the stored procedure. You must copy the schema from the response and save it to a text pad. For this example, you can name this schema as ResponseSchema.xsd. You must now create a BizTalk project in Visual Studio and add this schema to the project.

Important
Make sure you remove the xmlschema clause after you have executed the stored procedure to generate the schema. If you fail to do this, when you finally execute the stored procedure through BizTalk, you will again generate the schema in the response message. So, to get the response message as xml you must remove the xmlschema clause.

To add the schema to a BizTalk project

  1. Create a BizTalk project in Visual Studio.

  2. Add the response schema you generated for the stored procedure to the BizTalk project. Right-click the BizTalk project in the Solution Explorer, point to Add, and then click Existing Item. In the Add Existing Item dialog box, navigate to the location where you saved the schema and click Add.

  3. Open the schema in Visual Studio and make the following changes.

    1. Add a node to the schema and move the existing root node under this newly added node. Give a name to the root node. For this topic, rename the root node to Root.

    2. The response schema generated for the stored procedure references a sqltypes.xsd. You can get the sqltypes.xsd schema from http://go.microsoft.com/fwlink/?LinkId=131087. Add the sqltypes.xsd schema to the BizTalk project.

    3. In the schema generated for the stored procedure, change the value of import schemaLocation to the following.

      Copy Code
      import schemaLocation=”sqltypes.xsd”
      You do this because you have already added the sqltypes.xsd schema to your BizTalk project.

    4. Provide a target namespace for the schema. Click the <Schema> node, and in the properties pane, specify a namespace in the Target Namespace property. For this topic, give the namespace as http://ForXmlStoredProcs/namespace.

Generating Schema for the Request Message to Invoke the Stored Procedure

To generate schema for the request message you can use the Consume Adapter Service Add-in from a BizTalk project in Visual Studio. For this topic, generate the schema for the GET_EMP_DETAILS_FOR_XML stored procedure. For more information about how to generate the schema using Consume Adapter Service Add-in, see Retrieving Metadata for SQL Server Operations in Visual Studio.

Important
You must generate the schema by selecting the procedure only from the Procedures node in Consume Adapter Service Add-in.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration, and link them to schemas that you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select ForXMLProcedure.Procedure_dbo.GET_EMP_DETAILS_FOR_XML, where ForXMLProcedure is the name of your BizTalk project. Procedure_dbo is the schema generated for invoking the GET_EMP_DETAILS_FOR_XML procedure.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select ForXMLProcedure.ResponseSchema, where ResponseSchema is the name of the response schema generated by executing the stored procedure as described under Generating Schema for the Response Message for Stored Procedure.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for executing a stored procedure in SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and receive responses, respectively. A sample orchestration for invoking a procedure resembles the following:

Orchestration to invoke stored procedures

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.FOR_XML.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.FOR_XML.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.FOR_XML.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.FOR_XML.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkId=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to SQL Server database. For instructions on how to create a send port, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      You must also specify the action in the send port. For procedures that contain the FOR XML clause, you must set the action in the following format.

      Copy Code
      XmlProcedure/<schema_name>/<procedure_name>
      So, for this topic where we are executing the GET_EMP_DETAILS_FOR_XML procedure, the action will be:

      Copy Code
      XmlProcedure/dbo/GET_EMP_DETAILS_FOR_XML
      For more information about setting action, see Specifying SOAP Action.

      You must also set the following binding properties when executing a stored procedure with the FOR XML clause.

      Binding property name Set this to

      XmlStoredProcedureRootNodeName

      Specify the name of the root node that you added to the response schema you generated for the stored procedure, as described under Generating Schema for the Response Message for Stored Procedure. For this topic, set this to Root.

      XmlStoredProcedureRootNodeNamespace

      Specify the target namespace for the response schema you generated for the stored procedure, as described under Generating Schema for the Response Message for Stored Procedure. For this topic, set this to http://ForXmlStoredProcs/namespace.

      For more information about specifying values for binding properties, see Specifying Binding Properties.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for invoking procedures in SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the request schema for the procedure you generated using the Consume Adapter Service Add-in. For example, the request message to invoke the GET_EMP_DETAILS_FOR XML is:

Copy Code
<GET_EMP_DETAILS_FOR_XML xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
  <emp_id>10765</emp_id>
</GET_EMP_DETAILS_FOR_XML>

See Message Schemas for Procedures and Functions for more information about the request message schema for invoking procedures in SQL Server database using the SQL adapter.

The orchestration consumes the message and sends it to SQL Server database. The response from SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8"?>
<Root xmlns="http://ForXmlStoredProcs/namespace">
  <Adapt_Doc.dbo.Employee Employee_ID="10765" Name="John" Designation="asdfaf" Salary="3434.00" Last_Modified="AAAAAAAANso=" Status="0" xmlns="" />
</Root>

Notice that the response is received in the same schema as generated by executing the stored procedure. Also note that the root node and the namespace is the same you specified as values for XmlStoredProcedureRootNodeName and XmlStoredProcedureRootNodeNamespace binding properties respectively.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Performing Composite Operations on SQL Server by Using BizTalk Server

The SQL adapter enables adapter clients to perform composite operations on the SQL Server database. A composite operation can include:

  • Insert, Update, and Delete operations. A Select operation is not supported as part of a composite operation.

  • Stored procedures executed as operations.

A single composite operation can have any number of these operations, in any order. For example, you can have two Insert operations followed by a Delete operation, and finally a stored procedure execution. Also, you can have different operations targeting different database tables or views. For more information about how the adapter supports composite operations, see Support for Composite Operations. For information about the structure of the SOAP message for composite operations, see Message Schemas for Composite Operations.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

How to Perform Composite Operations on SQL Server

Performing an operation on SQL Server using the SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To perform composite operations on the SQL Server database, these tasks are:

  1. Create a BizTalk project, and generate schema for all the operations you want to invoke.

  2. Manually create a schema file that includes references to all the schemas you generated in the previous step.

  3. Create messages in the BizTalk project for sending and receiving messages from the SQL Server database. These messages must conform to the request and response schema you created in the previous step.

  4. Create an orchestration to invoke the composite operation on the SQL Server database.

  5. Build and deploy the BizTalk project.

  6. Configure the BizTalk application by creating physical send and receive ports.

  7. Start the BizTalk application.

This topic provides instructions on how to perform these tasks.

Sample Based on This Topic

A sample, CompositeOperations, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

In this topic, to demonstrate how to perform composite operations, the following tasks will be performed in the order specified:

  • Insert record into the EMPLOYEE table.

  • Retrieve all the columns for the last inserted record by invoking the GET_LAST_EMP_DATA stored procedure.

  • Delete the record from the EMPLOYEE table.

Run the scripts provided with the samples to create the EMPLOYEE table. For more information about the samples, see Samples.

You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema for these operations. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schemas.

Creating a Composite Schema Definition

You must now create a composite schema that references the schemas you created for the individual operations. Perform the following steps to create a composite schema definition.

To add a composite schema definition

  1. Add a schema file to the BizTalk project. Right-click the project name, point to Add, and then click New Item. In the Add New Item dialog box, from the Categories box, click Schema Files. From the Templates box, click Schema. Specify a name for the schema file, and then click OK.

    For this example, specify the schema file name as CompositeSchema.xsd.

  2. Add references to the schema generated for the different operations that you want to perform. In this example, the different schemas generated for operations are:

    • TableOperation.dbo.Employee.xsd, for Insert and Delete operations.

    • Procedure.dbo.xsd, for the GET_LAST_EMP_DATA stored procedure.

    To add references:

    1. Right-click the root <Schema> node in the CompositeSchema.xsd, and click Properties.

    2. In the Property box, click the ellipsis button (…) against the Imports property.

      Import schema definitions
    3. In the Imports dialog box, from the Import new schema as list, select XSD Import, and then click Add.

    4. In the BizTalk Type Picker dialog box, expand the BizTalk project name node, expand Schemas, and then select the schema you want to import. For this example, select <BizTalk_project_name>.TableOperation_dbo_Employee. Click OK.

      Repeat this step to import <BizTalk_project_name>.Procedure_dbo too.

    5. In the Imports dialog box, click OK.

  3. Add two child nodes to the root schema node. One child node corresponds to the request schema for performing the composite operation. The other child node corresponds to the response schema. The node that corresponds to the request schema can have any name. The node that corresponds to the response schema must be called <request_schema_node>Response. For this example, we will call the request schema node as Request. So, the response schema node is called RequestResponse.

    Note
    By default, a Root node is also added to a new schema file. You can rename the Root node to Request. To rename a node, right-click the node name and click Rename.

    To add a node under the <Schema> node:

    1. Right-click the <Schema> node, point to Insert Schema Node, and click Child Record.

    2. Rename the new node to RequestResponse.

  4. Add child nodes under the Request node that correspond to the request schema for each operation that you will perform as part of the composite operation. For this example, you must add child nodes corresponding to the following:

    • Insert and Delete operations on the EMPLOYEE table.

    • GET_LAST_EMP_DATA stored procedure.

    Important
    You must add the nodes in the same order in which you want to perform the operations. For example, if you want to insert a record, then execute a stored procedure, and then delete a record you must first add a node for the Insert operation, followed by a node for the stored procedure, and finally a node for the Delete operation.

    To add child nodes to the Request node:

    1. Right-click the Request node, point to Insert Schema Node, and then click Child Record.

      Insert child nodes for a schema
    2. Rename the record to correspond to a request schema for an operation that you perform as part of the composite operation. For example, rename the node to “Insert”.

    3. Map the Insert node to the request schema for the Insert operation on the EMPLOYEE table. To do so, right-click the Insert node, and click Properties. In the Properties box, from the Data Structure Type list, select Insert (Reference).

      Map child nodes to the request schema
    4. Repeat these steps to add nodes for the request schemas for GET_LAST_EMP_DATA stored procedure and the Delete operation. Specify the node names and map them to the corresponding schema as mentioned in the following table.

      Node name Mapped to schema

      GET_LAST_EMP_DATA

      GET_LAST_EMP_DATA (Reference)

      Delete

      Delete (Reference)

  5. Add child nodes under the RequestResponse node that correspond to the response schema for each operation that you will perform as part of the composite operation. For this example, you must add child nodes corresponding to the following:

    • Insert and Delete operations on the EMPLOYEE table.

    • GET_LAST_EMP_DATA stored procedure.

    Important
    You must add the child nodes in the same order as the child nodes under the Request node.

    To add child nodes to the RequestResponse node:

    1. Right-click the RequestResponse node, point to Insert Schema Node, and click Child Record.

    2. Rename the record to correspond to a response schema for an operation that you perform as part of the composite operation. For example, rename the node to “InsertResponse”.

    3. Map the InsertResponse node to the response schema for the Insert operation on the EMPLOYEE table. To do so, right-click the InsertResponse node, and click Properties. In the Properties box, from the Data Structure Type list, select InsertResponse (Reference).

    4. Repeat these steps to add nodes for the response schemas for the GET_LAST_EMP_DATA stored procedure and the Delete operation. Specify the node names and map them to the corresponding schema as mentioned in the following table.

      Node name Mapped to schema

      GET_LAST_EMP_DATAResponse

      GET_LAST_EMP_DATAResponse (Reference)

      DeleteResponse

      DeleteResponse (Reference)

  6. Save the CompositeSchema.xsd file.

Defining Messages and Message Types

The composite schema that you created in the last step describes the “types” required for the messages in an orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration and link them to schema you created in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select CompositeOp.CompositeSchema.Request, where CompositeOp is the name of your BizTalk project. CompositeSchema is the schema you created manually for the composite operations.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select CompositeOp.CompositeSchema.RequestResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing composite operations on SQL Server. In this orchestration, you drop a request message at a defined receive location. The request message must conform to the composite schema you created earlier. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and receive responses, respectively. A basic orchestration for performing composite operations resembles the following:

Orchestration to peform composite operations

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.CompositeOp.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.CompositeOp.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.CompositeOp.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.CompositeOp.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. Because the operations that are being as part of the composite operation are executed in a single transaction, make sure the UseAmbientTransaction binding property is set to True.

      You must also specify the action in the send port. The action for a composite operation is “CompositeOperation”. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. For more information about how to specify actions for ports, see Specifying SOAP Action.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File. If you import this binding file, the action on the WCF-Custom or WCF-SQL send port is set to a dynamic action involving all the operations you selected in the Consume Adapter Service Add-in while generating the schema. For a composite operation, you must replace the dynamic action with “CompositeOperation”.

Starting the Application

You must start the BizTalk application for performing composite operations on the SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to the SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the composite operations you created earlier. For example, a request message that inserts a record in the EMPLOYEE table, invokes the GET_LAST_EMP_DATA stored procedure, and deletes a record from the EMPLOYEE table is:

Copy Code
<Request xmlns="http://CompositeTest.CompositeSchema">
  <Insert xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
    <Rows>
      <Employee xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
        <Name>John</Name>
        <Designation>Manager</Designation>
        <Salary>100000</Salary>
      </Employee>
    </Rows>
  </Insert>
  <GET_LAST_EMP_DATA xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" />
  <Delete xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
    <Rows>
      <Employee xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
        <Name>John</Name>
      </Employee>
    </Rows>
  </Delete>
</Request>

See Message Schemas for Composite Operations for more information about the request message schema for performing composite operations on the SQL Server database using the SQL adapter.

The orchestration consumes the message and sends it to the SQL Server database. The response from the SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from the SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<RequestResponse xmlns="http://CompositeTest.CompositeSchema">
  <InsertResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
    <InsertResult>
      <long xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">10080</long>
    </InsertResult>
  </InsertResponse>
  <GET_LAST_EMP_DATAResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
    <GET_LAST_EMP_DATAResult>
      <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
        <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
          <xs:element msdata:IsDataSet="true" name="NewDataSet">
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element minOccurs="0" name="Employee_ID" type="xs:int" />
                      <xs:element minOccurs="0" name="Name" type="xs:string" />
                      <xs:element minOccurs="0" name="DOJ" type="xs:dateTime" />
                      <xs:element minOccurs="0" name="Designation" type="xs:string" />
                      <xs:element minOccurs="0" name="Job_Description" type="xs:string" />
                      <xs:element minOccurs="0" name="Photo" type="xs:base64Binary" />
                      <xs:element minOccurs="0" name="Rating" type="xs:string" />
                      <xs:element minOccurs="0" name="Salary" type="xs:decimal" />
                      <xs:element minOccurs="0" name="Last_Modified" type="xs:base64Binary" />
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:schema>
        <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
          <NewDataSet xmlns="">
            <NewTable>
              <Employee_ID>10080</Employee_ID>
              <Name>John</Name>
              <Designation>Manager</Designation>
              <Salary>100000.00</Salary>
              <Last_Modified>AAAAAAAAF40=</Last_Modified>
            </NewTable>
          </NewDataSet>
        </diffgr:diffgram>
      </DataSet>
    </GET_LAST_EMP_DATAResult>
    <ReturnValue>0</ReturnValue>
  </GET_LAST_EMP_DATAResponse>
  <DeleteResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
    <DeleteResult>1</DeleteResult>
  </DeleteResponse>
</RequestResponse>

The preceding response contains multiple result sets corresponding the different operations performed as part of the composite operation. For example, the InsertResult element contains 10080, which is the unique identifier for the newly added record.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Invoking Scalar Functions in SQL Server by Using BizTalk Server

You can use the SQL adapter with BizTalk Server to invoke scalar functions in SQL Server. The adapter exposes the scalar functions as operations that can be invoked directly on SQL Server. For more information about how the adapter supports scalar functions, see Executing Scalar Functions in SQL Server. For information about the structure of the SOAP message for invoking scalar functions, see Message Schemas for Procedures and Functions.

Prerequisites

  • You must have completed the steps in Before You Develop BizTalk Applications.

  • You must have configured MSDTC on computers running the SQL adapter and SQL Server. See Before Developing Applications Using the SQL Adapter.

How to Invoke Scalar Functions on SQL Server Database

Performing an operation on SQL Server database by using SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To invoke scalar functions in SQL Server, these tasks are:

  1. Create a BizTalk project, and generate schema for the scalar function you want to invoke in SQL Server.

  2. Create messages in the BizTalk project for sending and receiving messages from SQL Server.

  3. Create an orchestration to invoke the operation on SQL Server.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Generating Schema

This topic demonstrates how to invoke scalar functions in SQL Server using the SQL adapter with BizTalk Server. To demonstrate this operation, in this topic you execute the GET_EMP_ID function. This function takes an employee’s designation as a parameter and returns the ID for that employee from the EMPLOYEE table. The table and the function are created by running the scripts provided with the samples. For more information about the script, see Samples.

To demonstrate how to invoke scalar functions, schema is generated for the GET_EMP_ID scalar function. You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schemas.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration and link them to schemas you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select ScalarFunction.ScalarFunction_dbo.GET_EMP_ID, where ScalarFunction is the name of your BizTalk project. ScalarFunction_dbo is the schema generated for the GET_EMP_ID function.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select ScalarFunction.ScalarFunction_dbo.GET_EMP_IDResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and to receive responses, respectively. A sample orchestration for invoking a scalar function resembles the following:

Orchestration to invoke scalar functions

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.ScalarFunction.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.ScalarFunction.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.ScalarFunction.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.ScalarFunction.Request

After you have specified these properties, the message shapes and ports are connected, and your orchestration is complete.

You must now build the BizTalk solution and deploy it to BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for invoking scalar functions in SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the GET_EMP_ID function you generated earlier. For example, the request message to invoke the GET_EMP_ID function is:

Copy Code
<GET_EMP_ID xmlns="http://schemas.microsoft.com/Sql/2008/05/ScalarFunctions/dbo">
  <emp_desig>Manager</emp_desig>
</GET_EMP_ID>

This request message invokes the GET_EMP_ID function to retrieve the ID for employees with the designation “Manager”. See Message Schemas for Procedures and Functions for more information about the request message schema for invoking scalar functions in SQL Server using the SQL adapter.

The orchestration consumes the message and sends it to SQL Server database. The response from SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8"?>
<GET_EMP_IDResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/ScalarFunctions/dbo">
  <GET_EMP_IDResult>10072</GET_EMP_IDResult>
</GET_EMP_IDResponse>

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Invoking Table-Valued Functions in SQL Server by Using BizTalk Server

You can use the SQL adapter with BizTalk Server to invoke table-valued functions in SQL Server. The adapter exposes the table-valued functions as operations that can be invoked directly on SQL Server. For more information about how the adapter supports table-valued functions, see Executing Table-Valued Functions in SQL Server. For information about the structure of the SOAP message for invoking table-valued functions, see Message Schemas for Procedures and Functions.

Prerequisites

  • You must have completed the steps in Before You Develop BizTalk Applications.

  • You must have configured MSDTC on computers running the SQL adapter and SQL Server. See Before Developing Applications Using the SQL Adapter.

How to Invoke Table-valued Functions on a SQL Server Database

Performing an operation on a SQL Server database by using SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To invoke table-valued functions in SQL Server, these tasks are:

  1. Create a BizTalk project, and generate schema for the table-valued function you want to invoke in SQL Server.

  2. Create messages in the BizTalk project for sending and receiving messages from SQL Server.

  3. Create an orchestration to invoke the operation on SQL Server.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Generating Schema

This topic demonstrates how to invoke table-valued functions in SQL Server using the SQL adapter with BizTalk Server. To demonstrate this operation, in this topic you execute the TVF_EMPLOYEE function. This function takes an employee’s designation as a parameter and returns all the employee records with that designation, as a table type. The Employee table and the function are created by running the scripts provided with the samples. For more information about the script, see Samples.

To demonstrate how to invoke table-valued functions, schema is generated for the TVF_EMPLOYEE table-valued function. You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schemas.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which defined by the corresponding schema. You must now create messages for the orchestration and link them to schemas you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select TableFunctions.TableValuedFunction_dbo.TVF_EMPLOYEE, where TableFunctions is the name of your BizTalk project. TableValuedFunction_dbo is the schema generated for the TVF_EMPLOYEE function.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select TableFunctions.TableValuedFunction_dbo.TVF_EMPLOYEEResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and to receive responses, respectively. A sample orchestration for invoking a table-valued function resembles the following:

Orchestration for invoking a table-valued function

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.TVF.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.TVF.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.TVF.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.TVF.Request

After you have specified these properties, the message shapes and ports are connected, and your orchestration is complete.

You must now build the BizTalk solution and deploy it to BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for invoking table-valued functions in the SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to the SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the TVF_EMPLOYEE table-valued function you generated earlier. For example, the request message to invoke the TVF_EMPLOYEE function is:

Copy Code
<TVF_EMPLOYEE xmlns="http://schemas.microsoft.com/Sql/2008/05/TableValuedFunctions/dbo">
  <emp_desig>Tester</emp_desig>
</TVF_EMPLOYEE>

This request message invokes the TVF_EMPLOYEE function to retrieve employee records having the designation as “Tester”. See Message Schemas for Procedures and Functions for more information about the request message schema for invoking table-valued functions in SQL Server using the SQL adapter.

Note
If you do not specify a value for the parameter the adapter internally executes the function using the DEFAULT keyword, which means that the adapter executes the function by passing the default value for the parameter, if available as part of the function definition.

The orchestration consumes the message and sends it to the SQL Server database. The response from the SQL Server database is saved at the other FILE location defined as part of the orchestration. For example, the response from the SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<TVF_EMPLOYEEResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableValuedFunctions/dbo">
  <TVF_EMPLOYEEResult>
    <TVF_EMPLOYEE xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/TableFunctionReturnTables/dbo">
      <Employee_ID>10499</Employee_ID>
      <Name>John</Name>
      <Designation>Tester</Designation>
      <Salary>999999.00</Salary>
      <Last_Modified>AAAAAAAAJBM=</Last_Modified>
    </TVF_EMPLOYEE>
    <TVF_EMPLOYEE xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/TableFunctionReturnTables/dbo">
      ......
      ......
    </TVF_EMPLOYEE>
    ......
    ......
  </TVF_EMPLOYEEResult>
</TVF_EMPLOYEEResponse>

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using BizTalk Server

The SQL adapter exposes generic SQL Server operations such as ExecuteNonQuery, ExecuteReader, and ExecuteScalar. You can use these operations to execute any SQL statement on a SQL Server database. These operations differ based on the kind of response you get for the SQL statement. For more information about how the adapter supports these operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

This topic demonstrates how to perform an ExecuteReader operation using the SQL adapter with BizTalk Server. You can follow the same set of procedures described in this topic to perform ExecuteNonQuery and ExecuteScalar operations.

Prerequisites

  • You must have completed the steps in Before You Develop BizTalk Applications.

  • You must have configured MSDTC on computers running the SQL adapter and SQL Server. See Before Developing Applications Using the SQL Adapter.

How to Invoke the ExecuteReader operation on a SQL Server Database

Performing an operation on a SQL Server database by using SQL adapter with BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To invoke the ExecuteReader operation in SQL Server, these tasks are:

  1. Create a BizTalk project, and generate schema for the ExecuteReader operation.

  2. Create messages in the BizTalk project for sending and receiving messages from SQL Server.

  3. Create an orchestration to invoke the operation on SQL Server.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Generating Schema

This topic demonstrates how to invoke ExecuteReader operation in SQL Server using the SQL adapter with BizTalk Server. The ExecuteReader operation takes any SQL statement as a parameter and returns the result set for the operation as an array of DataSet. This topic shows how to execute the ADD_EMP_DETAILS stored procedure using the ExecuteReader operation. This stored procedure adds a record to the Employee table and returns the ID for the newly added employee. The tables and stored procedures used in the topic are created by running the scripts provided with the samples. For more information about the script, see Samples.

To demonstrate how to invoke ExecuteReader operation, schema is generated for the ExecuteReader operation. You must create a BizTalk project and use the Consume Adapter Service Add-in to generate the schema. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate schemas.

Defining Messages and Message Types

The schema that you generated earlier describes the “types” required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. You must now create messages for the orchestration and link them to schemas you generated in the previous step.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration, and then click Add.

  2. Open the Orchestration View window of the BizTalk project, if it is not already open. To do so, click View, point to Other Windows, and then click Orchestration View.

  3. In Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for the Message_1, do the following:

    Use this To do this

    Identifier

    Type Request

    Message Type

    From the drop-down list, expand Schemas, and then select Execute_Reader.GenericOperation.ExecuteReader, where Execute_Reader is the name of your BizTalk project. GenericOperation is the schema generated for the ExecuteReader operation.

  6. Repeat step 2 to create a new message. In the Properties pane for the new message, do the following:

    Use this To do this

    Identifier

    Type Response

    Message Type

    From the drop-down list, expand Schemas, and then select Execute_Reader.GenericOperation.ExecuteReaderResponse.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server. In this orchestration, you drop a request message at a defined receive location. The SQL adapter consumes this message and passes it on to SQL Server. The response from SQL Server is saved to another location. You must include Send and Receive shapes to send messages to SQL Server and to receive responses, respectively. A sample orchestration for invoking an ExecuteReader operation resembles the following:

Orchestration to invoke ExecuteReader operation

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SendMessage

Send

  • Set Name to SendMessage

ReceiveResponse

Receive

  • Set Name to ReceiveResponse

  • Set Activate to False

SendResponse

Send

  • Set Name to SendResponse

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

MessageIn

  • Set Identifier to MessageIn

  • Set Type to MessageInType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

LOBPort

  • Set Identifier to LOBPort

  • Set Type to LOBPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

ResponseOut

  • Set Identifier to ResponseOut

  • Set Type to ResponseOutType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes, and Connect Them to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Request

  • Set Operation to MessageIn.ExecuteReader.Request

SendMessage

  • Set Message to Request

  • Set Operation to LOBPort.ExecuteReader.Request

ReceiveResponse

  • Set Message to Response

  • Set Operation to LOBPort.ExecuteReader.Response

SendResponse

  • Set Message to Response

  • Set Operation to ResponseOut.ExecuteReader.Request

After you have specified these properties, the message shapes and ports are connected, and your orchestration is complete.

You must now build the BizTalk solution and deploy it to BizTalk Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where you will drop a request message. The BizTalk orchestration will consume the request message and send it to the SQL Server database.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the response message containing the response from the SQL Server database.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. You must also specify the action in the send port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter.

      Note
      Generating the schema using the Consume Adapter Service BizTalk Project Add-in also creates a binding file that contains information about the ports and the actions to be set for those ports. You can import this binding file from the BizTalk Server Administration console to create send ports (for outbound calls) or receive ports (for inbound calls). For more information, see Configuring a Physical Port Binding Using a Port Binding File.

Starting the Application

You must start the BizTalk application for invoking the ExecuteReader operation in the SQL Server database. For instructions on starting a BizTalk application, see http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The FILE receive port to receive request messages for the orchestration is running.

  • The FILE send port to receive the response messages from the orchestration is running.

  • The WCF-Custom or WCF-SQL send port to send messages to the SQL Server database is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, you must drop a request message to the FILE receive location. The schema for the request message must conform to the schema for the ExecuteReader operation you generated earlier. For example, the request message to invoke the ADD_EMP_DETAILS using an ExecuteReader operation is:

Copy Code
<ExecuteReader xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <Query>EXEC ADD_EMP_DETAILS Tom,Manager,100000</Query>
</ExecuteReader>

See Message Schemas for the ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations for more information about the request message schema for invoking an ExecuteReader operation using the SQL adapter.

Note
Within the <Query> tag, you can specify multiple SQL statements separated by a semi-colon.

The orchestration consumes the message and sends it to the SQL Server database. The response from the SQL Server database is saved at the other FILE location defined as part of the orchestration. The response for the ExecuteReader operation contains a result set as a DataSet array. For example, the response from the SQL Server database for the preceding request message is:

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<ExecuteReaderResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <ExecuteReaderResult>
    <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
      <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element msdata:IsDataSet="true" name="NewDataSet">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Employee_ID" type="xs:int" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <NewDataSet xmlns="">
          <NewTable>
            <Employee_ID>10767</Employee_ID>
          </NewTable>
        </NewDataSet>
      </diffgr:diffgram>
    </DataSet>
  </ExecuteReaderResult>
</ExecuteReaderResponse>

In the response, 10767 is the ID of the newly created employee.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create items such as the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Polling SQL Server by Using the SQL Adapter with BizTalk Server

You can configure the SQL adapter to receive polling-based data-changed messages from SQL Server. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set. Based on the type of polling message received, the adapter exposes three different ways of polling:

  • Polling. This operation returns a data set as part of the polling message. At design time, the schema of the database object being polled is not available. Instead, the schema is available as part of the polling message during run time.

  • TypedPolling. This operation returns a strongly-typed polling message. At design time, the schema of the database object is also available. You must use this operation for polling if you want to map certain elements from the polling message to another schema, which could be for another operation.

  • XmlPolling. This operation returns the polling message as an XML message. You must use this operation if you want to use SELECT statements or stored procedures that use the FOR XML clause to return data as XML messages. For more information about the FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

For more information about these polling operations, see Support for Polling.

Note
The SQL adapter enables adapter clients to have a single BizTalk application with more than one Polling or TypedPolling operations for the same database or table. To support such a scenario, the adapter includes a unique ID— InboundID—in the connection URI. This ID, when added to the connection URI, makes it unique, thereby enabling multiple polling operations in a single BizTalk application.

The topics in this section provide instructions on how to use Polling, TypedPolling, and XmlPolling in a BizTalk application. This section also provides information about how to use the InboundID connection property.

In This Section

  • Receiving Polling-based Data-changed Messages from SQL Server by Using BizTalk Server

  • Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using BizTalk Server

  • Receiving Polling Messages Using SELECT Statements with FOR XML Clause

  • Receiving Polling Messages Across Multiple Receive Ports

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Receiving Polling-based Data-changed Messages from SQL Server by Using BizTalk Server

You can configure the SQL adapter to receive periodic data-change messages for SQL Server tables or views. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set.

For more information on how the adapter supports polling, see Support for Polling. For information about the structure of the SOAP message for polling operations, see Message Schemas for the Polling and TypedPolling Operations.

Note
This topic demonstrates how to use the Polling inbound operation to use polling messages. The message for the Polling operation is not strongly-typed and schema of the object being polled is retrieved along with the message at run-time. If you want to get strongly-typed polling message, you must use the TypedPolling operation. You must also use the TypedPolling operation to have multiple polling operations in a single BizTalk application. For instructions on how to perform TypedPolling operation, see Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using BizTalk Server.

Important
If you want to have more than one polling operation in a single BizTalk application, you must specify an InboundID connection property as part of the connection URI to make it unique. With a unique connection URI, you can create multiple receive ports that poll the same database, or even the same table in a database. For more information, see Receiving Polling Messages Across Multiple Receive Ports.

How This Topic Demonstrates Polling

In this topic, to demonstrate how the SQL adapter supports receiving data change messages, create a BizTalk project and generate schema for the Polling operation. If you want to specify the polling related binding properties at design time, specify the PolledDataAvailableStatement as:

Copy Code
SELECT COUNT(*) FROM Employee

The PolledDataAvailableStatement must return a result set with the first cell containing a positive value. If the first cell does not contain a positive value, the adapter does not execute the polling statement.

As part of the polling statement, perform the following operations:

  • Select all the rows from the Employee table.

  • Execute a stored procedure (MOVE_EMP_DATA) to move all the records from the Employee table to an EmployeeHistory table.

  • Execute a stored procedure (ADD_EMP_DETAILS) to add a new record to the Employee table. This procedure takes the employee name, designation, and salary as parameters.

To perform these operations, you must specify the following for the PollingStatement binding property:

Copy Code
SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

After the polling statement is executed, all the records from the Employee table are selected and the message from SQL Server is dropped to a receive location. Once the MOVE_EMP_DATA stored procedure is executed by the adapter, all the records are moved to the EmployeeHistory table. Then, the ADD_EMP_DETAILS stored procedure is executed to add a new record to the Employee table. The next polling execution will only return a single record. This cycle continues until you disable the receive port that polls SQL Server.

Configuring a Polling Query with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure the adapter to receive data-change messages. You must specify these binding properties while configuring the receive port in the BizTalk Server Administration console.

Note
You may choose to specify these binding properties when generating the schema for the Polling operation, even though it is not mandatory. If you do so, the port binding file that the Consume Adapter Service Add-in generates as part of the metadata generation also contains the values you specify for the binding properties. You can later import this binding file in the BizTalk Server Administration console to create the WCF-custom or WCF-SQL receive port with the binding properties already set. For more information about creating a port using the binding file, see Configuring a Physical Port Binding Using a Port Binding File.

Binding Property | Description
InboundOperationType | Specifies whether you want to perform Polling, TypedPolling, or Notification inbound operation. Default is Polling.
PolledDataAvailableStatement | Specifies the SQL statement that the adapter executes to determine whether any data is available for polling. The SQL statement must return a result set consisting of rows and columns. Only if a row is available, the SQL statement specified for the PollingStatement binding property will be executed.
PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter waits for the remaining time in the interval.
PollingStatement | Specifies the SQL statement to poll the SQL Server database table. You can specify a simple SELECT statement or a stored procedure for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property. You can specify any number of SQL statements separated by a semi-colon.
PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to poll SQL Server, read further.

How to Receive Data-change Messages from the SQL Server Database

Performing an operation on the SQL Server database using SQL adapter with BizTalk Server involves the procedural tasks described in Building Blocks for Developing BizTalk Applications. To configure the adapter to receive data-change messages, these tasks are:

  1. Create a BizTalk project, and then generate schema for the Polling operation. Optionally, you can specify values for the PolledDataAvailableStatement and PollingStatement binding properties.

  2. Create a message in the BizTalk project for receiving messages from the SQL Server database.

  3. Create an orchestration to receive messages from the SQL Server database and to save them to a folder.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

    Important
    For inbound polling scenarios you must always configure a one-way WCF-Custom or WCF-SQL receive port. Two-way WCF-Custom or WCF-SQL receive ports are not supported for inbound operations.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Generating Schema

You must generate the schema for the Polling operation. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate the schema. Perform the following tasks when generating the schema. Skip the first step if you do not want to specify the binding properties at design-time.

  1. Specify a value for PolledDataAvailableStatement and PollingStatement binding properties while generating the schema. For more information about this binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

    For instructions on how to specify binding properties, see Specifying Binding Properties.

  2. Select the contract type as Service (Inbound operation).

  3. Generate schema for the Polling operation.

Defining Messages and Message Types

The schema that you generated earlier describes the "types" required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. Once the schema is generated, you must link it to the messages from the Orchestration view of the BizTalk project.

For this topic, you must create one message to receive messages from the SQL Server database.

Perform the following steps to create messages and link them to schema.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From the Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration and then click Add.

  2. Open the orchestration view window of the BizTalk project, if it is not already open. Click View, point to Other Windows, and then click Orchestration View.

  3. In the Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for Message_1, do the following:

    Use this To do this

    Identifier

    Type Receive.

    Message Type

    From the drop-down list, expand Schemas, and select PollingQuery.Polling, where PollingQuery is the name of your BizTalk project. Polling is the schema generated for the Polling operation.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for receiving polling-based data-change messages from the SQL Server database. In this orchestration, the adapter receives the response of the select statement specified for the PollingStatement binding property. The response for the SELECT statement is saved to a FILE location. A typical orchestration for polling a SQL Server database would contain:

  • Receive and Send shapes to receive messages from SQL Server and send to a FILE port, respectively.

  • A one-way receive port to receive messages from SQL Server.

    Important
    For inbound polling scenarios you must always configure a one-way receive port. Two-way receive ports are not supported for inbound operations.

  • A one-way send port to send polling responses from a SQL Server database to a folder.

A sample orchestration resembles the following.

Orchestration for polling a SQL Server database

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SaveMessage

Send

  • Set Name to SaveMessage

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

SQLReceivePort

  • Set Identifier to SQLReceivePort

  • Set Type to SQLReceivePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

SaveMessagePort

  • Set Identifier to SaveMessagePort

  • Set Type to SaveMessagePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes and Connect to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Receive

  • Set Operation to SQLReceivePort.Polling.Request

SaveMessage

  • Set Message to Receive

  • Set Operation to SaveMessagePort.Polling.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see "Building and Running Orchestrations" at http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the messages from the SQL Server database. These messages will be in response to the polling statement that you specify for the receive port.

    • Define a physical WCF-Custom or WCF-SQL one-way receive port. This port polls the SQL Server database with the polling statement you specify for the port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. Make sure you specify the following binding properties for the receive port.

      Important
      You do not need to perform this step if you specified the binding properties at design-time. In such a case, you can create a WCF-custom or WCF-SQL receive port, with the required binding properties set, by importing the binding file created by the Consume Adapter Service Add-in. For more information see Configuring a Physical Port Binding Using a Port Binding File.

      Binding Property Value

      InboundOperationType

      Make sure you set this to Polling.

      PolledDataAvailableStatement

      Make sure you specify a SQL statement. For this topic, specify:

      Copy Code
      SELECT COUNT(*) FROM Employee

      PollingStatement

      Make sure you specify the polling statement. For this topic, specify:

      Copy Code
      SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000
      For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      We recommend configuring the transaction isolation level and the transaction timeout while performing inbound operations using the SQL adapter. You can do so by adding the service behavior while configuring the WCF-Custom or WCF-SQL receive port. For instruction on how to add the service behavior, see Configure Transaction Isolation Level and Transaction Timeout.

Starting the Application

You must start the BizTalk application for receiving messages from the SQL Server database. For instructions on starting a BizTalk application, see “How to Start an Orchestration” at http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The WCF-Custom or WCF-SQL one-way receive port, which polls the SQL Server database using the statements specified for the PollingStatement binding property, is running.

  • The FILE send port, which receives messages from SQL Server, is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, the following set of actions take place, in the same sequence:

  • The adapter executes the PolledDataAvailableStatement on the Employee table and determines that the table has records for polling.

  • The adapter executes the polling statement. Because the polling statement consists of a SELECT statement and stored procedures, the adapter will execute all the statements one after the other.

    • The adapter first executes the SELECT statement that returns all the records in the Employee table.

    • The adapter then executes the MOVE_EMP_DATA stored procedure that moves all data from the Employee table to the EmployeeHistory table. This stored procedure does not return any value.

    • The adapter then executes the ADD_EMP_DETAILS stored procedure that adds one record to the Employee table. This stored procedure returns the Employee ID for the inserted record.

    So, the message received from SQL Server will contain multiple result sets (for SELECT statement and for ADD_EMP_DETAILS stored procedure), and will resemble the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Polling xmlns="http://schemas.microsoft.com/Sql/2008/05/Polling/">
  <PolledData>
    <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
      <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element msdata:IsDataSet="true" name="NewDataSet">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Employee_ID" type="xs:int" />
                    <xs:element minOccurs="0" name="Name" type="xs:string" />
                    <xs:element minOccurs="0" name="DOJ" type="xs:dateTime" />
                    <xs:element minOccurs="0" name="Designation" type="xs:string" />
                    <xs:element minOccurs="0" name="Job_Description" type="xs:string" />
                    <xs:element minOccurs="0" name="Photo" type="xs:base64Binary" />
                    <xs:element minOccurs="0" name="Rating" type="xs:string" />
                    <xs:element minOccurs="0" name="Salary" type="xs:decimal" />
                    <xs:element minOccurs="0" name="Last_Modified" type="xs:base64Binary" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <NewDataSet xmlns="">
          <NewTable>
            <Employee_ID>10001</Employee_ID>
            <Name>John</Name>
            <Designation>Tester</Designation>
            <Salary>100000.00</Salary>
            <Last_Modified>AAAAAAAAF34=</Last_Modified>
          </NewTable>
          ........
          ........
          <NewTable>
            <Employee_ID>10005</Employee_ID>
            <Name>Wilson</Name>
            <Designation>Tester3</Designation>
            <Salary>100000.00</Salary>
            <Last_Modified>AAAAAAAAF4E=</Last_Modified>
          </NewTable>
        </NewDataSet>
      </diffgr:diffgram>
    </DataSet>
    <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
      <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element msdata:IsDataSet="true" name="NewDataSet">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="Employee_ID" type="xs:int" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <NewDataSet xmlns="">
          <NewTable>
            <Employee_ID>10006</Employee_ID>
          </NewTable>
        </NewDataSet>
      </diffgr:diffgram>
    </DataSet>
  </PolledData>
</Polling>
    The preceding response contains two data sets. The first data set contains the response for the SELECT statement. The SELECT statement selects all the records in the Employee table. The second data set is for the ADD_EMP_DETAILS stored procedure. This stored procedure adds a record to the Employee table and returns the employee ID for the new record.

    Note
    The MOVE_EMP_DATA stored procedure does not return a result set. So, there is no corresponding data set in the response message.

  • When the adapter executes the PollDataAvailableStatement again, it finds one record that was inserted by the ADD_EMP_DETAILS stored procedure. The adapter then executes all three statements that are specified for the PollingStatement binding property. This time, the response from SQL Server contains just one record for the SELECT statement and one record for the ADD_EMP_DETAILS stored procedure. All subsequent polls will return similar responses.

Note
The SQL adapter will continue to poll until you explicitly disable the receive port from the BizTalk Server Administration console.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with BizTalk Server


Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using BizTalk Server

You can configure the SQL adapter to receive strongly-typed polling messages from SQL Server. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set.

You must use strongly-typed polling in a scenario where you want to map the elements in the polling message to any other schema. The schema you want to map to could be for another operation on SQL Server. For example, you could map certain elements in the polling message to the schema for an Insert operation on another table. So, the values in the polling message serve as parameters for the Insert operation. In a simpler scenario, you could map the schema for strongly-typed polling message to a schema file that just stores information.

Important
If you want to have more than one polling operation in a single BizTalk application, you must specify an InboundID connection property as part of the connection URI to make it unique. With a unique connection URI, you can create multiple receive ports that poll the same database, or even the same table in a database. For more information, see Receiving Polling Messages Across Multiple Receive Ports.

For more information about how the adapter supports strongly-typed polling, see Support for Polling. For more information about the message schema for strongly-typed polling, see Message Schemas for the Polling and TypedPolling Operations.

How this Topic Demonstrates Strongly-typed Polling

This topic demonstrates how to use strongly-typed polling to map the polling message to another schema. This topic shows how to create a BizTalk project and generate schema for TypedPolling operation. Before generating schema for TypedPolling operation, you must do the following:

  • You must specify an InboundID as part of the connection URI.

  • You must specify a polling statement for the PollingStatement binding property.

As part of the polling statement, perform the following operations:

  • Select all the rows from the Employee table.

  • Execute a stored procedure (MOVE_EMP_DATA) to move all the records from the Employee table to an EmployeeHistory table.

  • Execute a stored procedure (ADD_EMP_DETAILS) to add a new record to the Employee table. This procedure takes the employee name, designation, and salary as parameters.

To perform these operations, you must specify the following for the PollingStatement binding property:

Copy Code
SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

Because you generate schema for the TypedPolling operation, the schema is strongly-typed and contains all the elements that will be included in the polling message.

As part of the same BizTalk project, you add another schema file, for example EmployeeDetails.xsd. The schema for EmployeeDetails.xsd resembles the following:

Copy Code
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Typed_Polling.EmployeeDetails" elementFormDefault="qualified" targetNamespace="http://Typed_Polling.EmployeeDetails" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="EmployeeDetails">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Employee_Info" type="xs:string" />
        <xs:element name="Employee_Profile" type="xs:string" />
        <xs:element name="Employee_Performance" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

You also add a BizTalk Mapper to the project to map the elements from the Employee table (received as polling message) to the elements in the EmployeeDetails.xsd schema. As part of the map, you combine one or more elements from the polling message and map it to a single element in the EmployeeDetails schema. You can do so by using the String Concatenate functoid.

Finally, as part of the BizTalk project, a file conforming to the EmployeeDetails.xsd schema is dropped to a FILE send port.

Configuring Typed Polling with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure the adapter to receive data-change messages. Other than the PollingStatement binding property, all the other binding properties listed in this section are required while configuring the receive port in the BizTalk Server Administration console. You must specify the PollingStatement binding property before generating schema for the TypedPolling operation.

Note
For typed polling, you must specify the PollingStatement biding property while generating the schema. You can choose to specify the other binding properties as well while generating the schema, even though they are not mandatory. If you do specify the binding properties, the port binding file that the Consume Adapter Service Add-in generates as part of the metadata generation also contains the values you specify for the binding properties. You can later import this binding file in the BizTalk Server Administration console to create the WCF-custom or WCF-SQL receive port with the binding properties already set. For more information about creating a port using the binding file, see Configuring a Physical Port Binding Using a Port Binding File.

Binding Property Description

InboundOperationType

Specifies whether you want to perform Polling, TypedPolling, or Notification inbound operation. Default is Polling. To receive strongly-typed polling messages, set this to TypedPolling.

PolledDataAvailableStatement

Specifies the SQL statement that the adapter executes to determine whether any data is available for polling. The SQL statement must return a result set consisting of rows and columns. Only if a row is available, the SQL statement specified for the PollingStatement binding property will be executed.

PollingIntervalInSeconds

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter waits for the remaining time in the interval.

PollingStatement

Specifies the SQL statement to poll the SQL Server database table. You can specify a simple SELECT statement or a stored procedure for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property. You can specify any number of SQL statements separated by a semi-colon.

Important
For TypedPolling, you must specify this binding property before generating metadata.

PollWhileDataFound

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to poll SQL Server, read further.

How to Receive Strongly-typed Data-change Messages from the SQL Server Database

Performing an operation on the SQL Server database using SQL adapter with BizTalk Server involves the procedural tasks described in Building Blocks for Developing BizTalk Applications. To configure the adapter to receive strongly-typed data-change messages, these tasks are:

  1. Create a BizTalk project, and then generate schema for the TypedPolling operation. You must specify the InboundID connection property and the PollingStatement binding property while generating schema. For example, a connection URI with the inbound ID specified resembles the following:

    Copy Code
    mssql://mysqlserver//mysqldatabase?InboundID=mydatabaseId
  2. Create a message in the BizTalk project for receiving messages from the SQL Server database.

  3. Create an orchestration to receive messages from the SQL Server database and to save them to a folder.

  4. Add a schema, for example, EmployeeDetails.xsd, in the BizTalk project.

  5. Add a BizTalk Mapper to map the schema for the polling message to EmployeeDetails.xsd schema.

  6. Build and deploy the BizTalk project.

  7. Configure the BizTalk application by creating physical send and receive ports.

    Important
    For inbound polling scenarios you must always configure a one-way WCF-Custom or WCF-SQL receive port. Two-way WCF-Custom or WCF-SQL receive ports are not supported for inbound operations.

  8. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Sample Based on This Topic

A sample, TypedPolling, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

You must generate the schema for the TypedPolling operation. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate the schema. Perform the following tasks when generating the schema.

  1. Specify the InboundID connection property while specifying the connection URI. For this topic, you can specify the InboundID as Employee. For more information about the connection URI, see SQL Server Connection URI.

  2. Specify a value for the PollingStatement binding property. For more information about this binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

    For instructions on how to specify binding properties, see Specifying Binding Properties.

  3. Select the contract type as Service (Inbound operation).

  4. Generate schema for the TypedPolling operation.

Defining Messages and Message Types

The schema that you generated earlier describes the "types" required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. Once the schema is generated, you must link it to the messages from the Orchestration view of the BizTalk project.

For this topic, you must create one message to receive messages from the SQL Server database.

Perform the following steps to create messages and link them to schema.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From the Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration and then click Add.

  2. Open the orchestration view window of the BizTalk project, if it is not already open. Click View, point to Other Windows, and then click Orchestration View.

  3. In the Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for Message_1, do the following:

    Use this To do this

    Identifier

    Type PollingMessage.

    Message Type

    From the drop-down list, expand Schemas, and select Typed_Polling.TypedPolling_Employee.TypedPolling, where Typed_Polling is the name of your BizTalk project. TypedPolling_Employee is the schema generated for the TypedPolling operation.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for receiving polling-based data-change messages from the SQL Server database. In this orchestration, the adapter receives the polling message for the specified polling statement. The BizTalk Mapper then maps the polling message schema to the EmployeeDetails.xsd schema. The mapped message is then saved to a FILE location. A typical orchestration for receiving strongly-typed polling message from a SQL Server database would contain:

  • Receive and Send shapes to receive messages from SQL Server and send to a FILE port, respectively.

  • A one-way receive port to receive messages from SQL Server.

    Important
    For inbound polling scenarios you must always configure a one-way receive port. Two-way receive ports are not supported for inbound operations.

  • A one-way send port to send polling responses from a SQL Server database to a folder.

  • A BizTalk Mapper to map the schema of the polling message to any other schema.

A sample orchestration resembles the following.

Orchestration for strongly-typed polling

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SaveMessage

Send

  • Set Name to SaveMessage

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

SQLReceivePort

  • Set Identifier to SQLReceivePort

  • Set Type to SQLReceivePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

SaveMessagePort

  • Set Identifier to SaveMessagePort

  • Set Type to SaveMessagePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes and Connect to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to PollingMessage

  • Set Operation to SQLReceivePort.TypedPolling.Request

SaveMessage

  • Set Message to PollingMessage

  • Set Operation to SaveMessagePort.TypedPolling.Request

After you have specified these properties, the message shapes and ports are connected.

Add a BizTalk Mapper

You must add a BizTalk Mapper to the orchestration to map the polling message schema to the EmployeeDetails.xsd schema. In the BizTalk Server Administration console, you will use this Mapper to map the schema for the polling message to the EmployeeDetails.xsd schema.

To add a BizTalk Mapper

  1. Add a BizTalk Mapper to the BizTalk project. Right-click the BizTalk project, point to Add, and click New Item.

    In the Add New Item dialog box, from the left pane, select Map Files. From the right pane, select Map. Specify a name for the map, such as MapSchema.btm. Click Add.

  2. From the Source Schema pane, click Open Source Schema.

  3. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and select the schema for the polling message. For this topic, select Typed_Polling.TypedPolling_Employee. Click OK.

  4. In the Root Node for Source Schema dialog box, select TypedPolling and click OK.

  5. From the Destination Schema pane, click Open Destination Schema.

  6. In the BizTalk Type Picker dialog box, expand the project name, expand Schemas, and select the schema for EmployeeDetails. For this topic, select Typed_Polling.EmployeeDetails. Click OK.

  7. In the source schema of polling message, expand the TypedPollingResultSet0 node and the subsequent nodes to see the elements that are returned in the polling message. In the destination schema, expand the EmployeeDetails node to see the different elements in the schema. For this topic, you must map the schemas in such a way that:

    • Employee_ID and Name in the source schema must map to Employee_Info in the destination schema.

    • Designation and Job_Description in the source schema must map to Employee_Profile in the destination schema.

    • Rating and Salary in the source schema must map to Employee_Performance in the destination schema.

    To combine more than one node in source schema and map them to a single node in the destination schema, you must use the String Concatenate functoid. For more information about the functoid, see http://go.microsoft.com/fwlink/?LinkId=123474.

  8. To use the String Concatenate functoid:

    1. From the Toolbox, drag the String Concatenate functoid and drop it on the Mapper grid.

    2. Connect the Employee_ID and Name elements in the source schema to the functoid.

    3. Connect the functoid to the Employee_Info element in the destination schema.

    4. Repeat these steps for all the elements that you want to map. A finished map will resemble the following:

      Map the strongly-typed polling schema
    5. Save the map.

The orchestration is complete after you create the Mapper. You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see "Building and Running Orchestrations" at http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a physical WCF-Custom or WCF-SQL one-way receive port. This port polls the SQL Server database with the polling statement you specify for the port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. Make sure you specify the following binding properties for the receive port.

      Important
      Make sure you specify the InboundID as part of the connection URI. The inbound ID must be the same you specified while generating the schema.

      Important
      You do not need to perform this step if you specified the binding properties at design-time. In such a case, you can create a WCF-custom or WCF-SQL receive port, with the required binding properties set, by importing the binding file created by the Consume Adapter Service Add-in. For more information see Configuring a Physical Port Binding Using a Port Binding File.

      Binding Property Value

      InboundOperationType

      Make sure you set this to TypedPolling.

      PolledDataAvailableStatement

      Make sure you specify the same SQL statement you specified while generating the schema, which is:

      Copy Code
      SELECT COUNT(*) FROM Employee

      PollingStatement

      Make sure you provide the same polling statement you specified while generating the schema, which is:

      Copy Code
      SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000
      For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      We recommend configuring the transaction isolation level and the transaction timeout while performing inbound operations using the SQL adapter. You can do so by adding the service behavior while configuring the WCF-Custom or WCF-SQL receive port. For instruction on how to add the service behavior, see Configure Transaction Isolation Level and Transaction Timeout.

    • Define a FILE send port where the adapter will drop the message. This send port will also use the map you created in the orchestration to map the polling message to a message conforming to the EmployeeDetails.xsd schema. Perform the following steps to configure the FILE send port to use the map.

      1. Create a FILE send port.

      2. From the left pane of the send port properties dialog box, click Outbound Maps. From the right pane, click the field under the Map column, and from the drop-down select MapSchema. Click OK.

        Configure outbound map on the FILE send port

Starting the Application

You must start the BizTalk application for receiving messages from the SQL Server database. For instructions on starting a BizTalk application, see “How to Start an Orchestration” at http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The WCF-Custom or WCF-SQL one-way receive port, which polls the SQL Server database using the statements specified for the PollingStatement binding property, is running.

  • The FILE send port, which will map the polling message to the EmployeeDetails schema, is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, the following set of actions take place, in the same sequence:

  • The adapter executes the PolledDataAvailableStatement on the Employee table and determines that the table has records for polling.

  • The adapter executes the polling statement. Because the polling statement consists of a SELECT statement and stored procedures, the adapter will execute all the statements one after the other.

    • The adapter first executes the SELECT statement that returns all the records in the Employee table.

    • The adapter then executes the MOVE_EMP_DATA stored procedure that moves all data from the Employee table to the EmployeeHistory table. This stored procedure does not return any value.

    • The adapter then executes the ADD_EMP_DETAILS stored procedure that adds one record to the Employee table. This stored procedure returns the Employee ID for the inserted record.

    After the polling statement is executed and the message is received, the polling message gets send to the FILE send port. Here, the outbound map (MapSchema)configured on the send port maps the polling message to the EmployeeDetails schema and drops the message to a file location. The message resembles the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<EmployeeDetails xmlns="http://Typed_Polling.EmployeeDetails">
  <Employee_Info>10751John</Employee_Info>
  <Employee_Profile>TesterManagesTesting</Employee_Profile>
  <Employee_Performance>100000</EmployeePerformance>
</EmployeeDetails>
    In the preceding response, you can notice that the Employee_Info element contains a combination of employee ID (10751) and employee name (John). The other elements also contain combinations as mapped in the Mapper you created as part of the orchestration.

Note
The SQL adapter will continue to poll until you explicitly disable the receive port from the BizTalk Server Administration console.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with BizTalk Server


Receiving Polling Messages Using SELECT Statements with FOR XML Clause

You can configure the SQL adapter to receive periodic data-change messages for SQL Server tables or views by using SELECT statements or stored procedures that include a FOR XML clause. You can specify these statements as polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set.

For more information on how the adapter supports polling, see Support for Polling. For information about the structure of the SOAP message for polling operations, see Message Schemas for the Polling and TypedPolling Operations. For more information about the FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

Note
This topic demonstrates how to use the XmlPolling inbound operation to receive polling messages. The XmlPolling operation is used to poll a SQL Server database using SELECT statements or stored procedures that include a FOR XML clause. The message for the XmlPolling operation includes the xml message received by executing the SELECT statement or the stored procedure in SQL Server Management Studio.

You can also use the adapter to receive different types of polling messages.

  • If you want to get a weakly-typed polling message, you must use the Polling Operation. For more information, see Receiving Polling-based Data-changed Messages from SQL Server by Using BizTalk Server.

  • If you want to get strongly-typed polling message, you must use the TypedPolling operation. You must also use the TypedPolling operation to have multiple polling operations in a single BizTalk application. For instructions on how to perform TypedPolling operation, see Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using BizTalk Server.

Important
If you want to have more than one polling operation in a single BizTalk application, you must specify an InboundID connection property as part of the connection URI to make it unique. With a unique connection URI, you can create multiple receive ports that poll the same database, or even the same table in a database. For more information, see Receiving Polling Messages Across Multiple Receive Ports.

How This Topic Demonstrates Polling

In this topic, to demonstrate how the SQL adapter supports receiving data change messages, we use a SELECT statement with the FOR XML clause to poll the SQL Server database. When you invoke such a statement in SQL Server Management Studio, the output is in the form of an xml message. To use such statements to poll a SQL Server database, you must have the schema of the response xml message. The SQL adapter requires this schema to receive a polling message after executing a SELECT statement with the FOR XML clause. So, to use a SELECT statement with FOR XML clause to poll the SQL Server database, you must perform the following set of tasks.

  1. Generate the schema for the XML response message for the SELECT statement with FOR XML clause.

  2. Create a BizTalk project and add the generated schema to the project.

  3. Create a message in the BizTalk project for receiving XML response messages from the SQL Server database.

  4. Create an orchestration to receive messages from the SQL Server database and to save them to a folder.

  5. Build and deploy the BizTalk project.

  6. Configure the BizTalk application by creating physical send and receive ports.

    Important
    For inbound polling scenarios you must always configure a one-way WCF-Custom or WCF-SQL receive port. Two-way WCF-Custom or WCF-SQL receive ports are not supported for inbound operations.

  7. Start the BizTalk application.

Generating Schema for the Response Message for SELECT Statement

You can generate the schema for the response message for the SELECT statement by including the xmlschema clause with the for xml clause. In this topic, we use a SELECT statement to retrieve employee details for a given employee ID. To retrieve the schema by executing a SELECT statement, the SELECT statement must be written in the following manner:

Copy Code
SELECT Employee_ID ,Name ,Designation FROM Employee for xml auto, xmlschema

Execute this SELECT statement to get the schema for the response message. Save the schema. You must now create a BizTalk project in Visual Studio and add this schema to the project. For this example, you can name this schema as PollingResponse.xsd.

Important
Make sure you remove the xmlschema clause after you have executed the SELECT statement to generate the schema. If you fail to do this, when you finally execute the SELECT statement through BizTalk as part of the XmlPolling operation, you will again generate the schema in the response message. So, to get the response message as xml you must remove the xmlschema clause.

To add the schema to a BizTalk project

  1. Create a BizTalk project in Visual Studio.

  2. Add the response schema you generated for the stored procedure to the BizTalk project. Right-click the BizTalk project in the Solution Explorer, point to Add, and then click Existing Item. In the Add Existing Item dialog box, navigate to the location where you saved the schema and click Add.

  3. Open the schema in Visual Studio and make the following changes.

    1. Add a node to the schema and move the existing root node under this newly added node. Give a name to the root node. For this topic, rename the root node to Root.

    2. The response schema generated for the SELECT statement references a sqltypes.xsd. You can get the sqltypes.xsd schema from http://go.microsoft.com/fwlink/?LinkId=131087. Add the sqltypes.xsd schema to the BizTalk project.

    3. In the schema generated for the SELECT statement, change the value of import schemaLocation to the following.

      Copy Code
      import schemaLocation=”sqltypes.xsd”
      You do this because you have already added the sqltypes.xsd schema to your BizTalk project.

    4. Provide a target namespace for the schema. Click the <Schema> node, and in the properties pane, specify a namespace in the Target Namespace property. For this topic, give the namespace as http://ForXmlPolling/namespace.

Defining Messages and Message Types

The schema that you generated earlier describes the "types" required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. Once the schema is generated, you must link it to the messages from the Orchestration view of the BizTalk project.

For this topic, you must create one message to receive messages from the SQL Server database.

Perform the following steps to create messages and link them to schema.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From the Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration and then click Add.

  2. Open the orchestration view window of the BizTalk project, if it is not already open. Click View, point to Other Windows, and then click Orchestration View.

  3. In the Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for Message_1, do the following:

    Use this To do this

    Identifier

    Type PollingMessage.

    Message Type

    From the drop-down list, expand Schemas, and select ForXMLPolling.PollingResponse, where ForXMLPolling is the name of your BizTalk project. PollingResponse is the name of the response schema generated by executing the SELECT statement as described under Generating Schema for the Response Message for SELECT Statement.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for receiving polling-based data-change messages from the SQL Server database. In this orchestration, the adapter receives the response of the select statement specified for the PollingStatement binding property. The response for the SELECT statement is saved to a FILE location. A typical orchestration for polling a SQL Server database would contain:

  • Receive and Send shapes to receive messages from SQL Server and send to a FILE port, respectively.

  • A one-way receive port to receive messages from SQL Server.

    Important
    For inbound polling scenarios you must always configure a one-way receive port. Two-way receive ports are not supported for inbound operations.

  • A one-way send port to send polling responses from a SQL Server database to a folder.

A sample orchestration resembles the following.

Orchestration for polling a SQL Server database

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveMessage

Receive

  • Set Name to ReceiveMessage

  • Set Activate to True

SaveMessage

Send

  • Set Name to SaveMessage

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

SQLReceivePort

  • Set Identifier to SQLReceivePort

  • Set Type to SQLReceivePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

SaveMessagePort

  • Set Identifier to SaveMessagePort

  • Set Type to SaveMessagePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes and Connect to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveMessage

  • Set Message to Receive

  • Set Operation to SQLReceivePort.XmlPolling.Request

SaveMessage

  • Set Message to Receive

  • Set Operation to SaveMessagePort.XmlPolling.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see "Building and Running Orchestrations" at http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the messages from the SQL Server database. These messages will be in response to the polling statement that you specify for the receive port.

    • Define a physical WCF-Custom or WCF-SQL one-way receive port. This port polls the SQL Server database with the polling statement you specify for the port. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. Make sure you specify the following binding properties for the receive port.

      Important
      You do not need to perform this step if you specified the binding properties at design-time. In such a case, you can create a WCF-custom or WCF-SQL receive port, with the required binding properties set, by importing the binding file created by the Consume Adapter Service Add-in. For more information see Configuring a Physical Port Binding Using a Port Binding File.

      Binding Property Value

      InboundOperationType

      Make sure you set this to XmlPolling.

      PolledDataAvailableStatement

      Make sure you specify a SQL statement. For this topic, specify:

      Copy Code
      SELECT COUNT(*) FROM Employee

      PollingStatement

      Make sure you provide the same statement, without the xmlschema clause, that you specified while generating the schema as described in Generating Schema for the Response Message for SELECT Statement.

      Copy Code
      SELECT Employee_ID ,Name ,Designation FROM Employee for xml auto
      Note
      Note that the SELECT statement does not contain the xmlschema clause.

      XmlStoredProcedureRootNodeName

      Specify the name of the root node that you added to the response schema you generated for the SELECT statement, as described under Generating Schema for the Response Message for SELECT Statement. For this topic, set this to Root.

      XmlStoredProcedureRootNodeNamespace

      Specify the target namespace for the response schema you generated for the SELECT statement, as described under Generating Schema for the Response Message for Stored Procedure. For this topic, set this to http://ForXmlPolling/namespace.

      For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      We recommend configuring the transaction isolation level and the transaction timeout while performing inbound operations using the SQL adapter. You can do so by adding the service behavior while configuring the WCF-Custom or WCF-SQL receive port. For instruction on how to add the service behavior, see Configure Transaction Isolation Level and Transaction Timeout.

Starting the Application

You must start the BizTalk application for receiving messages from the SQL Server database. For instructions on starting a BizTalk application, see “How to Start an Orchestration” at http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The WCF-Custom or WCF-SQL one-way receive port, which polls the SQL Server database using the statements specified for the PollingStatement binding property, is running.

  • The FILE send port, which receives messages from SQL Server, is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you run the application, the following set of actions take place, in the same sequence:

  • The adapter executes the PolledDataAvailableStatement on the Employee table and determines that the table has records for polling.

  • The adapter executes the polling statement and receives a polling message from the SQL Server database. Because the polling statement consists of a SELECT statement with a FOR XML clause, the polling message received by the adapter resembles the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Root xmlns="http://ForXmlPolling/namespace">
  <Employee Employee_ID="10765" Name="John" Designation="Tester" xmlns="" />
  <Employee Employee_ID="10766" Name="Sam" Designation="Manager" xmlns="" />
  .....
  .....
</Root>
    Notice that the polling message is received in the same schema as generated by executing the SELECT statement with the xmlschema clause. Also note that the root node and the namespace is the same you specified as values for XmlStoredProcedureRootNodeName and XmlStoredProcedureRootNodeNamespace binding properties respectively.

Note
The SQL adapter will continue to poll until you explicitly disable the receive port from the BizTalk Server Administration console.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with BizTalk Server


Receiving Polling Messages Across Multiple Receive Ports

Consider a scenario where you want to create a BizTalk application that includes two polling operations. Each polling operation polls separate tables, Employee and Customer, from the same database. When you deploy such an application in BizTalk Server Administration console, you will need to create two receive ports. The connection URI for each receive port will be:

Copy Code
mssql://<server_name>/<database_instance_name>/<datbase_name>

Because both receive ports are receiving polling messages from the same database on the same server, the connection URI for both will be the same. However, a BizTalk application cannot have two receive ports with the same connection URI.

To enable adapter clients to have two receive ports that poll the same database (or even the same table in a database) in a BizTalk application, the SQL adapter provides a connection property, InboundID. You can specify any value for this connection property. By adding the inbound ID, a connection URI becomes unique. For example:

The connection URI for the port receiving polling messages for the Employee table can be:

Copy Code
mssql://<server_name>/<database_instance_name>/<datbase_name>?InboundID=Employee

Similarly, the connection URI for the port receiving polling messages for the Customer table can be:

Copy Code
mssql://<server_name>/<database_instance_name>/<datbase_name>?InboundID=Customer

Because the connection URIs become unique by adding the InboundID property, you can now have multiple receive ports polling the same database or table in a single BizTalk application.

Important
You can choose to specify the InboundID connection property for both the Polling and TypedPolling operations.

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with BizTalk Server


Receiving Query Notifications by Using BizTalk Server

You can configure the SQL adapter to receive notification messages for SQL Server tables or views. You can specify a SQL statement that the adapter uses to register for notifications with SQL Server. The notification statement can be a SELECT statement or a stored procedure that returns a result set. For more information about query notifications, see “Using Query Notifications” at http://go.microsoft.com/fwlink/?LinkId=122159. For information about queries that can be used for query notifications, see “Creating a Query for Notification” at http://go.microsoft.com/fwlink/?LinkId=122160.

Receiving query notifications from SQL Server is similar to polling SQL Server, with a few key differences. For the list of differences, see Receiving Query Notifications.

Following are some scenarios in which you can configure the SQL adapter with BizTalk Server to receive notifications from SQL Server:

  • Adapter clients get only “incremental” notification, for example, only for those changes that were made to a database table since the last notification.

  • If many rows are inserted into a database table, the adapter clients can configure multiple receive locations to load-balance receiving notifications.

  • If the receive location on which the adapter clients are receiving notifications goes down, the adapter clients can configure the adapter to receive a notification as soon as the receive location is up again. The clients must also implement the logic in their application to process the records that may have been inserted, updated, or deleted while the receive location was down.

Once the adapter clients receive a notification message, they can perform specific tasks based on the kind of notification received. For example, a BizTalk orchestration can be designed in such a way that it performs one set of tasks if an insert notification is received and another set of tasks if an update notification is received.

The topics in this section provide information about how to configure the adapter for each of these scenarios. To start getting notifications from SQL Server using the SQL adapter, you must specify certain binding properties. For more information about how the adapter supports receiving messages, see Receiving Query Notifications. For more information about the binding properties related to notifications, see Working with BizTalk Adapter for SQL Server Binding Properties. For more information about the structure of notification messages, see Message Schemas for Query Notification.

You must also perform the following tasks on SQL Server to enable query notifications.

  • You must enable Service Broker for the SQL Server database.

  • You must ensure that the adapter client has the necessary permissions to execute commands to request notification.

For more information about these tasks, see “Enabling Query Notifications” at http://go.microsoft.com/fwlink/?LinkID=122323.

In This Section

  • Considerations for Receiving Query Notifications Using the Adapter

  • Processing Notification Messages to Perform Specific Tasks

  • Receiving Query Notifications Incrementally Using BizTalk Server

  • Receiving Query Notifications On Multiple Receive Locations

  • Receiving Query Notifications After a Receive Location Breakdown

See Also

Other Resources

Developing BizTalk Applications

© 2013 Microsoft Corporation. All rights reserved.


Considerations for Receiving Query Notifications Using the Adapter

This topic provides some considerations and best practices to keep in mind while using the SQL adapter to receive query notifications from a SQL Server database.

Considerations While Using the Adapter to Receive Notifications

You must consider the following while using the SQL adapter to receive query notifications:

  • The SQL adapter receives the query notification from SQL Server, and then simply passes on the notification to the adapter clients. The adapter does not distinguish between the notifications for different operations (i.e., the adapter does not have any information whether a particular notification is for an Insert operation or an Update operation).

  • The notification message for an operation is not affected by the number of records affected by that operation. For example, regardless of the number of records inserted, updated, or deleted in a SQL Server database table, the adapter client receives only one notification message.

  • We recommend that the adapter client application contain the logic to interpret the type of notification received from SQL Server. The notification type can be determined by extracting the information from, the <Info> element of the received notification message. Here’s an example of a notification message received for an Insert operation:

    Copy Code
    <Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Insert</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    Notice the value within the <Info> element. This value provides information on the operation for which the notification message was received. Your application should have the functionality to extract the value within the <Info> element and then based on the value, perform subsequent tasks. The topic Processing Notification Messages to Perform Specific Tasks has instructions on how to extract the value within the <Info> element. A detailed tutorial that performs similar tasks is also available at Tutorial 2: Employee - Purchase Order Process.

  • Ideally, after the client application receives a notification for a specific record, that record should be updated so that additional notifications are not received. For example, consider an Employee table that has a Status column. For all new records inserted into the Employee table, the value in the Status column is always “0” so the table will look like the following:

    Employee Name Status

    John

    0

    To receive notifications for the newly inserted record, the adapter client will set the NotificatonStatement binding property as:

    Copy Code
    SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
    Note
    You must specifically specify the column names in the statement as shown in this SELECT statement. Also, you must always specify the table name along with the schema name. For example, dbo.Employee.

    After receiving the notification, the client application must reset the value of the Status column to “1” so that the notification statement does not operate on the record again. To achieve this, the client application must perform an Update operation on the Employee table. After the Update operation, the same record in the Employee table will look like the following:

    Employee Name Status

    John

    1

    Interestingly, the Update operation will again send a notification to the adapter client and the whole process will be repeated again, therefore, the client application must have the required logic to discard such unwanted notifications.

  • If the NotifyOnListenerStart binding property is true, the adapter client will receive a notification message every time the receive location starts. For more information on how to use the binding property and interpret the notification message, see Receiving Query Notifications After a Receive Location Breakdown.

Typical Orchestration for Receiving Notifications

This section outlines the typical orchestration flow for receiving notifications using the SQL adapter.

  1. The first thing that the orchestration must do is to determine the type of notification received, including:

    • Whether the notification was received after a receive location restarts.

    • Whether the notification was received for an operation on a database table, such as Insert, Update, or Delete.

    The orchestration must include an Expression shape, and within that, an xpath query to decide what kind of message is received.

  2. After the notification type is determined, the orchestration must include a decision block to perform specific actions based on the type of notification received. To achieve this, the orchestration must include a Decide shape, which includes a Rule block and an Else block:

    • Within the Rule block, you must specify the condition and then include orchestration shapes to perform certain operations if the condition is met.

    • Within the Else block, you must include orchestration shapes to perform certain operations if the condition is not met.

Details of the preceding requirements are described in Processing Notification Messages to Perform Specific Tasks. A detailed tutorial is also available in Tutorial 2: Employee - Purchase Order Process.


Processing Notification Messages to Perform Specific Tasks

You can use the SQL adapter to receive notifications for changes to SQL Server database tables. However, the adapter only sends you a notification that some records were inserted, updated, or deleted in a certain database table. Any post-processing on those records must be handled by the client applications themselves. This topic presents a scenario-based description on how to process the records in the table based on the kind of notification received from the SQL Server database.

Scenarios for Performing Subsequent Actions After Receiving Notification

Following are a couple of scenarios in which the adapter clients must perform certain post-notification tasks.

  • Scenario 1. Consider a scenario where the adapter client must perform certain tasks based on the kind of notification you receive from SQL Server. For example, the client application must update the records in table “A” if records are inserted in table “B”. Similarly, the client application must delete records from table “A” if records are deleted from table “B”.

    In this scenario, from the notification message received, the adapter clients must extract the type of notification to decide whether the notification was for an insert operation or a delete operation. Once the notification type is ascertained, the adapter clients must perform subsequent actions to insert or update the relevant tables.

  • Scenario 2. Consider a scenario where the receive location that receives notification messages for changes to a table goes down. While the receive location is down, some records are added to the table. However, for these records the adapter client does not receive any notification. When the receive location is back up, the adapter notifies the client by sending a specific message and then the client application must look for all the records that were inserted in the database table while the receive location was down.

    In this scenario, from the notification message received, the adapter clients must extract the information regarding whether the notification is for a change to a database table or for the receive location starting. If the notification is for the receive location starting, the adapter clients must implement the logic to process the records that might have been inserted, updated, or deleted while the receive location was down.

Note
These are just some example scenarios that are listed for a better understanding of how to use the notification feature in the SQL adapter. However, the basic set of tasks required to extract the type of notification received will be similar for all scenarios. This topic provides instructions on how to extract the type of notification from a notification message.

How This Topic Demonstrates Receiving Notification Messages and Extracting Notification Type

In this topic, to demonstrate how to process notification messages to perform subsequent tasks, we consider a basic scenario where an adapter client uses BizTalk application to receive notification messages for changes to the Employee table. After the notification is received, the client filters the type of notification received and performs subsequent action. To demonstrate a very basic scenario, let us consider that the adapter client copies the notification messages to different folders based on the kind of notification received. So:

  • If the notification message is for an Insert or Update operation, the adapter client copies the message to C:\TestLocation\UpsertNotification folder.

  • If the notification message is for any other operation, for example Delete, the adapter client copies the message to C:\TestLocation\OtherNotificaiton folder.

To achieve this as part of a BizTalk application, the orchestration must contain the following:

  • A one-way receive port to receive notification messages.

  • An Expression shape that contains an xpath query to extract the information about the kind of notification message received.

  • A Decide shape to include a decision block in the orchestration. In this decision block, the application decides on what subsequent operations to perform based on the notification message received.

  • Two one-way send ports that finally receive the notification messages.

Configuring Notifications with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure receiving notifications from SQL Server. You must specify these binding properties while configuring the receive port in the BizTalk Server Administration console.

Note
You may choose to specify these binding properties when generating the schema for the Notification operation, even though it is not mandatory. If you do so, the port binding file that the Consume Adapter Service Add-in generates as part of the metadata generation also contains the values you specify for the binding properties. You can later import this binding file in the BizTalk Server Administration console to create the WCF-custom or WCF-SQL receive port with the binding properties already set. For more information about creating a port using the binding file, see Configuring a Physical Port Binding Using a Port Binding File.

Binding Property | Description
InboundOperationType | Specifies the inbound operation that you want to perform. To receive notification messages, set this to Notification.
NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for query notifications. The adapter gets a notification message from SQL Server only when the result set for the specified SQL statement changes.
NotifyOnListenerStart | Specifies whether adapter sends a notification to the adapter clients when the listener is started.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to receive notifications from SQL Server, read further.

How to Receive Notification Messages from the SQL Server Database

Performing an operation on the SQL Server database using SQL adapter with BizTalk Server involves the procedural tasks described in Building Blocks for Developing BizTalk Applications. To configure the adapter to receive notification messages, these tasks are:

  1. Create a BizTalk project, and then generate schema for the Notification inbound operation. Optionally, you can specify values for the InboundOperationType and NotificationStatement binding properties.

  2. Create a message in the BizTalk project for receiving notification from the SQL Server database.

  3. Create an orchestration as described in the preceding section.

  4. Build and deploy the BizTalk project.

  5. Configure the BizTalk application by creating physical send and receive ports.

    Note
    For inbound operations, like receiving notification messages, you must only configure a one-way WCF-Custom or WCF-SQL receive port. Two-way WCF-Custom or WCF-SQL receive ports are not supported for inbound operations.

  6. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Generating Schema

You must generate the schema for the Notification inbound operation. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate the schema. Perform the following tasks when generating the schema. Skip the first step if you do not want to specify the binding properties at design-time.

  1. Specify a value for InboundOperationType and NotificationStatement binding properties while generating the schema. For more information about this binding property, see Working with BizTalk Adapter for SQL Server Binding Properties. For instructions on how to specify binding properties, see Specifying Binding Properties.

  2. Select the contract type as Service (Inbound operations).

  3. Generate schema for the Notification operation.

Defining Messages and Message Types

The schema that you generated earlier describes the "types" required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. Once the schema is generated, you must link it to the messages from the Orchestration view of the BizTalk project.

For this topic, you must create one message to receive notifications from the SQL Server database.

Perform the following steps to create messages and link them to schema.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From the Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration and then click Add.

  2. Open the orchestration view window of the BizTalk project, if it is not already open. Click View, point to Other Windows, and then click Orchestration View.

  3. In the Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for Message_1, do the following:

    Use this To do this

    Identifier

    Type NotifyReceive.

    Message Type

    From the drop-down list, expand Schemas, and select Process_Notification.Notification, where Process_Notification is the name of your BizTalk project. Notification is the schema generated for the Notification operation.

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for receiving notification messages from the SQL Server database and then performing tasks based on the type of notification received. In this orchestration, the adapter receives the notification message based on the SELECT statement specified for the NotificationStatement binding property. The xpath query specified within the Expression shape extracts the type of notification into a variable, say NotificationType. The Decide shape uses the value in this variable to decide on the kind of notification received and takes the appropriate “path” to perform subsequent operations. As mentioned in the preceding section, the orchestration will perform the following operations based on the kind of notification message received.

  • If the notification message is for an Insert or Update operation, the adapter client copies the message to C:\TestLocation\UpsertNotification folder.

  • If the notification message is for any other operation, for example Delete, the adapter client copies the message to C:\TestLocation\OtherNotificaiton folder.

So, your orchestration must contain the following:

  • A one-way receive port to receive notification messages.

  • An Expression shape that contains an xpath query to extract the kind of notification received.

  • A Decide shape to include a decision block in the orchestration. In this decision block, the application decides on what subsequent operations to perform based on the notification message received.

  • Two one-way send ports that finally receive the notification messages.

  • Receive shape.

A sample orchestration resembles the following.

Orchestration to perform post-notification tasks

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveNotification

Receive

  • Set Name to ReceiveNotification

  • Set Activate to True

Adding an Expression Shape

The purpose of including an Expression shape in the orchestration is to have an xpath query to extract the kind of notification message received. Before creating an xpath query, let us look at the format of a notification message. A typical notification message resembles the following:

Copy Code
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Insert</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>

As you see, the information about the type of the notification is available within the <info> tag, within the parent <Notification> tag. So, as part of this expression shape you must:

  • Create a variable that contains the value within the <Info> tag and set its type to System.String. For more information about creating variables, see http://go.microsoft.com/fwlink/?LinkId=102357.

    For this topic, name the variable as NotificationType.

  • Create an xpath query to extract the value from the <Info> tag. The xpath query will resemble the following:

    Copy Code
    NotificationType = xpath(NotifyReceive,"string(/*[local-name()='Notification']/*[local-name()='Info']/text())");
    In this xpath query, NotifyReceive is the message you created for receiving notification messages. The excerpt within the string function indicates that the query must extract the value within the <Info> tag, which in turn is within the <Notification> tag. Finally, the value extracted by the query is assigned to the NotificaitonType variable.

Adding a Decide Shape

The purpose of adding a Decide shape is to include a decision block in the orchestration to decide what subsequent operations to perform based on the kind of notification message received. The decision is made on the basis of the value of the NotificationType variable. In this topic, the orchestration makes a decision based on the kind of notification message received. So, the condition in the Rule shape is specified as follows:

Copy Code
NotificationType.Equals("Insert") | NotificationType.Equals("Update")

This condition suggests that if the value for NotificaitonType variable is Insert or Update, the orchestration will perform one set of tasks. If the value of NotificationType variable is anything else, the orchestration will perform other set of tasks.

As mentioned in the preceding sections, to demonstrate a simple approach, the orchestration will copy messages to different folders based on the notification message type. So, within the Rule and Else blocks, you must add Send shapes to send the messages to different ports. For this topic, name the Send shape in the Rule block as SendUpsertNotification and the Send shape in the Else block as SendOtherNotification.

Adding Ports

You must now add the following logical ports to the orchestration:

  • One-way receive port to receive notification messages from SQL Server.

  • One-way send port to send notification messages for Insert and Update operations to a specific folder.

  • One-way send port to send notification messages for any other operations to a specific folder.

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

SQLNotifyPort

  • Set Identifier to SQLNotifyPort

  • Set Type to SQLNotifyPortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

NotificationUpsertPort

  • Set Identifier to NotificationUpsertPort

  • Set Type to NotificationUpsertPortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

OtherNotificationPort

  • Set Identifier to OtherNotificationPort

  • Set Type to OtherNotificationPortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

Specify Messages for Action Shapes and Connect to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveNotification

  • Set Message to NotifyReceive

  • Set Operation to SQLNotifyPort.Notify.Request

SendUpsertNotification

  • Set Message to NotifyReceive

  • Set Operation to NotificationUpsertPort.Upsert.Request

SendOtherNotification

  • Set Message to Select

  • Set Operation to OtherNotificationPort.Other.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see "Building and Running Orchestrations" at http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a physical WCF-Custom or WCF-SQL one-way receive port. This port listens for notifications coming from the SQL Server database. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. Make sure you specify the following binding properties for the receive port.

      Important
      You do not need to perform this step if you specified the binding properties at design-time. In such a case, you can create a WCF-custom or WCF-SQL receive port, with the required binding properties set, by importing the binding file created by the Consume Adapter Service Add-in. For more information see Configuring a Physical Port Binding Using a Port Binding File.

      Binding Property Value

      InboundOperationType

      Set this to Notification.

      NotificationStatement

      Set this to:

      Copy Code
      SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
      Note
      You must specifically specify the column names in the statement as shown in this SELECT statement. Also, you must always specify the table name along with the schema name. For example, dbo.Employee.

      NotifyOnListenerStart

      Set this to True.

      For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      We recommend configuring the transaction isolation level and the transaction timeout while performing inbound operations using the SQL adapter. You can do so by adding the service behavior while configuring the WCF-Custom or WCF-SQL receive port. For instruction on how to add the service behavior, see Configure Transaction Isolation Level and Transaction Timeout.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the notification messages from the SQL Server database for Insert and Update operations. Configure this port to drop notification messages to the folder C:\TestLocation\UpsertNotification.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the notification messages from the SQL Server database for all other operations. Configure this port to drop notification messages to the folder C:\TestLocation\OtherNotification.

Starting the Application

You must start the BizTalk application for receiving notification messages from the SQL Server database and for performing the subsequent Select and Update operations. For instructions on starting a BizTalk application, see “How to Start an Orchestration” at http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The WCF-Custom or WCF-SQL one-way receive port, which receives the notification messages from the SQL Server database is running.

  • The two FILE send ports, which receive messages from SQL Server, are running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

After you start the BizTalk orchestration, the following set of actions take place:

  • Because the NotifyOnListenerStart binding property is set to True, you receive the following message:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>ListenerStarted</Info>
  <Source>SqlBinding</Source>
  <Type>Startup</Type>
</Notification>
    Note that the value in the <Info> tag is “ListnerStarted”. Hence, this message is received in C:\TestLocation\OtherNotification folder.

  • Insert a record in the Employee table. You will receive a notification message resembling the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Insert</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    Note that the value in the <Info> tag is “Insert”. Hence, this message is received in C:\TestLocation\UpsertNotification folder.

  • Update a record in the Employee table. You will receive a notification message resembling the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Update</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    Note that the value in the <Info> tag is “Update”. Hence, this message is received in C:\TestLocation\UpsertNotification folder.

  • Delete a record from the Employee table. You will receive a notification message resembling the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Delete</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    Note that the value in the <Info> tag is “Delete”. Hence, this message is received in C:\TestLocation\OtherNotification folder.

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

Performing Complex Operations After Receiving Notification Messages

For simplicity and better understanding, the orchestration in this topic copies messages to different folders based on the notification type. However, in real-world scenarios you might want to perform more complex operations. You can perform similar procedures as provided in this topic and build on them to perform the operations you wish. For example, you can change the orchestration to insert records in another table if you get a notification message for an Insert operation on the Employee table. In such a case, you can make appropriate changes within the Decide shape.

One such scenario is explained in detail in Tutorial 2: Employee - Purchase Order Process.

See Also

Other Resources

Receiving Query Notifications by Using BizTalk Server


Receiving Query Notifications Incrementally Using BizTalk Server
Important
For the sake of brevity, this topic only describes how to receive notifications incrementally. In business scenarios, the orchestration must ideally include the logic to extract the kind of notification message received and then perform any subsequent operations. In other words, the orchestration described in this topic must be built on top of the orchestration described in Processing Notification Messages to Perform Specific Tasks.

This topic demonstrates how to configure the SQL adapter to receive incremental query notification messages from a SQL Server database. To demonstrate incremental notifications, consider a table, Employee, with a “Status” column. When a new record is inserted to this table, the value of the Status column is set to 0. You can configure the adapter to receive incremental notifications by doing the following:

  • Register for notifications using a SQL statement that retrieves all records that have Status column as 0. You can do so by specifying the SQL statement for the NotificationStatement binding property.

  • For rows for which notification messages have been received, update the Status column to 1.

This topic demonstrates how to create a BizTalk orchestration and configure a BizTalk application to achieve this.

Configuring Notifications with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure receiving notifications from SQL Server. You must specify these binding properties while configuring the receive port in the BizTalk Server Administration console.

Note
You may choose to specify these binding properties when generating the schema for the Notification operation, even though it is not mandatory. If you do so, the port binding file that the Consume Adapter Service Add-in generates as part of the metadata generation also contains the values you specify for the binding properties. You can later import this binding file in the BizTalk Server Administration console to create the WCF-custom or WCF-SQL receive port with the binding properties already set. For more information about creating a port using the binding file, see Configuring a Physical Port Binding Using a Port Binding File.

Binding Property | Description
InboundOperationType | Specifies the inbound operation that you want to perform. To receive notification messages, set this to Notification.
NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for query notifications. The adapter gets a notification message from SQL Server only when the result set for the specified SQL statement changes.
NotifyOnListenerStart | Specifies whether the adapter sends a notification to the adapter clients when the listener is started.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to receive notifications from SQL Server, read further.

How This Topic Demonstrates Receiving Notification Messages

To demonstrate how the SQL adapter supports receiving notification messages from SQL Server, this topic will demonstrate how to configure the adapter to receive notifications for changes to an Employee table. Assume that the Employee table has columns Employee_ID, Name, and Status. Whenever a new employee is added, the value of the Status column is set to 0.

To demonstrate receiving notifications, do the following:

  • Generate schema for the Notification (inbound operation), and Select (outbound operation) on the Employee table.

  • Create an orchestration that has the following:

    • A receive location to receive notification messages. You can configure for notification by specifying the SELECT statement as:

      Copy Code
      SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
      Note
      You must specifically specify the column names in the statement as shown in this SELECT statement. Also, you must always specify the table name along with the schema name. For example, dbo.Employee.

    • A send port to update the rows for which notification has already been sent. You do so by setting the value in the Status column to 1. You can do this as part of the Select operation by sending the following message to the adapter.

      Copy Code
      <Select xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <Columns>Employee_ID,Name,Status</Columns>
  <Query>where Status=0;UPDATE Employee SET Status=1 WHERE Status=0</Query>
</Select>
      In this message, as part of the <Query> element, you specify the UPDATE statement to update the Status column. Note that this operation must be executed after receiving the notification messages so that the processed rows are updated. To do away with the overhead of waiting to get the notification response and then manually dropping a request message to update the rows, you will generate the request message for updating the rows within the orchestration itself. You can do so by using the Construct Message shape within an orchestration.

How to Receive Notification Messages from the SQL Server Database

Performing an operation on the SQL Server database using SQL adapter with BizTalk Server involves the procedural tasks described in Building Blocks for Developing BizTalk Applications. To configure the adapter to receive notification messages, these tasks are:

  1. Create a BizTalk project, and then generate schema for the Notification (inbound operation) and Select (outbound operation) on the Employee table. Optionally, you can specify values for the InboundOperationType and NotificationStatement binding properties.

  2. Create a message in the BizTalk project for receiving notification from the SQL Server database.

  3. Create messages in the BizTalk project for performing the Select information on the SQL Server database and receiving response messages.

  4. Create an orchestration that does the following:

    • Receives notification message from SQL Server.

    • Creates a message to select and update the rows for which notification is received.

    • Sends this message to the SQL Server to update the rows and receives a response.

  5. Build and deploy the BizTalk project.

  6. Configure the BizTalk application by creating physical send and receive ports.

    Note
    For inbound operations, like receiving notification messages, you must only configure a one-way WCF-Custom or WCF-SQL receive port. Two-way WCF-Custom or WCF-SQL receive ports are not supported for inbound operations.

  7. Start the BizTalk application.

This topic provides instructions to perform these tasks.

Sample Based on This Topic

A sample, IncrementalNotification, based on this topic is provided with the BizTalk Adapter Pack. For more information, see Samples.

Generating Schema

You must generate the schema for the Notification operation and Select operation on Employee table. See Retrieving Metadata for SQL Server Operations in Visual Studio for more information about how to generate the schema. Perform the following tasks when generating the schema. Skip the first step if you do not want to specify the binding properties at design time.

  1. Specify a value for InboundOperationType and NotificationStatement binding properties while generating the schema. For more information about this binding property, see Working with BizTalk Adapter for SQL Server Binding Properties. For instructions on how to specify binding properties, see Specifying Binding Properties.

  2. Select the contract type as Service (Inbound operations).

  3. Generate schema for the Notification operation.

  4. Select the contract type as Client (Outbound operations).

  5. Generate schema for the Select operation on Employee table.

Defining Messages and Message Types

The schema that you generated earlier describes the "types" required for the messages in the orchestration. A message is typically a variable, the type for which is defined by the corresponding schema. Once the schema is generated, you must link it to the messages from the Orchestration view of the BizTalk project.

For this topic, you must create three messages—one to receive notifications from the SQL Server database, one to perform the Select operation, and one to receive the response for Select operation.

Perform the following steps to create messages and link them to schema.

To create messages and link to schema

  1. Add an orchestration to the BizTalk project. From the Solution Explorer, right-click the BizTalk project name, point to Add, and then click New Item. Type a name for the BizTalk orchestration and then click Add.

  2. Open the orchestration view window of the BizTalk project, if it is not already open. Click View, point to Other Windows, and then click Orchestration View.

  3. In the Orchestration View, right-click Messages, and then click New Message.

  4. Right-click the newly created message, and then select Properties Window.

  5. In the Properties pane for Message_1, do the following:

    Use this To do this

    Identifier

    Type NotifyReceive.

    Message Type

    From the drop-down list, expand Schemas, and select SQLNotify.Notification, where SQLNotify is the name of your BizTalk project. Notification is the schema generated for the Notification operation.

  6. Repeat step 3 to create two new messages. In the Properties pane for the new message, do the following:

    Set Identifier to Set Message Type to

    Select

    SQLNotify.TableOperation_dbo_Employee.Select, where TableOperation_dbo_Employee is the schema generated for the Select operation

    SelectResponse

    SQLNotify.TableOperation_dbo_Employee.SelectResponse

Setting up the Orchestration

You must create a BizTalk orchestration to use BizTalk Server for receiving notification messages from the SQL Server database and then updating the rows for which notification was received. In this orchestration, the adapter receives the notification message based on the SELECT statement specified for the NotificationStatement binding property. The notification message is received at a FILE location. Once the response is received, the orchestration constructs a message that will be used to update the rows for which notification is received. The response for this message is also received at the same FILE location.

So, your orchestration must contain the following:

  • A one-way receive port to receive notification messages.

  • A two-way send port to send messages to update rows and receive response for the same.

  • A Construct Message shape to construct messages, to execute the Update operation, within the orchestration.

  • A FILE send port to save the response for the Update operation.

  • Receive and send shapes.

A sample orchestration resembles the following.

Orchestration to receive SQL Server notifications

Adding Message Shapes

Make sure you specify the following properties for each of the message shapes. The names listed in the Shape column are the names of the message shapes as displayed in the just-mentioned orchestration.

Shape Shape Type Properties

ReceiveNotification

Receive

  • Set Name to ReceiveNotification

  • Set Activate to True

SaveNotification

Send

  • Set Name to SaveNotification

SendSelectMessage

Send

  • Set Name to SendSelectMessage

ReceiveSelectResponse

Receive

  • Set Name to ReceiveSelectResponse

SaveSelectResponse

Send

  • Set Name to SaveSelectResponse

Adding Construct Message Shape

You can use the Construct Message shape to generate a request message within the operation to perform the Select operation. To do so, you must add a Construct Message shape and within that a Message Assignment shape to your orchestration. For this example, the Message Assignment shape invokes code that generates a message that is sent to SQL Server to perform the Select operation. The Message Assignment shape also sets the action for the message to be sent to SQL Server.

For the construct message shape, set the Message Constructed property to Select.

The code to generate the response could be part of the same Visual Studio solution as your BizTalk project. A sample code for generating a response message looks like this.

Copy Code
namespace SampleMessageCreator
{
    public class SampleMessageCreator
    {
        private static XmlDocument Message;
        private static string XmlFileLocation;
        private static string ResponseDoc;
        public static XmlDocument XMLMessageCreator()
        {
            XmlFileLocation = "C:\\TestLocation\\CreateMessage";
            try
            {
                ResponseDoc = (Directory.GetFiles(XmlFileLocation, "*.xml", SearchOption.TopDirectoryOnly))[0];
            }
            catch (Exception ex)
            {
                Console.WriteLine("Trying to get XML from: " + XmlFileLocation);
                Console.WriteLine("EXCEPTION: " + ex.ToString());
                throw ex;
            }
            //Create Message From XML
            Message = new XmlDocument();
            Message.PreserveWhitespace = true;
            Message.Load(ResponseDoc);
            return Message;
        }
    }
}

For the preceding code excerpt to be able to generate a request message, you must have an XML request message (for the Select operation on the Employee table) in the location specified for the XmlFileLocation variable.

Note
After you build the project, SampleMessageCreator.dll will be created in the project directory. You must add this DLL to the global assembly cache (GAC). Also, you must add the SampleMessageCreator.dll as a reference in the BizTalk project.

Add the following expression to invoke this code from the Message Assignment shape and to set the action for message. To add an expression, double-click the Message Assignment shape to open the Expression Editor.

Copy Code
Select = SampleMessageCreator.SampleMessageCreator.XMLMessageCreator();
Select(WCF.Action) = "TableOp/Select/dbo/Employee";

Adding Ports

Make sure you specify the following properties for each of the logical ports. The names listed in the Port column are the names of the ports as displayed in the orchestration.

Port Properties

SQLNotifyPort

  • Set Identifier to SQLNotifyPort

  • Set Type to SQLNotifyPortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Receive

SaveMessagePort

  • Set Identifier to SaveMessagePort

  • Set Type to SaveMessagePortType

  • Set Communication Pattern to One-Way

  • Set Communication Direction to Send

  • Create an operation Notify. This operation is used for notification messages.

  • Create an operation Select. This operation is used for select response messages.

SQLOutboundPort

  • Set Identifier to SQLOutboundPort

  • Set Type to SQLOutboundPortType

  • Set Communication Pattern to Request-Response

  • Set Communication Direction to Send-Receive

Specify Messages for Action Shapes and Connect to Ports

The following table specifies the properties and their values that you should set to specify messages for action shapes and to link the messages to the ports. The names listed in the Shape column are the names of the message shapes as displayed in the orchestration mentioned earlier.

Shape Properties

ReceiveNotification

  • Set Message to NotifyReceive

  • Set Operation to SQLNotifyPort.Notify.Request

SaveNotification

  • Set Message to NotifyReceive

  • Set Operation to SaveMessagePort.Notify.Request

SendSelectMessage

  • Set Message to Select

  • Set Operation to SQLOutboundPort.Select.Request

ReceiveSelectResponse

  • Set Message to SelectResponse

  • Set Operation to SQLOutboundPort.Select.Response

SaveSelectResponse

  • Set Message to SelectResponse

  • Set Operation to SaveMessagePort.Select.Request

After you have specified these properties, the message shapes and ports are connected and your orchestration is complete.

You must now build the BizTalk solution and deploy it to a BizTalk Server. For more information, see "Building and Running Orchestrations" at http://go.microsoft.com/fwlink/?LinkId=102359.

Configuring the BizTalk Application

After you have deployed the BizTalk project, the orchestration you created earlier is listed under the Orchestrations pane in the BizTalk Server Administration console. You must use the BizTalk Server Administration console to configure the application. For more information about configuring an application, see http://go.microsoft.com/fwlink/?LinkID=196961.

Configuring an application involves:

  • Selecting a host for the application.

  • Mapping the ports that you created in your orchestration to physical ports in the BizTalk Server Administration console. For this orchestration you must:

    • Define a physical WCF-Custom or WCF-SQL one-way receive port. This port listens for notifications coming from the SQL Server database. For information about how to create ports, see Manually Configuring a Physical Port Binding to the SQL Adapter. Make sure you specify the following binding properties for the receive port.

      Important
      You do not need to perform this step if you specified the binding properties at design time. In such a case, you can create a WCF-custom or WCF-SQL receive port, with the required binding properties set, by importing the binding file created by the Consume Adapter Service Add-in. For more information see Configuring a Physical Port Binding Using a Port Binding File.

      Binding Property Value

      InboundOperationType

      Set this to Notification.

      NotificationStatement

      Set this to:

      Copy Code
      SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
      Note
      You must specifically specify the column names in the statement as shown in this SELECT statement. Also, you must always specify the table name along with the schema name. For example, dbo.Employee.

      NotifyOnListenerStart

      Set this to True.

      For more information about the different binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties.

      Note
      We recommend configuring the transaction isolation level and the transaction timeout while performing inbound operations using the SQL adapter. You can do so by adding the service behavior while configuring the WCF-Custom or WCF-SQL receive port. For instruction on how to add the service behavior, see Configure Transaction Isolation Level and Transaction Timeout.

    • Define a physical WCF-Custom or WCF-SQL send port to send messages to the SQL Server database. You must also specify the action in the send port.

    • Define a location on the hard disk and a corresponding file port where the BizTalk orchestration will drop the messages from the SQL Server database. These will be the notification messages received from SQL Server and messages for the Select and Update operation you perform through the WCF-Custom or WCF-SQL send port.

Starting the Application

You must start the BizTalk application for receiving notification messages from the SQL Server database and for performing the subsequent Select and Update operations. For instructions on starting a BizTalk application, see “How to Start an Orchestration” at http://go.microsoft.com/fwlink/?LinkId=102387.

At this stage, make sure:

  • The WCF-Custom or WCF-SQL one-way receive port, which receives the notification messages from the SQL Server database is running.

  • The WCF-Custom or WCF-SQL send port to perform Select and Update operations on the Employee table is running.

  • The FILE send port, which receives messages from SQL Server, is running.

  • The BizTalk orchestration for the operation is running.

Executing the Operation

To execute this operation, you must insert a record into the Employee table. Let us assume you insert a record with following details:

Copy Code
Name = John Smith
Designation = Manager
Salary = 100000

Also, make sure the XML message to perform Select and Update operations is available at C:\TestLocation\MessageIn. The XML file should resemble the following:

Copy Code
<Select xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <Columns>Employee_ID,Name,Status</Columns>
  <Query>where Status=0;UPDATE Employee SET Status=1 WHERE Status=0</Query>
</Select>

Once the record is inserted, the following set of actions take place, in the same sequence:

  • The adapter receives a notification message that resembles the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Insert</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    This message notifies that a record was inserted in the Employee table. Note that the value for the <Info> element is “Insert”.

  • The adapter executes the Select operation. Because the Select operation XML also includes an Update statement, the Update statement is also executed. The next response from SQL Server is for the Select statement.

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<SelectResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <SelectResult>
    <Employee xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
      <Employee_ID>10006</Employee_ID>
      <Name>John</Name>
      <Status>0</Status>
    </Employee>
  </SelectResult>
</SelectResponse>
    This response shows that a record was inserted into the Employee table and the Status for that record is 0.

  • As part of the Select statement, the Update statement is also executed and the Status column for the new record is changed to 1. This again triggers another notification from SQL Server and the adapter receives a corresponding notification message, that resembles the following:

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification/">
  <Info>Update</Info>
  <Source>Data</Source>
  <Type>Change</Type>
</Notification>
    This message notifies that a record was updated in the Employee table. Note that the value for the <Info> element is “Update”.

  • After the second notification, the adapter executes the Select statement. However, because there are no records now that have Status as 0, the adapter gets an empty response resembling the following.

    Copy Code
    <?xml version="1.0" encoding="utf-8" ?>
<SelectResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <SelectResult />
</SelectResponse>

Best Practices

After you have deployed and configured the BizTalk project, you can export configuration settings to an XML file called the binding file. Once you generate a binding file, you can import the configuration settings from the file, so that you do not need to create the send ports and receive ports for the same orchestration. For more information about binding files, see Reusing Adapter Bindings.

See Also

Other Resources

Receiving Query Notifications by Using BizTalk Server


Receiving Query Notifications On Multiple Receive Locations

Consider a scenario where you have multiple receive locations created as part of different BizTalk applications configured to receive query notifications for the same table (e.g. Employee) in the same database. If a hundred records are inserted into the same table, all the receive locations will get the notification message. To effectively receive notifications across multiple receive locations, you can call operations from your BizTalk application in such a way that if a notification is received by one receive location, the other receive location does not get the same notification. So, you can effectively load-balance notifications received on multiple locations.

The tasks required to set up an orchestration to load-balance receiving notifications are same as that for Receiving Query Notifications Incrementally Using BizTalk Server. This topic lists the only the difference between the two approaches.

Load-Balancing Query Notifications Across Multiple Receive Locations

Like in the topic Receiving Query Notifications Incrementally Using BizTalk Server, you configured incremental notifications by executing an UPDATE statement on the records that are already notified for. To configure load-balancing, you could execute a stored procedure that deletes the records that have been notified for. For example, consider a stored procedure PROCESS_EMPLOYEE with the following definition:

Copy Code
DECLARE @var int
SELECT TOP 1 @var = Employee_ID FROM Employee
SELECT * FROM Employee WHERE Employee_ID=@var
DELETE FROM Employee WHERE Employee_ID=@var

When you execute this stored procedure as part of the BizTalk application, the record for which notification is already received gets deleted. So, the other receive location gets notification for the next record.

Here are the high-level steps you must perform to configure load-balancing for receiving notifications.

  1. Create schema for Notification (inbound operation) and PROCESS_EMPLOYEE stored procedure (outbound operation).

  2. Add an orchestration and add three messages for receiving notification, executing stored procedure, and getting response for the stored procedure.

  3. Create an orchestration by adding Send and Receive shapes, Construct Message shape, and ports. You can use the same sample code for constructing a message to invoke the PROCESS_EMPLOYEE stored procedure. Note that while performing the operation in BizTalk Server Administration console, you must have the request message for the PROCESS_EMPLOYEE stored procedure in the location C:\TestLocation\MessageIn. You do so because the code snippet you invoke as part of the orchestration created in Receiving Query Notifications Incrementally Using BizTalk Server creates a request message based on the request XML present in C:\TestLocation\MessageIn.

  4. Build and deploy the application. To demonstrate load-balancing, you must deploy this orchestration at least on two different computers that have BizTalk Server and SQL adapter installed.

  5. In the BizTalk Server Administration console on both the computers, specify the following binding properties for the WCF-Custom or WCF-SQL receive location:

    Binding Property Value

    InboundOperationType

    Set this to Notification.

    NotificationStatement

    Set this to:

    Copy Code
    SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0
    Note
    For notification statements, you must always specify the table name along with the schema name. For example, dbo.Employee.

    NotifyOnListenerStart

    Set this to True.

  6. Start the BizTalk application.

  7. To start receiving notifications, insert a hundred records into the EMPLOYEE table. While doing so, make sure the request XML for invoking the PROCESS_EMPLOYEE stored procedure is available in C:\TestLocation\MessageIn.

  8. Monitor the location (on both the computers) where the BizTalk application will be dropping the notification messages. You will notice that of the hundred records inserted, one location gets notifications for some records while the other location gets notification for the remaining records. Together, both the locations will get notification for all the hundred records.

See Also

Other Resources

Receiving Query Notifications by Using BizTalk Server


Receiving Query Notifications After a Receive Location Breakdown

Consider a scenario where you have a BizTalk application that receives database change notification messages when changes are made to the EMPLOYEE table. If the receive location configured as part of the BizTalk application breaks down, and simultaneously records are added into the EMPLOYEE table, you will not receive notifications for the recently added records. You will also not know when the receive location is available again. The SQL adapter exposes a binding property, NotifyOnListenerStart, that you can configure to get a notification that the receive location has recovered. You can specify the following values for the NotifyOnListenerStart binding property:

  • Set this property to True, to receive a notification informing that the receive location is available, as soon as the receive location recovers.

  • Set this property to False, to not receive a notification informing that the receive location has recovered, after the receive location recovers.

Default is True.

Configuring the SQL Adapter Behavior

For either of the approaches, you do not need to perform any specific tasks while generating metadata or while configuring the BizTalk application. You only need to set the NotifyOnListenerStart binding property accordingly on the WCF-Custom or WCF-SQL receive location. To create the BizTalk application, you must perform the same set of tasks as described in Receiving Query Notifications Incrementally Using BizTalk Server. However, when configuring the BizTalk application using BizTalk Server, you can try changing the value of the NotifyOnListenerStart binding property and see the difference in the two configurations.

The following figure demonstrates how the notifications are received based on the value of the NotifyOnListenerStart binding property.

Configure SQL Adapter for notifications

Note that in the first scenario, when the NotifyOnListenerStart is set to true and records are inserted into the database table while the receive location was down, the adapter only sends you a notification message when the receive location comes back up. The adapter does not perform any operation to process the records that were inserted while the receive location was down. The adapter client must implement the relevant logic in their application to process the records that were inserted while the receive location was down.

See Also

Other Resources

Receiving Query Notifications by Using BizTalk Server


Developing Applications by Using the WCF Service Model

Windows Communication Foundation (WCF) provides a programming model called the WCF service model, as an alternative to the WCF channel programming model.

The WCF service model uses familiar .NET paradigms to hide the complexities of exchanging SOAP messages over a channel. The service model accomplishes this simplification by reading the entire SOAP message into memory before copying the information into .NET data structures. Loading long messages into memory, however, may not be practical for some applications. In these cases, developers should use the WCF channel model. For more information about using the WCF channel model, see Developing Applications by Using the WCF Channel Model.

At the lowest level, WCF presents the WCF channel model, in which clients invoke operations on a service by exchanging SOAP messages over a channel established between client and service endpoints. The WCF channel model exposes data types and methods that enable you to operate directly on the WCF channel architecture. The WCF channel model provides you with direct control over the contents of the SOAP messages you create and over the way both your application and the Microsoft BizTalk Adapter for SQL Server consume them. However, creating well-formed SOAP messages to send over a channel and validating the reply messages returned can be a detailed and exacting task.

The WCF service model uses proxy classes to invoke operations on a target service or to receive operations from a client. The SQL adapter exposes the SQL Server database as a WCF service on which you can invoke operations.

  • The proxy class that is used to invoke operations on a target service is called a WCF client class. This class models the operations exposed by a service as .NET methods with strongly-typed parameters. By using the WCF service model, you can invoke the operations exposed by the SQL adapter as .NET methods on the WCF client. For more information about WCF clients, see "WCF Client Overview" at http://go.microsoft.com/fwlink/?LinkId=91458.

You can use either of the following tools to generate a WCF client class and associated helper code from the service metadata that the SQL adapter exposes:

  • The ServiceModel Metadata Utility Tool (svcutil.exe), which ships with WCF.

  • The Add Adapter Service Reference Visual Studio Plug-in, which ships with SQL adapter and is integrated with the Visual Studio design experience. This tool presents a standard Microsoft Windows interface that provides powerful browsing and searching capabilities on operations that the adapter exposes. For more information about how to generate a WCF client application, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

    The topics in this section contain information, procedures, and examples to help you create and use the WCF service model to develop applications by using the SQL adapter.

In This Section

  • Overview of Using the WCF Service Model with the Adapter

  • Metadata and the WCF Service Model

  • Generating a WCF Client or WCF Service Contract for SQL Server Artifacts

  • Specifying a Client Binding for the SQL Adapter

  • Performing Insert, Update, Delete, and Select Operations by Using the WCF Service Model

  • Performing Operations on Tables and Views with Large Data Types by Using the WCF Service Model

  • Invoking Stored Procedures Using the WCF Service Model

  • Invoking Scalar Functions in SQL Server by Using the WCF Service Model

  • Invoking Table-Valued Functions in SQL Server by Using the WCF Service Model

  • Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using WCF Service Model

  • Polling SQL Server by Using the SQL Adapter with WCF Service Model

  • Receiving Query Notifications Using the WCF Service Model

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Overview of Using the WCF Service Model with the Adapter

The Microsoft BizTalk Adapter for SQL Server exposes a SQL Server operation as a WCF service. To perform operations on SQL Server artifacts, for example to invoke a stored procedure, you invoke an operation on the adapter, which, in turn, performs the operation on the SQL Server. Your code therefore acts as a client to the WCF service presented by the adapter.

In the Windows Communication Foundation (WCF) service model, the service contract that exists between a client and a service is represented as a .NET interface, and operations are represented as methods on this interface. The SQL adapter and WCF provide tools that enable you to generate this interface for targeted operations from the metadata that the adapter exposes. These tools also create a WCF client class that can be used to invoke the operations exposed in the service interface. A client application can call the methods of the WCF client class to invoke operations on the adapter. To implement a service to receive inbound operations from the SQL adapter, you implement the interface generated for the inbound operations.

The following section explains how to use the WCF service model to invoke operations with a WCF client.

Invoking Operations on the SQL Server with a WCF Client

To use the WCF service model to invoke operations on the SQL adapter, you must first generate a WCF client class for the target operations. You can then create an instance of this class, a WCF client, and call its methods to perform these operations on the SQL Server system. This section provides an outline of how a typical .NET adapter client application looks like. Detailed explanations on how to perform different operations on the SQL Server database using the adapter are provided in specific topics.

To invoke operations on the SQL adapter

  1. Generate a WCF client class and helper code. Use the Add Adapter Service Reference Visual Studio Plug-in to generate a WCF client class targeted at the SQL Server database artifacts with which you want to work. For more information about how to generate a WCF client, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

  2. Create a WCF client instance and configure the WCF client. Configuring the WCF client involves specifying the binding and endpoint address (connection URI) that the client will use. You can do this either imperatively in code or declaratively in configuration. The following code creates a WCF client that targets the Select operation on the Employee table in a SQL Server database. It also sets the credentials for the SQL Server database. The WCF client is initialized from configuration.

    Copy Code
    TableOp_dbo_EmployeeClient client = new TableOp_dbo_EmployeeClient("SqlAdapterBinding_TableOp_dbo_Employee"); //picking the binding and address from the app.config

client.ClientCredentials.UserName.UserName = "myuser";
client.ClientCredentials.UserName.Password = "mypassword";
    Note
    You can either specify the client binding and endpoint address in the code or declare it in the app.config configuration file. The preceding code snippet uses the latter. For more information on how to use either approaches, see Specifying a Client Binding for the SQL Adapter.

  3. Open the WCF client.

    Copy Code
    client.Open();

  4. Invoke methods on the WCF client created in preceding step to perform a Select operation on the SQL server database. The following code invokes the Select method of the WCF client to invoke the SELECT statement on a SQL Server database table.

    Copy Code
    client.Select("*", "where [Name] = ‘John Smith’");

  5. Close the WCF client.

    Copy Code
    client.Close();

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Metadata and the WCF Service Model

In the WCF service model, you use the Add Adapter Service Reference Visual Studio Plug-in or the ServiceModel Metadata Utility Tool (svcutile.exe) to do the following:

  • Generate a service contract—the WCF service contract—through which your code can receive operations from the adapter. This .NET interface represents the service contract for target operations.

  • Generate proxy classes—the WCF client class—through which your code can invoke operations on the adapter.

  • Annotated classes that represent the supporting message contracts, operation contracts, and data contracts for the service contract.

For help in understanding the structure of this generated code, see "Understanding Generated Client Code" at http://go.microsoft.com/fwlink/?LinkId=98365. This topic specifically describes code that svcutil.exe generates, but its content is also applicable to the code that the Add Adapter Service Reference Plug-in generates.

For information about how to generate a WCF client class or WCF service contract for target operations and about the differences between svcutil.exe and the Add Adapter Service Reference Plug-in, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Generating a WCF Client or WCF Service Contract for SQL Server Artifacts

You can use the Add Adapter Service Reference Visual Studio Plug-in to generate a WCF client class targeted at selected operations on SQL Server artifacts. You can also use the ServiceModel Metadata Utility Tool (svcutil.exe) to generate the WCF client class; however, the Add Adapter Service Reference Plug-in exposes the functionality of the ServiceModel Metadata Utility Tool through a standard Microsoft Windows interface. It also provides browse and search capabilities that are not available with the svcutil.exe tool, and generates a configuration file based on the binding properties that you select when you connect to the SQL Server database.

Generating a WCF Client Class by Using the Add Adapter Service Reference Plug-in

Perform the following steps to generate a WCF client class by using the Add Adapter Service Reference Plug-in.

To generate a WCF client class

  1. In Visual Studio Solution Explorer, right-click your project, and then click Add Adapter Service Reference.

  2. After the Add Adapter Service Reference dialog box opens, follow the steps in Retrieving Metadata for SQL Server Operations in Visual Studio to connect to SQL Server and to browse and search for operations. To create a WCF client class for the operations that you select, be sure that Client (Outbound operations) is selected from the Select contract type drop-down list. (This is the default).

  3. After you select all of the operations that you want to target, click OK to generate the WCF client class.

The Add Adapter Service Reference Plug-in adds two files to your project:

  • The WCF client code file. This file contains the generated WCF client class and helper code for the operations that you selected. The first time you run the Add Adapter Service Reference Visual Studio Plug-in, it will generate this file with the default name SQLAdapterBindingClient.cs. If you run it again, the next file it generates will be called SQLAdapterBindingClient1.cs. The number suffix will increase by 1 for every new file you generate. You can also change the default prefix SQLBinding by entering a different prefix in the Filename prefix field of the Add Adapter Service Reference Visual Studio Plug-in before selecting OK to generate the file.

  • App.config. This file contains a binding configuration and client endpoint configurations that are based on the selections you made when you configured the connection for the Add Adapter Service Reference Plug-in.

    Important
    While using the Add Adapter Service Reference Plug-in, if you do not specify a value for a binding property of type string and whose default value is null then that binding property will not be available in the app.config file. You must manually add the binding property and its value in the app.config file, if required.

Generating a WCF Service Contract by Using the Add Adapter Service Reference Plug-in

For inbound operations such as polling the SQL Server database or receiving notifications from the database, the SQL adapter either executes a query specified by the client application (in case of polling) or registers a query with SQL Server (in case of notification). In both the scenarios, the adapter sends the inbound message from SQL Server database to the consuming. In such a case, the consuming application acts as a service and the SQL adapter acts as the client. You must, therefore, implement a WCF service that can receive inbound operations from the adapter. To do this, you use the Add Adapter Service Reference Plug-in to generate a .NET interface that represents the service contract that is surfaced by the adapter for the inbound operations. This .NET interface is also called a WCF service contract. You then implement this interface to create the WCF service that you can use to receive the inbound operations.

Perform the following steps to generate a WCF service contract by using the Add Adapter Service Reference Plug-in.

To generate a WCF service contract for inbound operations

  1. In Visual Studio Solution Explorer, right-click your project, and then click Add Adapter Service Reference.

  2. After the Add Adapter Service Reference dialog box opens, follow the steps in Connecting to SQL Server in Visual Studio Using Add Adapter Service Reference Plug-in to connect to the SQL Server database.

    Important
    If you are generating WCF service contract for TypedPolling inbound operation, you must specify the InboundID as part of the connection URI and PollingStatement binding property.

  3. After you have connected to the SQL Server database, select Service (Inbound operations) from the Select contract type drop-down list.

  4. In the Select a category box, click the root node (/), select the inbound operation from the Available categories and operations box, and then click Add.

  5. To generate the WCF service contract for the inbound operation, click OK.

The Add Adapter Service Reference Plug-in adds three files to your project:

  • SqlAdapterBindingInterface.cs. This file contains the generated WCF service contract (interface) and helper code for the inbound operation.

  • SqlAdapterBindingService.cs. This file contains a class that implements the interface defined in SqlAdapterBindingInterface.cs. You can implement the business logic that processes the records returned by the inbound operation.

  • app.config. This file contains a binding configuration, endpoint behaviors, and service endpoint configuration that are based on the selections you made when you configured the binding and connection for the Add Adapter Service Reference Plug-in.

    Important
    While using the Add Adapter Service Reference Plug-in, if you do not specify a value for a binding property of type string and whose default value is null then that binding property will not be available in the app.config file. You must manually add the binding property and its value in the app.config file, if required.

Generating a WCF Client Class by Using svcutil.exe

You can use svcutil.exe to generate a WCF client class for your application. You must configure svcutil.exe to use it with the SQL adapter.

Svcutil.exe generates the WCF client class in an output file with a default file name of output.cs. You must manually include this file in your Visual Studio project. For more information about svcutil.exe, see http://go.microsoft.com/fwlink/?LinkId=139432.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Specifying a Client Binding for the SQL Adapter

After you have generated the WCF client class, you can create a WCF client (instance) and invoke its methods to consume the Microsoft BizTalk Adapter for SQL Server. For information about how to generate the WCF client class and helper code for operations that the SQL adapter exposes, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

To create the WCF client, you must specify an endpoint address and a binding. The endpoint address must contain a valid SQL connection URI, and the binding must be an instance of a SQL Binding (sqlBinding). For more information about the SQL connection URI, see Specifying the Connection URI. You must specify the user credentials as part of the connection URI. You may use the ClientCredentials property of the WCF client, as explained in this topic.

You can specify the SQL binding and the endpoint address in your code or in a configuration file. When you use the Add Adapter Service Reference Visual Studio Plug-in to generate the WCF client class, a configuration file (app.config) is also created for your project. This file contains configuration settings that reflect the binding properties and connection information (except credentials) that you specified when you connected to the SQL database with the Add Adapter Service Reference Plug-in.

Specifying the Binding and Endpoint Address in Code

The following code shows how to create a WCF client by specifying the binding and endpoint address in code by using the ClientCredentials property of the WCF client.

Copy Code
SqlAdapterBinding binding = new SqlAdapterBinding();
EndpointAddress sqlAddress = new EndpointAddress("mssql://<sql_server_name>//<database_name>?");

TableOp_dbo_CustomerClient client = new TableOp_dbo_CustomerClient (binding, sqlAddress);

client.ClientCredentials.UserName.UserName = "USER";
client.ClientCredentials.UserName.Password = "PASSWORD";

client.Open();

Specifying the Binding and Endpoint Address in a Configuration File

The following code shows how to create a WCF client by specifying the binding and endpoint address in an app.config file.

Copy Code
TableOp_dbo_CustomerClient client = new TableOp_dbo_CustomerClient("SqlAdapterBinding_TableOp_dbo_Customer");

client.ClientCredentials.UserName.UserName = "USER";
client.ClientCredentials.UserName.Password = "PASSWORD";

client.Open();

The following XML shows the configuration file created for the Customer table by the Add Adapter Service Reference Plug-in. This file contains the client endpoint configuration referenced in the preceding example.

Copy Code
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <system.serviceModel>
        <bindings>
            <sqlBinding>
                <binding name="SqlAdapterBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" maxConnectionPoolSize="100"
                    encrypt="false" useAmbientTransaction="true" batchSize="20"
                    polledDataAvailableStatement="" pollingStatement="" pollingIntervalInSeconds="30"
                    pollWhileDataFound="false" notificationStatement="" notifyOnListenerStart="true"
                    enableBizTalkCompatibilityMode="true" chunkSize="4194304"
                    inboundOperationType="Polling" useDatabaseNameInXsdNamespace="false"
                    allowIdentityInsert="false" enablePerformanceCounters="false"
                    xmlStoredProcedureRootNodeName="" xmlStoredProcedureRootNodeNamespace="" />
            </sqlBinding>
        </bindings>
        <client>
            <endpoint address="mssql://<sql_server_name>//<database_name>?" binding="sqlBinding"
                bindingConfiguration="SqlAdapterBinding" contract="TableOp_dbo_Customer"
                name="SqlAdapterBinding_TableOp_dbo_Customer" />
        </client>
    </system.serviceModel>
</configuration>

If a project has more than one WCF client, there will be multiple client endpoint entries defined in the configuration file. Each WCF client entry will have a unique name based on its binding configuration and target SQL Server artifact; for example, "SqlAdapterBinding_TableOp_dbo_Customer". If you connect multiple times to create the WCF clients in your project, multiple binding configuration entries will be created, one for each connection. These binding configuration entries will be named in the following manner: SqlAdapterBinding, SqlAdapterBinding1, and so on. Each client endpoint entry created during a specific connection will reference the binding entry created during that connection.

See Also

Tasks

Specifying the Connection URI

Concepts

Generating a WCF Client or WCF Service Contract for SQL Server Artifacts

Other Resources

Developing Applications by Using the WCF Service Model


Performing Insert, Update, Delete, and Select Operations by Using the WCF Service Model

The Microsoft BizTalk Adapter for SQL Server discovers a set of basic Insert, Select, Update, and Delete operations on SQL Server database tables and views. By using these operations, you can perform simple SQL Insert, Select, Update, and Delete statements qualified by a Where clause on a target table or view. This topic provides instructions on how to perform these operations using the WCF service model.

For more information on how the adapter supports these operations, see Performing Basic Insert, Update, Delete, and Select Operations on Tables and Views.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

About the Examples Used in this Topic

The example in this topic performs operations on the Employee table. The Employee table is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, EmployeeBasicOps, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Client Class

The name of the WCF client generated for the basic SQL operations that the SQL adapter discovers is based on the name of the table or view, as listed in the following table.

SQL Server Database Artifact | WCF Client Name
Table | TableOp_[Schema]_[TABLE_NAME]Client
View | ViewOp_[Schema]_[VIEW_NAME]Client

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[TABLE_NAME] = The name of the table; for example, Employee.

[VIEW_NAME] = The name of the view; for example, Employee_View.

Method Signature for Invoking Operations on Tables

The following table shows the method signatures for the basic operations on a table. The signatures are the same for a view, except that the view namespace and name replace those of the table.

Operation | Method Signature
Insert | long[] Insert([TABLE_NS].[TABLE_NAME][] Rows);
Select | [TABLE_NS].[TABLE_NAME][] Select(string COLUMNS, string QUERY);
Update | int Update([TABLE_NS].[TABLE_NAME].RowPair[] Rows);
Delete | int Delete([TABLE_NS].[TABLE_NAME][] Rows);

[TABLE_NS] = The name of the table namespace; for example, schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee.

[TABLE_NAME] = The name of the table; for example, Employee.

As an example, the following code shows the method signatures for a WCF client class generated for the Delete, Insert, Select and Update operations on the Employee table under the default “dbo” schema.

Copy Code
public partial class TableOp_dbo_EmployeeClient : System.ServiceModel.ClientBase<TableOp_dbo_Employee>, TableOp_dbo_Employee {
    public int Delete(schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] Rows);

    public long[] Insert(schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] Rows);

    public schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] Select(string Columns, string Query);

    public int Update(schemas.microsoft.com.Sql._2008._05.TableOp.dbo.Employee.RowPair[] Rows);
}

In this snippet, TableOp_dbo_EmployeeClient is the name of the WCF class in the SqlAdapterBindingClient.cs generated by the Add Adapter Service Reference Plug-in.

Parameters for Table Operations

This section provides the parameters required by each table operation

Insert Operation

Insert operation type | RECORDSET
Multiple record | A collection of INSERTRECORDS that should be inserted into the table.

The insert operation returns an array of Long data type and stores the identity values of the inserted rows, if any. If there is no identity column in a table, the return value is NULL.

Select Operation

COLUMN_NAMES | QUERY
A comma-delimited list of column names in the target; for example, "Employee_ID, Designation". The column list specifies the columns of the target that should be returned in the result set. Columns not specified in the column list will be set to their .NET default values in the returned record set. For nillable columns, this value is null. | The contents of a SQL WHERE clause that specifies the target rows of the query; for example, "Designation = 'Manager'". You can set this parameter to null to return all rows of the target.

The return value of the Select operation is a strongly-typed result set that contains the specified columns and rows from the target table or view.

Update Operation

First row of the pair | Second row of the pair
The first record of the record pair corresponds to new values that need to be updated, that is, it corresponds to the SET clause of the UPDATE statement. This can be set using RowPair.After. | The second record of the record pair corresponds to the old values of the rows, that is, it corresponds to the WHERE clause of the UPDATE statement. This can be set using RowPair.Before.

The return value of the Update operation is of Int32 data type, and denotes the number of rows updated.

Important
While specifying the record that has to be updated, you must provide values for all the columns, even if all values are not being updated. For example, if a row has five columns and the Update operation updates only 2 columns, as part of RowPair.Before, you must pass all the 5 column values. However, for RowPair.After, you can specify only the columns that will be updated.

Delete Operation

The Delete operation takes as input a strongly-typed array of records. The return value of the Delete operation is of Int32 data type, and denotes the number of rows deleted.

Creating a WCF Client to Invoke Operations on Tables and Views

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section describes how to create a WCF client to invoke basic Insert, Select, Update, Delete operations on a table.

To create a WCF client to perform operations on tables

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the Insert, Select, Update, and Delete operation on the Employee table. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

    Important
    Before generating the WCF client class, make sure you set the EnableBizTalkCompatibilityMode binding property to false.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs file and create a client as described in the snippet below.

    Copy Code
    TableOp_dbo_EmployeeClient client = new TableOp_dbo_EmployeeClient("SqlAdapterBinding_TableOp_dbo_Employee");
client.ClientCredentials.UserName.UserName = "<Enter user name here>";
client.ClientCredentials.UserName.Password = "<Enter password here>";

    In this snippet, TableOp_dbo_EmployeeClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_TableOp_dbo_Employee is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the Insert operation on the Employee table.

    Copy Code
    long[] recordsInserted;

schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] insertRecord =
new schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[1];

insertRecord[0] = new schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee();
insertRecord[0].Name = "John Smith";
insertRecord[0].Designation = "Manager";
insertRecord[0].Salary = 500000;

try
{
   Console.WriteLine("Inserting new table entry...");
   recordsInserted = client.Insert(insertRecord);
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

Console.WriteLine("Record inserted");
Console.WriteLine("Press any key to continue ...");
Console.ReadLine();

    You can replace the preceding code snippet to perform Select, Update, or Delete operations as well. You can also append the code snippets to perform all operation in a single application. For code snippets on how to perform these operations, see Select Operation, Update Operation, and Delete Operation respectively.

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The application inserts a record in the Employee table.

Select Operation

The following code shows a Select operation that targets the Employee table. The Select operation selects the last record inserted into the table. The returned records are written to the console.

Copy Code
schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] selectRecords;

try
{
   Console.WriteLine("Selecting Row...");
   selectRecords = client.Select("*", "where [Employee_ID] = (select IDENT_CURRENT('Employee'))");
}

catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

Console.WriteLine("The details of the newly added employee are:");
Console.WriteLine("********************************************");
for (int i = 0; i < selectRecords.Length; i++)
{
   Console.WriteLine("Employee ID        : " + selectRecords[i].Employee_ID);
   Console.WriteLine("Employee Name      : " + selectRecords[i].Name);
   Console.WriteLine("Employee Desigation: " + selectRecords[i].Designation);
   Console.WriteLine();
}
Console.WriteLine("********************************************");
Console.WriteLine("Press any key to continue ...");
Console.ReadLine();

Update Operation

The following code shows an Update operation that targets the Employee table.

Copy Code
int result;

schemas.microsoft.com.Sql._2008._05.TableOp.dbo.Employee.RowPair updateRecordPair =
   new schemas.microsoft.com.Sql._2008._05.TableOp.dbo.Employee.RowPair();

schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee updateRecord =
   new schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee();

schemas.microsoft.com.Sql._2008._05.TableOp.dbo.Employee.RowPair[] updateArray =
   new schemas.microsoft.com.Sql._2008._05.TableOp.dbo.Employee.RowPair[1];

updateRecord = insertRecord[0];
updateRecord.Name = "Jeff Smith";

updateRecordPair.After = updateRecord;
updateRecordPair.Before = selectRecords[0];

updateArray[0] = updateRecordPair;

try
{
   Console.WriteLine("Updating the database...");
   result = client.Update(updateArray);
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

Console.WriteLine("Updated Record for {0}", updateRecordPair.Before.Name);
Console.WriteLine("The new name for the employee is {0}", updateRecordPair.After.Name);
Console.WriteLine("Press any key to continue ...");
Console.ReadLine();

Delete Operation

The following code shows a Delete operation that targets the Employee table.

Copy Code
int deleteSuccess;

schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] deleteRecords =
   new schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[1];

deleteRecords = client.Select("*", "where [Employee_ID] = (select IDENT_CURRENT('Employee'))");

Console.WriteLine("Following employees will be deleted from the database:");
for (int i = 0; i < deleteRecords.Length; i++)
{
   Console.WriteLine("Name: {0}", deleteRecords[i].Name);
}
Console.WriteLine("Press any key to begin deletion...");
Console.ReadLine();

try
{
   Console.WriteLine("Deleting employee record...");
   deleteSuccess = client.Delete(deleteRecords);
}

catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Performing Operations on Tables and Views with Large Data Types by Using the WCF Service Model

The SQL adapter enables adapter clients to read and update data in columns of large data types, that is, varchar(max), nvarchar(max), or varbinary(max). To read data from such columns, adapter clients can use the Select operation. To insert or update data into such columns, the adapter exposes a Set<column_name> operation, where <column_name> is the name of the column of type varchar(max), nvarchar(max), or varbinary(max).

Additionally, in SQL Server 2008, you can have the varbinay(max) column store unstructured data such as text documents and images. Such unstructured data is called FILESTREAM data. FILESTREAM data can be stored as files on the file system. The SQL adapter enables the client to enter FILESTREAM data into columns of type varbinary(max). For more information about FILESTREAM storage, see http://go.microsoft.com/fwlink/?LinkId=122485.

This topic provides information about certain tasks you must perform on the computer running SQL Server and the computer running the adapter client to be able to insert or update FILESTREAM data. This topic also provides instructions on performing Set<column_name> operations to insert FILESTREAM data.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

Prerequisites

You must perform the following tasks on the computer running SQL Server 2008 and the computer running the adapter client.

Note
If you are performing Set<column_name> operations on SQL Server 2005, you do not need to perform these tasks. You can directly start with the next section. This is because FILESTREAM is not supported on SQL Server 2005.

  • On the computer running SQL Server 2008

    • You must enable FILESTREAM on the SQL Server instance. For more information, see http://go.microsoft.com/fwlink/?LinkId=122486.

    • You must create a FILESTREAM-enabled database. For more information, see http://go.microsoft.com/fwlink/?LinkId=122487.

    • You must have a table for storing FILESTREAM data. For more information, see http://go.microsoft.com/fwlink/?LinkId=122488.

  • On the computer running the adapter client

    • You must have the SQL Client Connectivity SDK installed. You can install the SQL Client Connectivity SDK by running the SQL Server 2008 setup and selecting SQL Client Connectivity SDK in the Feature Selection page of the wizard. The adapter uses the sqlncli10.dll, installed with the SQL Client Connectivity SDK, to perform FILESTREAM operations.

After you have completed these tasks, you are all set to insert or update FILESTREAM data in SQL Server 2008 database tables.

How This Topic Demonstrates Operations on Large Data Types

To demonstrate how to perform Set<column_name> operations on tables with large data types, take a table, Records, that has columns Id and Document:

  • The Records table, with all the data, is created by running the SQL script provided with the samples. For more information, see Samples.

  • The Id column is of type uniqueidentifier and takes a GUID. Assume that the Id column already has a GUID ‘438B7B4C-5491-409F-BCC1-78817C399EC3’.

  • The Document column is of type VARBINARY(MAX). To update the Document column, the adapter exposes the SetDocument operation.

Note
For SQL Server 2008, to demonstrate FILESTREAM operations, assume that the Document column can store FILESTREAM data.

About the Examples Used in this Topic

The example in this topic performs operations on the Records table. The Records table is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, Records_FILESTREAM_Op, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Client Class

The name of the WCF client generated for the operations on large data types that the SQL adapter discovers, is based on the name of the table or view, as listed in the following table.

SQL Server Database Artifact | WCF Client Name
Table | TableOp_[Schema]_[TABLE_NAME]Client
View | ViewOp_[Schema]_[VIEW_NAME]Client

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

Method Signature for Invoking Operations on Columns of Large Data Types

The following table shows the method signatures for the basic operations on a table. The signatures are the same for a view, except that the view namespace and name replace those of the table.

Operation | Method Signature
Set<column_name> | public void Set<column_name>(string Filter, byte[] Data);

<column_name> = Name of the column of large data type.

As an example, the following code shows the method signatures for a WCF client class generated for the SetDocument operation on the Records table under the default “dbo” schema.

Copy Code
public partial class TableOp_dbo_RecordsClient : System.ServiceModel.ClientBase<TableOp_dbo_Records>, TableOp_dbo_Records {
    public void SetDocument (string Filter, byte[] Data);
}

In this snippet, TableOp_dbo_RecordsClient is the name of the WCF class in the SqlAdapterBindingClient.cs generated by the Add Adapter Service Reference Plug-in.

Parameters for Operations on Columns of Large Data Types

This section provides the parameters required by the Set<column_name> operation.

Parameter name | Description
string Filter | Specifies the WHERE clause based on which the adapter updates the record for the column of large data type.
byte[] Data | Specifies the value that must be updated for the column of large data type.

The Set<column_name> operation does not return any values.

Creating a WCF Client to Invoke Operations on Columns of Large Data Types

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section describes how to create a WCF client to invoke the SetDocument operation on the Records table. The adapter exposes the SetDocument operation to update data in columns of large data types.

To create a WCF client

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the SetDocument operation on the Records table. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql, Microsoft.ServiceModel.Channels, and System.Transactions.

  4. Open the Program.cs file and add the System.Transactions namespace.

  5. In the Program.cs, create a client as described in the snippet below.

    Copy Code
    TableOp_dbo_RecordsClient client = new TableOp_dbo_RecordsClient("SqlAdapterBinding_TableOp_dbo_Records");
client.ClientCredentials.UserName.UserName = "";
client.ClientCredentials.UserName.Password = "";

    In this snippet, TableOp_dbo_RecordsClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_TableOp_dbo_Records is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Caution
    To perform operations on FILESTREAM data, you must always connect to SQL Server using Windows authentication. To connect using Windows authentication, you must provide empty username and password, as shown in the preceding snippet. Also, before using Windows authentication to connect to SQL Server, you must have performed the steps mentioned in Connecting to SQL Server Using Windows Authentication.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying client binding, see Specifying a Client Binding for the SQL Adapter.

  6. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  7. Invoke the SetDocument operation on the Records table.

    Caution
    The Set<column_name> operations must always be performed in a transaction. To ensure this, the Set<column_name> operation must be invoked within a transaction scope and the UseAmbientTransaction binding property must be set to true in the app.config.

    Copy Code
    using (TransactionScope tx = new TransactionScope())
{
    string filter = "WHERE Id='438B7B4C-5491-409F-BCC1-78817C399EC3'";
    byte[] data = ASCIIEncoding.ASCII.GetBytes("Sample data");
    client.SetDocument(filter, data);
    tx.Complete();
}

    Here, the application converts the string “Sample data” into a base64 encoded string, and updates it in the record that satisfies the filter criteria.

  8. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  9. Build the project and then run it. The application updates the Document column in the Records table.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Invoking Stored Procedures Using the WCF Service Model

The SQL adapter discovers the stored procedures as operations that the adapter clients can invoke on the WCF client to invoke the stored procedure. Based on how the stored procedure returns the result set, the adapter categorizes all the stored procedures as:

  • Procedures. Invoking stored procedures from the Procedures node returns an array of DataSet.

  • Strongly-Typed Procedures. Invoking stored procedures from the Strongly-Typed Procedures node returns a strongly-typed result set.

Note that the same set of stored procedures in the database you connected to will be listed both under the Procedures and Strongly-Typed Procedures node. Based on the kind of result set you want, you must invoke the stored procedure from the relevant node. For more information about how the SQL adapter supports stored procedures, see Executing Stored Procedures in SQL Server.

This section provides instructions on how to invoke stored procedures from both the Procedures and Strongly-Typed Procedures node by using a WCF client.

In This Section

  • Invoking Weakly-typed Stored Procedures Using the WCF Service Model

  • Invoking Strongly-typed Stored Procedure Using WCF Service Model

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Invoking Weakly-typed Stored Procedures Using the WCF Service Model

When you invoke a procedure listed under the Procedures node in the Add Adapter Service Reference Plug-in, the output is in the form of a DataSet array. This topic provides instructions on how to create a WCF client to invoke a stored procedure in SQL Server that returns a DataSet array.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

About the Examples Used in this Topic

The example in this topic uses the GET_EMP_DETAILS stored procedure. This stored procedure takes an employee ID as an input parameter and returns all the corresponding columns for the employee with that ID. The GET_EMP_DETAILS stored procedure is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, Execute_StoredProc, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Client Class

The name of the WCF client generated for invoking stored procedures under the Procedures node using the SQL adapter is listed in the following table.

SQL Server Database Artifact | WCF Client Name
Procedure (under the Procedures node) | Procedures_[schema]Client

[schema] is the schema to which the procedure belongs; for example “dbo”.

Method Signature for Invoking Stored Procedures

The following table shows the signature for the method exposed to invoke the stored procedures.

Operation | Method Signature
Procedure name | System.Data.DataSet[] [procedure_name](param1, param2, …)

[procedure_name] is the name of the procedure; for example GET_EMP_DETAILS

As an example, the signature for the method to invoke the GET_EMP_DETAILS procedure is shown in the following code snippet.

Copy Code
public partial class Procedures_dboClient : System.ServiceModel.ClientBase<Procedures_dbo>, Procedures_dbo {
  public System.Data.DataSet[] GET_EMP_DETAILS(System.Nullable<int> emp_id, out int ReturnValue);
}

In this snippet,

  • Procedures_dboClient is the name of the WCF client class. In this example, you use this class to create a client to invoke the stored procedure.

  • public System.Data.DataSet[] GET_EMP_DETAILS(System.Nullable<int> emp_id, out int ReturnValue) is the method that you invoke in this example to invoke the stored procedure. This stored procedure takes an employee ID and returns a DataSet array.

Creating a WCF Client to Invoke a Stored Procedure in SQL Server

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section specifically describes how to create a WCF client that invokes a stored procedure, the result set for which is a DataSet array. In this topic, as an example, you invoke the GET_EMP_DETAILS stored procedure. This stored procedure is created by running the SQL script provided with each sample.

To create a WCF client to invoke a stored procedure

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the GET_EMP_DETAILS stored procedure. Make sure you select the procedure under the Procedures node. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

    Important
    Before generating the WCF client class, make sure you set the EnableBizTalkCompatibilityMode binding property to false.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs file and create a client as described in the snippet below.

    Copy Code
    Procedures_dboClient client = new Procedures_dboClient("SqlAdapterBinding_Procedures_dbo");

client.ClientCredentials.UserName.UserName = "<Enter username here>";
client.ClientCredentials.UserName.Password = "<Enter password here>";

    In this snippet, Procedures_dboClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_Procedures_dbo is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the GET_EMP_DETAILS stored procedure. Before you invoke the GET_EMP_DETAILS procedure, you must add the System.Data namespace to your code.

    Copy Code
    DataSet[] dataArray;
int returnCode;

try
{
   Console.WriteLine("Calling a stored procedure...");
   dataArray = client.GET_EMP_DETAILS(10001, out returnCode);  //Invoke the stored procedure
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}
Console.WriteLine("The details for the employee with ID '10001' are:");
Console.WriteLine("*************************************************");

foreach (DataSet dataSet in dataArray)
{
   foreach (DataTable tab in dataArray[0].Tables)
   {
      foreach (DataRow row in tab.Rows)
      {
         for (int i = 0; i < tab.Columns.Count; i++)
         {
            Console.WriteLine(row[i]);
         }
      }
   }
}
Console.WriteLine("*************************************************");

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The details for the employee, for which you provided the ID, are displayed on the console.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Invoking Strongly-typed Stored Procedure Using WCF Service Model

When you invoke a procedure listed under the Strongly-Typed Procedures node in the Add Adapter Service Reference Plug-in, the output is in the form of a strongly-typed result set. This topic provides instructions on how to create a WCF client to invoke stored procedures in SQL Server that return a strongly-typed result set.

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types before you start developing your application.

About the Examples Used in this Topic

The example in this topic uses the GET_EMP_DETAILS stored procedure. This stored procedure takes an employee ID as an input parameter and returns all the corresponding columns for the employee with that ID. The GET_EMP_DETAILS stored procedure is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, Execute_TypedStoredProcedure, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Client Class

The name of the WCF client generated for invoking stored procedures under the Strongly-Typed Procedures node using the SQL adapter is listed in the following table.

SQL Server Database Artifact | WCF Client Name
Procedure (under the Strongly-Typed Procedures node) | TypedProcedures_[schema]Client

[schema] is the schema to which the procedure belongs; for example “dbo”.

Method Signature for Invoking Stored Procedures

The following table shows the signature for the method exposed to invoke the stored procedures.

Operation | Method Signature
Procedure name | [PROC_NS] [procedure_name](param1, param2, …)

[PROC_NS] is the procedure namespace; for example schemas.microsoft.com.Sql._2008._05.ProceduresResultSets.dbo.GET_EMP_DETAILS.StoredProcedureResultSet0[]

[procedure_name] is the name of the procedure; for example GET_EMP_DETAILS

As an example, the signature for the method to invoke the GET_EMP_DETAILS procedure is shown in the following code snippet.

Copy Code
public partial class TypedProcedures_dboClient : System.ServiceModel.ClientBase<TypedProcedures_dbo>, TypedProcedures_dbo{
public schemas.microsoft.com.Sql._2008._05.ProceduresResultSets.dbo.GET_EMP_DETAILS.StoredProcedureResultSet0[]
  GET_EMP_DETAILS(System.Nullable<int> emp_id, out int ReturnValue);
}

In this snippet,

  • TypedProcedures_dboClient is the name of the class. In this example, you use this class to create a client to invoke the stored procedure.

  • public schemas.microsoft.com.Sql._2008._05.ProceduresResultSets.dbo.GET_EMP_DETAILS.StoredProcedureResultSet0[] GET_EMP_DETAILS(System.Nullable<int> emp_id, out int ReturnValue) is the method that you invoke in this example to invoke the stored procedure. This stored procedure takes an employee ID and returns a strongly-typed result set.

Creating a WCF Client to Invoke a Stored Procedure in SQL Server

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section specifically describes how to create a WCF client that invokes a stored procedure, the result set for which is strongly-typed. In this topic, as an example, you invoke the GET_EMP_DETAILS stored procedure. This stored procedure is created by running the SQL script provided with each sample.

To create a WCF client to invoke a stored procedure

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the GET_EMP_DETAILS stored procedure. Make sure you select the procedure under the Strongly-Typed Procedures node. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

    Important
    Before generating the WCF client class, make sure you set the EnableBizTalkCompatibilityMode binding property to false.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs file and create a client as described in the snippet below.

    Copy Code
    TypedProcedures_dboClient client = new TypedProcedures_dboClient("SqlAdapterBinding_TypedProcedures_dbo");
client.ClientCredentials.UserName.UserName = "<Enter username here>";
client.ClientCredentials.UserName.Password = "<Enter username here>";

    In this snippet, TypedProcedures_dboClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_TypedProcedures_dbo is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the GET_EMP_DETAILS stored procedure as described in the snippet below.

    Copy Code
    // Create array of type as specified in the method signature
schemas.microsoft.com.Sql._2008._05.ProceduresResultSets.dbo.GET_EMP_DETAILS.StoredProcedureResultSet0[] resultSet =
   new schemas.microsoft.com.Sql._2008._05.ProceduresResultSets.dbo.GET_EMP_DETAILS.StoredProcedureResultSet0[1];
int returnCode;

try
{
   Console.WriteLine("Calling a stored procedure...");
   resultSet = client.GET_EMP_DETAILS(10001, out returnCode);  //Invoke the stored procedure
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}
Console.WriteLine("The details for the employee with ID '10001' are:");
Console.WriteLine("*************************************************");

for (int i = 0; i < resultSet.Length; i++)
   {
      Console.WriteLine("Employee Name        : " + resultSet[i].Name);
      Console.WriteLine("Employee Designation : " + resultSet[i].Designation);
      Console.WriteLine("Employee Salary      : " + resultSet[i].Salary);
   }

Console.WriteLine("*************************************************");

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The name, designation, and salary for the employee ID, are displayed on the console.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Invoking Scalar Functions in SQL Server by Using the WCF Service Model

You can use the SQL adapter in a .NET application using the WCF service model to invoke scalar functions in SQL Server. The adapter exposes the scalar functions as methods that can be invoked directly on SQL Server. For more information about how the adapter supports scalar functions, see Executing Scalar Functions in SQL Server.

How This Topic Demonstrates Invoking Scalar Functions Using the WCF Service Model

This topic demonstrates how to invoke the GET_EMP_ID function in a SQL Server database. The GET_EMP_ID function takes the designation of an employee in the Employee table and returns the corresponding employee ID. The GET_EMP_ID function and the Employee table are created by running the SQL script provided with the samples. For more information, see Samples.

About the Examples Used in this Topic

The example in this topic invoked the GET_EMP_ID scalar function on the Employee table. The GET_EMP_ID function and the Employee table are created by running the SQL script provided with the samples. A sample, ScalarFunction_ServiceModel, which is based on this topic, is also provided with the SQL adapter samples. For more information, see Samples.

The WCF Client Class

The name of the WCF client generated for invoking the scalar function in SQL Server using the SQL adapter is listed in the following table.

SQL Server Database Artifact | WCF Client Name
Scalar function | ScalarFunctions_[SCHEMA]Client

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

Method Signature for Invoking Scalar Functions

The following table shows the method signatures for the basic operations on a table. The signatures are the same for a view, except that the view namespace and name replace those of the table.

Operation | Method Signature
Scalar function name | public <return_type><scalar_function_name>(param1, param2, …)

<retrun_type> = Return type defined in the function definition

<scalar_function_name> = Name of the scalar function.

As an example, the following code shows the method signatures for a WCF client class generated for the GET_EMP_ID scalar functions, in the dbo schema, which takes the employee designation as a parameter and returns an employee ID (integer).

Copy Code
public partial class ScalarFunctions_dboClient : System.ServiceModel.ClientBase<ScalarFunctions_dbo>, ScalarFunctions_dbo {
    public System.Nullable<int> GET_EMP_ID(string emp_desig);
}

In this snippet, ScalarFunctions_dboClient is the name of the WCF class in the SqlAdapterBindingClient.cs generated by the Add Adapter Service Reference Plug-in.

Parameters for Invoking Scalar Functions

The parameters for the methods exposed by the SQL adapter to invoke a scalar function are the same as the parameters defined in the scalar function definition in SQL Server. For example, the parameter for invoking the GET_EMP_ID scalar function is emp_desig and takes an employee’s designation.

Again, the return value for a scalar function is same as the return value defined in the scalar function definition in SQL Server. For example, the return value for the GET_EMP_ID function is an employee’s ID of type integer.

Creating a WCF Client to Invoke Scalar Functions

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section describes how to create a WCF client to invoke the GET_EMP_ID scalar function.

To create a WCF client

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the GET_EMP_ID scalar function. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs and create a client as described in the snippet below.

    Copy Code
    ScalarFunctions_dboClient client = new ScalarFunctions_dboClient("SqlAdapterBinding_ScalarFunctions_dbo");
client.ClientCredentials.UserName.UserName = "<Enter user name here>";
client.ClientCredentials.UserName.Password = "<Enter password here>";

    In this snippet, ScalarFunctions_dboClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_ScalarFunctions_dbo is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying then client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the GET_EMP_ID function to retrieve the ID for an employee with the designation as “Manager”.

    Copy Code
    Console.WriteLine("Invoking the GET_EMP_ID function");
string emp_designation = "Manager";
try
{
      System.Nullable<int> emp_id = client.GET_EMP_ID(emp_designation);
      Console.WriteLine("The Employee ID for the employee with 'Manager' designation is:" + emp_id);
}
catch (Exception e)
{
      Console.WriteLine("Exception: " + e.Message);
      throw;
}
    Note
    For the sake of simplicity, the Employee table has only one employee with “Manager” designation. If your target table has more employees with the same designation, you must define the function accordingly.

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The application displays the employee ID of the employee with the designation of “Manager”.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Invoking Table-Valued Functions in SQL Server by Using the WCF Service Model

You can use the SQL adapter in a .NET application using the WCF service model to invoke table-valued functions in SQL Server. The adapter exposes the table-valued functions as methods that can be invoked directly on SQL Server. For more information about how the adapter supports scalar functions, see Executing Table-Valued Functions in SQL Server.

How This Topic Demonstrates Invoking Scalar Functions Using the WCF Service Model

This topic demonstrates how to invoke the TVF_EMPLOYEE function in a SQL Server database. The TVF_EMPLOYEE function takes the designation of an employee in the Employee table and returns the record for the employee. The TVF_EMPLOYEE function and the Employee table are created by running the SQL script provided with the samples. For more information, see Samples.

About the Examples Used in this Topic

The example in this topic invoked the TVF_EMPLOYEE table-valued function on the Employee table. TVF_EMPLOYEE function and the Employee table are created by running the SQL script provided with the samples. A sample, TableFunction_ServiceModel, which is based on this topic, is also provided with the SQL adapter samples. For more information, see Samples.

The WCF Client Class

The name of the WCF client generated for invoking the scalar function in SQL Server using the SQL adapter is listed in the following table.

SQL Server Database Artifact | WCF Client Name
Table-valued function | TableValuedFunctions_[SCHEMA]Client

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

Method Signature for Invoking Table-valued Functions

The following table shows the method signatures for the basic operations on a table. The signatures are the same for a view, except that the view namespace and name replace those of the table.

Operation | Method Signature
Table-valued function name | public [NAMESPACE][FUNCTION_NAME][] [FUNCTION_NAME](param1, param2, …)

[NAMESPACE] = The namespace, for example, schemas.microsoft.com.Sql._2008._05.Types.TableFunctionReturnTables.dbo.TVF_EMPLOYEE

[FUNCTION_NAME] = Name of the table-valued function.

As an example, the following code shows the method signatures for a WCF client class generated for the TVF_EMPLOYEE scalar functions, in the dbo schema, which takes the employee designation as a parameter and returns the employee record.

Copy Code
public partial class TableValuedFunctions_dboClient : System.ServiceModel.ClientBase<TableValuedFunctions_dbo>, TableValuedFunctions_dbo {
    public schemas.microsoft.com.Sql._2008._05.Types.TableFunctionReturnTables.dbo.TVF_EMPLOYEE[] TVF_EMPLOYEE(string emp_desig);
}

In this snippet, TableValuedFunctions_dboClient is the name of the WCF class in the SqlAdapterBindingClient.cs generated by the Add Adapter Service Reference Plug-in.

Parameters for Invoking Table-valued Functions

The parameters for the methods exposed by the SQL adapter to invoke a table-valued function are the same as the parameters defined in the function definition in SQL Server. For example, the parameter for invoking the TVF_EMPLOYEE table-valued function is emp_desig and takes an employee’s designation.

Again, the return value for a table-valued function is same as the return value defined in the function definition in SQL Server. For example, the return value for the TVF_EMPLOYEE function is an array of records of type schemas.microsoft.com.Sql._2008._05.Types.TableFunctionReturnTables.dbo.TVF_EMPLOYEE[].

Creating a WCF Client to Invoke Table-valued Functions

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section describes how to create a WCF client to invoke the TVF_EMPLOYEE table-valued function.

To create a WCF client

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the TVF_EMPLOYEE scalar function. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs and create a client as described in the snippet below.

    Copy Code
    TableValuedFunctions_dboClient client = new TableValuedFunctions_dboClient("SqlAdapterBinding_TableValuedFunctions_dbo");
client.ClientCredentials.UserName.UserName = "<Enter user name here>";
client.ClientCredentials.UserName.Password = "<Enter password here>";

    In this snippet, TableValuedFunctions_dboClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_TableValuedFunctions_dbo is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying then client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the TVF_EMPLOYEE function to retrieve all the employee records having the “Manager” designation.

    Copy Code
    Console.WriteLine("Invoking the TVF_EMPLOYEE function");
schemas.microsoft.com.Sql._2008._05.Types.TableFunctionReturnTables.dbo.TVF_EMPLOYEE[] emp_details;
string emp_designation = "Manager";

try
{
    emp_details = client.TVF_EMPLOYEE(emp_designation);
}
catch (Exception e)
{
    Console.WriteLine("Exception: " + e.Message);
    throw;
}
Console.WriteLine("The details for the employee with the 'Manager' designation are:");
Console.WriteLine("*******************************************************************");
for (int i = 0; i < emp_details.Length; i++)
{
    Console.WriteLine("Employee ID        : " + emp_details[i].Employee_ID);
    Console.WriteLine("Employee Name      : " + emp_details[i].Name);
    Console.WriteLine("Employee Desigation: " + emp_details[i].Designation);
    Console.WriteLine("Employee Salary    : " + emp_details[i].Salary);
    Console.WriteLine();
}

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The application displays the employee ID, name, and salary of all the employees with a “Manager” designation.

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using WCF Service Model

The SQL adapter exposes generic SQL Server operations such as ExecuteNonQuery, ExecuteReader, and ExecuteScalar. You can use these operations to execute any SQL statement on a SQL Server database. These operations differ based on the kind of response you get for the SQL statement. For more information about how the adapter supports these operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

This topic demonstrates how to perform an ExecuteReader operation using the SQL adapter using the WCF service model. You can follow the same set of procedures described in this topic to perform ExecuteNonQuery and ExecuteScalar operations.

About the Examples Used in this Topic

The example in this topic uses the ExecuteReader operation to execute the ADD_EMP_DETAILS stored procedure. This stored procedure adds a record to the Employee table and returns the employee ID for the record. The ADD_EMP_DETAILS stored procedure is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, Execute_Reader, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Client Class

The name of the WCF client generated for invoking generic operations (ExecuteNonQuery, ExecuteReader, or ExecuteScalar) using the SQL adapter is listed in the following table.

Operations | WCF Client Name
ExecuteNonQuery, ExecuteReader, or ExecuteScalar | GenericTableOpClient

Method Signature for Invoking Generic Operations

The following table shows the signature for the method exposed to invoke the generic operations.

Operation | Method Signature
ExecuteNonQuery | int ExecuteNonQuery(string Query)
ExecuteReader | System.Data.DataSet[] ExecuteReader(string Query)
ExecuteScalar | string ExecuteScalar(string Query)

As an example, the signature for the generic operation methods is shown in the following code snippet.

Copy Code
public partial class GenericTableOpClient : System.ServiceModel.ClientBase<GenericTableOp>, GenericTableOp {
  public int ExecuteNonQuery(string Query);
  public System.Data.DataSet[] ExecuteReader(string Query);
  public string ExecuteScalar(string Query);
}

In this snippet,

  • GenericTableOpClient is the name of the class. In this example, you use this class to create a client to invoke the generic operation, ExecuteReader.

  • public System.Data.DataSet[] ExecuteReader(string Query) is the method that you invoke in this example to invoke the ADD_EMP_DETAILS stored procedure.

Creating a WCF Client to Invoke an ExecuteReader Operation

The generic set of actions required to perform an operation on SQL Server using a WCF client involves a set of tasks described in Overview of Using the WCF Service Model with the Adapter. This section specifically describes how to create a WCF client that invokes an ExecuteReader operation to execute the ADD_EMP_DETAILS stored procedure. This stored procedure is created by running the SQL script provided with each sample.

To create a WCF client to invoke ExecuteReader operation

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the ExecuteReader generic operation. This operation is available under the root node when you connect to the SQL Server database using the Add Adapter Service Reference Plug-in. For more information about generating a WCF client class, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

    Important
    Before generating the WCF client class, make sure you set the EnableBizTalkCompatibilityMode binding property to false.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.Sql and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs file and create a client as described in the snippet below.

    Copy Code
    GenericTableOpClient client = new GenericTableOpClient("SqlAdapterBinding_GenericTableOp");
  client.ClientCredentials.UserName.UserName = "<Enter username here>";
  client.ClientCredentials.UserName.Password = "<Enter password here>";

    In this snippet, GenericTableOpClient is the WCF client defined in SqlAdapterBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in. SqlAdapterBinding_GenericTableOp is the name of the client endpoint configuration and is defined in the app.config. This file is also generated by the Add Adapter Service Reference Plug-in and contains the binding properties and other configuration settings.

    Note
    In this snippet, you use the binding and endpoint address from the configuration file. You can also explicitly specify these values in your code. For more information on the different ways of specifying client binding, see Specifying a Client Binding for the SQL Adapter.

  5. Open the client as described in the snippet below:

    Copy Code
    try
{
   Console.WriteLine("Opening Client...");
   client.Open();
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}

  6. Invoke the ExecuteReader operation for the ADD_EMP_DETAILS stored procedure. Before you invoke the ExecuteReader operation, you must add the System.Data namespace to your code.

    Copy Code
    string query = "EXEC ADD_EMP_DETAILS 'Tom Smith', 'Manager', 500000";
DataSet[] dsArray = client.ExecuteReader(query);

Console.WriteLine("Invoking the ADD_EMP_DETAILS stored procedure using ExecuteReader");
Console.WriteLine("*****************************************************");
foreach (DataSet dataSet in dsArray)
{
   foreach (DataTable tab in dsArray[0].Tables)
   {
       foreach (DataRow row in tab.Rows)
       {
          for (int i = 0; i < tab.Columns.Count; i++)
          {
             Console.WriteLine("The ID for the newly added employee is : " + row[i]);
          }
       }
    }
}
Console.WriteLine("*****************************************************");

  7. Close the client as described in the snippet below:

    Copy Code
    client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();

  8. Build the project and then run it. The employee ID of the newly inserted employee is displayed on the console.


Polling SQL Server by Using the SQL Adapter with WCF Service Model

You can configure the SQL adapter to receive polling-based data-changed messages from SQL Server. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set. Based on the type of polling message received, the adapter exposes different polling operations:

  • Polling. This operation returns a data set as part of the polling message.

  • TypedPolling. This operation returns a strongly-typed polling message.

  • XmlPolling. This operation returns the polling message as an XML message. You must use this operation if you want to use SELECT statements or stored procedures that use the FOR XML clause to return data as XML messages. For more information about the FOR XML clause, see http://go.microsoft.com/fwlink/?LinkId=131402.

For more information about these polling operations, see Support for Polling.

Note
The SQL adapter enables adapter clients to have a single application with more than one Polling or TypedPolling operations for the same database or table. To support such a scenario, the adapter includes a unique ID— InboundID—in the connection URI. This ID, when added to the connection URI, makes it unique, thereby enabling multiple polling operations in a single application.

The topics in this section provide instructions on how to use both Polling and TypedPolling operations in a .NET application.

In This Section

  • Receiving Polling-based Data-changed Messages from SQL Server by Using the WCF Service Model

  • Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using WCF Service Model

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Receiving Polling-based Data-changed Messages from SQL Server by Using the WCF Service Model

You can configure the SQL adapter to receive periodic data-change messages for SQL Server tables or views. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set.

For more information on how the adapter supports polling, see Support for Polling.

Note
This topic demonstrates how to use the Polling inbound operation to use polling messages. The message for the Polling operation is not strongly-typed. If you want to get strongly-typed polling message, you must use the TypedPolling operation. You must also use the TypedPolling operation to have multiple polling operations in a single application. For instructions on how to perform TypedPolling operation, see Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using WCF Service Model.

Important
If you want to have more than one polling operation in a single application, you must specify an InboundID connection property as part of the connection URI to make it unique. The inbound ID you specify is added to the operation namespace to make it unique.

How This Topic Demonstrates Polling

In this topic, to demonstrate how the SQL adapter supports receiving data change messages, create a .NET application and generate the WCF service contract for the Polling operation. If you want to specify the polling related binding properties while generating the WCF service contract, specify the PolledDataAvailableStatement as:

Copy Code
SELECT COUNT(*) FROM Employee

The PolledDataAvailableStatement must return a result set with the first cell containing a positive value. If the first cell does not contain a positive value, the adapter does not execute the polling statement.

As part of the polling statement, perform the following operations:

  1. Select all the rows from the Employee table.

  2. Execute a stored procedure (MOVE_EMP_DATA) to move all the records from the Employee table to an EmployeeHistory table.

  3. Execute a stored procedure (ADD_EMP_DETAILS) to add a new record to the Employee table. This procedure takes the employee name, designation, and salary as parameters.

To perform these operations, you must specify the following for the PollingStatement binding property:

Copy Code
SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

After the polling statement is executed, all the records from the Employee table are selected and the message from SQL Server is received. After the MOVE_EMP_DATA stored procedure is executed by the adapter, all the records are moved to the EmployeeHistory table. Then, the ADD_EMP_DETAILS stored procedure is executed to add a new record to the Employee table. The next polling execution will only return a single record. This cycle continues until you close the service host.

Configuring a Polling Query with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure the adapter to receive data-change messages. You must specify these binding properties as part of the .NET application for polling.

Binding Property | Description
InboundOperationType | Specifies whether you want to perform Polling, TypedPolling, or Notification inbound operation. Default is Polling.
PolledDataAvailableStatement | Specifies the SQL statement that the adapter executes to determine whether any data is available for polling. The SQL statement must return a result set consisting of rows and columns. Only if a row is available, the SQL statement specified for the PollingStatement binding property will be executed.
PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter waits for the remaining time in the interval.
PollingStatement | Specifies the SQL statement to poll the SQL Server database table. You can specify a simple SELECT statement or a stored procedure for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property. You can specify any number of SQL statements separated by a semi-colon.
PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to poll SQL Server, read further.

Configuring Polling in the WCF Service Model

To receive the Polling operation when you use the WCF service model, you must:

  1. Generate a WCF service contract (interface) for the Polling operation from the metadata exposed by the adapter. To do this, you could use the Add Adapter Service Reference Visual Studio Plug-in.

  2. Implement a WCF service from this interface.

  3. Host this WCF service using a service host (System.ServiceModel.ServiceHost).

About the Examples Used in this Topic

The examples in this topic poll the Employee table. The example also uses the MOVE_EMP_DATA and ADD_EMP_DETAILS stored procedure. A script to generate these artifacts is supplied with the samples. For more information about the samples, see Samples. A sample, Polling_ServiceModel, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Service Contract and Class

You can use the Add Adapter Service Reference Plug-in to create a WCF service contract (interface) and supporting classes for the Polling operation. For more information about generating a WCF service contract, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

The WCF Service Contract (Interface)

The following code shows the WCF service contract (interface) generated for the Polling operation.

Copy Code
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/", ConfigurationName="PollingOperation")]
public interface PollingOperation {

    // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/Polling/) of message Polling
    // does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
    [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="Polling")]
    [System.ServiceModel.XmlSerializerFormatAttribute()]
    void Polling(Polling request);
}

The Message Contracts

The message contract namespace is modified by the InboundID parameter in the connection URI, if specified. In this example, you did not specify an inbound ID in the connection URI. The request message returns a DataSet.

Copy Code
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="Polling", WrapperNamespace="http://schemas.microsoft.com/Sql/2008/05/Polling/", IsWrapped=true)]
public partial class Polling {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/Polling/", Order=0)]
    [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)]
    [System.Xml.Serialization.XmlArrayItemAttribute("DataSet", Namespace="http://schemas.datacontract.org/2004/07/System.Data", IsNullable=false)]
    public System.Data.DataSet[] PolledData;

    public Polling() {
    }

    public Polling(System.Data.DataSet[] PolledData) {
        this.PolledData = PolledData;
    }
}

WCF Service Class

The Add Adapter Service Reference Plug-in also generates a file that has a stub for the WCF service class implemented from the service contract (interface). The name of the file is SqlAdapterBindingService.cs. You can insert the logic to process the Polling operation directly into this class. The following code shows the WCF service class generated by the Add Adapter Service Reference Plug-in.

Copy Code
namespace SqlAdapterBindingNamespace {

    public class SqlAdapterBindingService : PollingOperation {

        // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/Polling/) of message Polling
        // does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
        public virtual void Polling(Polling request) {
            throw new System.NotImplementedException("The method or operation is not implemented.");
        }
    }
}

Receiving Inbound Messages for Polling Operation

This section provides instructions on how to write a .NET application to receive inbound polling messages using the SQL adapter.

To receive polling messages from the SQL adapter

  1. Use the Add Adapter Service Reference Plug-in to generate a WCF service contract (interface) and helper classes for the Polling operation. For more information, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts. You can optionally specify the binding properties while generating the service contract and helper classes. This guarantees that they are properly set in the generated configuration file.

  2. Implement a WCF service from the interface and helper classes generated in step 1. The Polling method of this class can throw an exception to abort the polling transaction, if an error is encountered processing the data received from the Polling operation; otherwise the method does not return anything. You must attribute the WCF service class as follows:

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    Within the Polling method, you can implement your application logic directly. This class can be found in SqlAdapterBindingService.cs. This code in this example sub-classes the SqlAdapterBindingService class. In this code, the polling message received as a DataSet is written to the console.

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

public class PollingService : SqlAdapterBindingNamespace.SqlAdapterBindingService
{

public override void Polling(Polling request)
{
    Console.WriteLine("\nNew Polling Records Received");
    Console.WriteLine("*************************************************");
    DataSet[] dataArray = request.PolledData;
    foreach (DataTable tab in dataArray[0].Tables)
    {
        foreach (DataRow row in tab.Rows)
        {
            for (int i = 0; i < tab.Columns.Count; i++)
            {
                Console.WriteLine(row[i]);
            }
        }
    }
    Console.WriteLine("*************************************************");
    Console.WriteLine("\nHit <RETURN> to stop polling");
    }
}

  3. Because the SQL adapter does not accept credentials as part of the connection URI, you must implement the following class to pass credentials for the SQL Server database. In the latter part of the application, you will instantiate this class to pass on the SQL Server credentials.

    Copy Code
    class PollingCredentials : ClientCredentials, IServiceBehavior
{
    public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
    {
        bindingParameters.Add(this);
    }

    public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    protected override ClientCredentials CloneCore()
    {
        ClientCredentials clone = new PollingCredentials();
        clone.UserName.UserName = this.UserName.UserName;
        clone.UserName.Password = this.UserName.Password;
        return clone;
    }
}

  4. Create a SqlAdapterBinding and configure the polling operation by specifying the binding properties. You can do this either explicitly in code or declaratively in configuration. At a minimum, you must specify the InboundOperationType, PolledDataAvailableStatement, and PollingStatement.

    Copy Code
    SqlAdapterBinding binding = new SqlAdapterBinding();
binding.InboundOperationType = InboundOperation.Polling;
binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";

  5. Specify SQL Server database credentials by instantiating the PollingCredentials class you created in Step 3.

    Copy Code
    PollingCredentials credentials = new PollingCredentials();
credentials.UserName.UserName = "<Enter user name here>";
credentials.UserName.Password = "<Enter password here>";

  6. Create an instance of the WCF service created in step 2.

    Copy Code
    // create service instance
PollingService service = new PollingService();

  7. Create an instance of System.ServiceModel.ServiceHost by using the WCF service and a base connection URI. The base connection URI cannot contain the inbound ID, if specified. You should also specify the credentials here.

    Copy Code
    // Enable service host
Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };
ServiceHost serviceHost = new ServiceHost(service, baseUri);
serviceHost.Description.Behaviors.Add(credentials);

  8. Add a service endpoint to the service host. To do this:

    • Use the binding created in step 4.

    • Specify a connection URI that contains credentials and, if required, an inbound ID.

    • Specify the contract as "PollingOperation".

    Copy Code
    // Add service endpoint: be sure to specify PollingOperation as the contract
Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");
serviceHost.AddServiceEndpoint("PollingOperation", binding, ConnectionUri);

  9. To receive polling data, open the service host. The adapter will return data whenever the query returns a result set.

    Copy Code
    // Open the service host to begin polling
serviceHost.Open();

  10. To terminate polling, close the service host.

    Important
    The adapter will continue to poll until the service host is closed.

    Copy Code
    serviceHost.Close();

Example

The following example shows a polling query that executes the Employee table. The polling statement performs the following tasks:

  1. Selects all the records from the Employee table.

  2. Executes the MOVE_EMP_DATA stored procedure to move all records from Employee table to EmployeeHistory table.

  3. Executes the ADD_EMP_DETAILS stored procedure to add a single record to the Employee table.

The first polling message will contain all the records from the Employee table. The subsequent polling messages will contain only the last record inserted by the ADD_EMP_DETAILS stored procedure. The adapter will continue to poll until you close the service host by pressing <RETURN>.

Copy Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Adapters.Sql;
using Microsoft.ServiceModel.Channels;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.Collections.ObjectModel;
using System.Data;

namespace Polling_ServiceModel
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    public class PollingService : SqlAdapterBindingNamespace.SqlAdapterBindingService
    {

        public override void Polling(Polling request)
        {
            Console.WriteLine("\nNew Polling Records Received");
            Console.WriteLine("*************************************************");
            DataSet[] dataArray = request.PolledData;
            foreach (DataTable tab in dataArray[0].Tables)
            {
                foreach (DataRow row in tab.Rows)
                {
                    for (int i = 0; i < tab.Columns.Count; i++)
                    {
                        Console.WriteLine(row[i]);
                    }
                }
            }
            Console.WriteLine("*************************************************");
            Console.WriteLine("\nHit <RETURN> to stop polling");
        }
    }

    class PollingCredentials : ClientCredentials, IServiceBehavior
    {
        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
        {
            bindingParameters.Add(this);
        }

        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        protected override ClientCredentials CloneCore()
        {
            ClientCredentials clone = new PollingCredentials();
            clone.UserName.UserName = this.UserName.UserName;
            clone.UserName.Password = this.UserName.Password;
            return clone;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost serviceHost = null;
            try
            {
                Console.WriteLine("Sample started...");
                Console.WriteLine("Press any key to start polling...");
                Console.ReadLine();

                SqlAdapterBinding binding = new SqlAdapterBinding();
                binding.InboundOperationType = InboundOperation.Polling;
                binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
                binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";
                Console.WriteLine("Binding properties assigned...");

                // This URI is used to specify the address for the ServiceEndpoint
                // It must contain the InboundId (if any) that was used to generate
                // the WCF service callback interface
                Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");

                // This URI is used to initialize the ServiceHost. It cannot contain
                // a query_string (InboundID); otherwise,an exception is thrown when
                // the ServiceHost is initialized.
                Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };

                PollingCredentials credentials = new PollingCredentials();
                credentials.UserName.UserName = "<Enter user name here>";
                credentials.UserName.Password = "<Enter password here>";

                Console.WriteLine("Opening service host...");
                PollingService service = new PollingService();
                serviceHost = new ServiceHost(service, baseUri);
                serviceHost.Description.Behaviors.Add(credentials);
                serviceHost.AddServiceEndpoint("PollingOperation", binding, ConnectionUri);
                serviceHost.Open();
                Console.WriteLine("Service host opened...");
                Console.WriteLine("Polling started...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception :" + e.Message);
                Console.ReadLine();

                /* If there is an error it will be specified in the inner exception */
                if (e.InnerException != null)
                {
                    Console.WriteLine("InnerException: " + e.InnerException.Message);
                    Console.ReadLine();
                }
            }
            finally
            {
                // IMPORTANT: you must close the ServiceHost to stop polling
                if (serviceHost.State == CommunicationState.Opened)
                    serviceHost.Close();
                else
                    serviceHost.Abort();
            }
        }
    }
}

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with WCF Service Model


Receiving Strongly-typed Polling-based Data-changed Messages from SQL Server Using WCF Service Model

You can configure the SQL adapter to receive strongly-typed polling messages from SQL Server. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set. You must use strongly-typed polling in a scenario where you want to receive a strongly-typed result set. For more information on how the adapter supports strongly-typed polling, see Support for Polling.

Important
If you want to have more than one polling operation in a single application, you must specify an InboundID connection property as part of the connection URI to make it unique. The inbound ID you specify is added to the operation namespace to make it unique.

How This Topic Demonstrates Polling

In this topic, to demonstrate how the SQL adapter supports receiving strongly-typed data change messages, create a .NET application and generate the WCF service contract for the TypedPolling operation. Make sure you specify the following while generating the WCF service contract:

  • You must specify an InboundID as part of the connection URI.

  • You must specify a polling statement for the PollingStatement binding property.

Additionally, if you want to specify other polling related binding properties while generating the proxy class, specify the PolledDataAvailableStatement as:

Copy Code
SELECT COUNT(*) FROM Employee

The PolledDataAvailableStatement must return a result set with the first cell containing a positive value. If the first cell does not contain a positive value, the adapter does not execute the polling statement.

As part of the polling statement, perform the following operations:

  1. Select all the rows from the Employee table.

  2. Execute a stored procedure (MOVE_EMP_DATA) to move all the records from the Employee table to an EmployeeHistory table.

  3. Execute a stored procedure (ADD_EMP_DETAILS) to add a new record to the Employee table. This procedure takes the employee name, designation, and salary as parameters.

To perform these operations, you must specify the following for the PollingStatement binding property while generating the WCF service contract and helper classes:

Copy Code
SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

After the polling statement is executed, all the records from the Employee table are selected and the message from SQL Server is received. After the MOVE_EMP_DATA stored procedure is executed by the adapter, all the records are moved to the EmployeeHistory table. Then, the ADD_EMP_DETAILS stored procedure is executed to add a new record to the Employee table. The next polling execution will only return a single record. This cycle continues until you close the service host.

Configuring Typed Polling with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure the adapter to receive data-change messages. Other than the PollingStatement binding property, all the other binding properties listed in this section are required while running the .NET application. You must specify the PollingStatement binding property before generating the WCF service contract TypedPolling operation.

Binding Property Description

InboundOperationType

Specifies whether you want to perform Polling, TypedPolling, or Notification inbound operation. Default is Polling. To receive strongly-typed polling messages, set this to TypedPolling.

PolledDataAvailableStatement

Specifies the SQL statement that the adapter executes to determine whether any data is available for polling. The SQL statement must return a result set consisting of rows and columns. Only if a row is available, the SQL statement specified for the PollingStatement binding property will be executed.

PollingIntervalInSeconds

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter waits for the remaining time in the interval.

PollingStatement

Specifies the SQL statement to poll the SQL Server database table. You can specify a simple SELECT statement or a stored procedure for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property. You can specify any number of SQL statements separated by a semi-colon.

Important
For TypedPolling, you must specify this binding property before generating metadata.

PollWhileDataFound

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to poll SQL Server, read further.

Configuring Strongly-typed Polling in the WCF Service Model

To receive the Polling operation when you use the WCF service model, you must:

  1. Generate a WCF service contract (interface) for the TypedPolling operation from the metadata exposed by the adapter. To do this, you could use the Add Adapter Service Reference Visual Studio Plug-in. While generating the WCF service contract for this example, make sure:

    • You specify the InboundID as Employee.

    • You specify a polling statement for the PollingStatement binding property. For this example, specify the polling statement as:

      Copy Code
      SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000
  2. Implement a WCF service from this interface.

  3. Host this WCF service using a service host (System.ServiceModel.ServiceHost).

About the Examples Used in this Topic

The examples in this topic poll the Employee table. The example also uses the MOVE_EMP_DATA and ADD_EMP_DETAILS stored procedure. A script to generate these artifacts is supplied with the samples. For more information about the samples, see Samples. A sample, TypedPolling_ServiceModel, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Service Contract and Class

You can use the Add Adapter Service Reference Plug-in to create a WCF service contract (interface) and supporting classes for the TypedPolling operation. For more information about generating a WCF service contract, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

The WCF Service Contract (Interface)

The following code shows the WCF service contract (interface) generated for the TypedPolling operation.

Copy Code
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/", ConfigurationName="TypedPolling_Employee")]
public interface TypedPolling_Employee {

    // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/TypedPolling/Employee) of message TypedPolling
    // does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
    [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="TypedPolling")]
    void TypedPolling(TypedPolling request);
}

The Message Contracts

The message contract namespace is modified by the InboundID parameter in the connection URI, if specified. In this example, you specified the inbound ID as Employee. The request message returns a strongly-typed result set.

Copy Code
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="TypedPolling", WrapperNamespace="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/Employee", IsWrapped=true)]
public partial class TypedPolling {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/Employee", Order=0)]
    public schemas.microsoft.com.Sql._2008._05.TypedPolling.Employee.TypedPollingResultSet0[] TypedPollingResultSet0;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/Employee", Order=1)]
    public schemas.microsoft.com.Sql._2008._05.TypedPolling.Employee.TypedPollingResultSet1[] TypedPollingResultSet1;

    public TypedPolling() {
    }

    public TypedPolling(schemas.microsoft.com.Sql._2008._05.TypedPolling.Employee.TypedPollingResultSet0[] TypedPollingResultSet0, schemas.microsoft.com.Sql._2008._05.TypedPolling.Employee.TypedPollingResultSet1[] TypedPollingResultSet1) {
        this.TypedPollingResultSet0 = TypedPollingResultSet0;
        this.TypedPollingResultSet1 = TypedPollingResultSet1;
    }
}

WCF Service Class

The Add Adapter Service Reference Plug-in also generates a file that has a stub for the WCF service class implemented from the service contract (interface). The name of the file is SqlAdapterBindingService.cs. You can insert the logic to process the TypedPolling operation directly into this class. The following code shows the WCF service class generated by the Add Adapter Service Reference Plug-in.

Copy Code
namespace SqlAdapterBindingNamespace {

    public class SqlAdapterBindingService : TypedPolling_Employee {

        // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/TypedPolling/Employee) of message TypedPolling
        // does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
        public virtual void TypedPolling(TypedPolling request) {
            throw new System.NotImplementedException("The method or operation is not implemented.");
        }
    }
}

Receiving Strongly-typed Inbound Messages for Polling Operation

This section provides instructions on how to write a .NET application to receive strongly-typed inbound polling messages using the SQL adapter.

To receive polling messages from the SQL adapter

  1. Use the Add Adapter Service Reference Plug-in to generate a WCF service contract (interface) and helper classes for the TypedPolling operation. Make sure you specify the following while generating the WCF service contract for this example:

    • You must specify the InboundID as Employee.

    • You must specify a polling statement for the PollingStatement binding property. For this example, specify the polling statement as:

      Copy Code
      SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

    For more information, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts. You can optionally specify the binding properties while generating the service contract and helper classes. This guarantees that they are properly set in the generated configuration file.

  2. Implement a WCF service from the interface and helper classes generated in step 1. The TypedPolling method of this class can throw an exception to abort the polling transaction, if an error is encountered processing the data received from the TypedPolling operation; otherwise the method does not return anything. You must attribute the WCF service class as follows:

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    Within the TypedPolling method, you can implement your application logic directly. This class can be found in SqlAdapterBindingService.cs. This code in this example sub-classes the SqlAdapterBindingService class. In this code, the polling message received as a strongly-typed result set is written to the console.

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

public class PollingService : SqlAdapterBindingNamespace.SqlAdapterBindingService
{
    public override void TypedPolling(TypedPolling request)
    {
        Console.WriteLine("\nNew Polling Records Received");
        Console.WriteLine("*************************************************");
        Console.WriteLine("Employee ID\tName\tDesignation\tSalary");

        for (int i = 0; i < request.TypedPollingResultSet0.Length; i++)
        {
            Console.WriteLine("{0}\t{1}\t{2}\t{3}",
            request.TypedPollingResultSet0[i].Employee_ID,
            request.TypedPollingResultSet0[i].Name,
            request.TypedPollingResultSet0[i].Designation,
            request.TypedPollingResultSet0[i].Salary);
        }
        Console.WriteLine("*************************************************");
        Console.WriteLine("\nHit <RETURN> to stop polling");
    }
}

  3. Because the SQL adapter does not accept credentials as part of the connection URI, you must implement the following class to pass credentials for the SQL Server database. In the latter part of the application, you will instantiate this class to pass on the SQL Server credentials.

    Copy Code
    class PollingCredentials : ClientCredentials, IServiceBehavior
{
    public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
    {
        bindingParameters.Add(this);
    }

    public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    protected override ClientCredentials CloneCore()
    {
        ClientCredentials clone = new PollingCredentials();
        clone.UserName.UserName = this.UserName.UserName;
        clone.UserName.Password = this.UserName.Password;
        return clone;
    }
}

  4. Create a SqlAdapterBinding and configure the polling operation by specifying the binding properties. You can do this either explicitly in code or declaratively in configuration. At a minimum, you must specify the InboundOperationType, PolledDataAvailableStatement, and PollingStatement.

    Copy Code
    SqlAdapterBinding binding = new SqlAdapterBinding();
binding.InboundOperationType = InboundOperation.TypedPolling;
binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";

  5. Specify SQL Server database credentials by instantiating the PollingCredentials class you created in Step 3.

    Copy Code
    PollingCredentials credentials = new PollingCredentials();
credentials.UserName.UserName = "<Enter user name here>";
credentials.UserName.Password = "<Enter password here>";

  6. Create an instance of the WCF service created in step 2.

    Copy Code
    // create service instance
PollingService service = new PollingService();

  7. Create an instance of System.ServiceModel.ServiceHost by using the WCF service and a base connection URI. The base connection URI cannot contain the inbound ID. You must also specify the credentials here.

    Copy Code
    // Enable service host
Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };
ServiceHost serviceHost = new ServiceHost(service, baseUri);
serviceHost.Description.Behaviors.Add(credentials);

  8. Add a service endpoint to the service host. To do this:

    • Use the binding created in step 4.

    • Specify a connection URI that contains credentials and, if required, an inbound ID.

    • Specify the contract as "TypedPolling_Employee".

    Copy Code
    // Add service endpoint: be sure to specify TypedPolling_Employee as the contract
Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?InboundID=Empliyee");
serviceHost.AddServiceEndpoint("TypedPolling_Employee", binding, ConnectionUri);

  9. To receive polling data, open the service host. The adapter will return data whenever the query returns a result set.

    Copy Code
    // Open the service host to begin polling
serviceHost.Open();

  10. To terminate polling, close the service host.

    Important
    The adapter will continue to poll until the service host is closed.

    Copy Code
    serviceHost.Close();

Example

The following example shows a polling query that executes the Employee table. The polling statement performs the following tasks:

  1. Selects all the records from the Employee table.

  2. Executes the MOVE_EMP_DATA stored procedure to move all records from Employee table to EmployeeHistory table.

  3. Executes the ADD_EMP_DETAILS stored procedure to add a single record to the Employee table.

The first polling message will contain all the records from the Employee table. The subsequent polling messages will contain only the last record inserted by the ADD_EMP_DETAILS stored procedure. The adapter will continue to poll until you close the service host by pressing <RETURN>.

Copy Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Adapters.Sql;
using Microsoft.ServiceModel.Channels;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.Collections.ObjectModel;

namespace TypedPolling_ServiceModel
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    public class PollingService : SqlAdapterBindingNamespace.SqlAdapterBindingService
    {
        public override void TypedPolling(TypedPolling request)
        {
            Console.WriteLine("\nNew Polling Records Received");
            Console.WriteLine("*************************************************");
            Console.WriteLine("Employee ID\tName\tDesignation\tSalary");

            for (int i = 0; i < request.TypedPollingResultSet0.Length; i++)
            {
                Console.WriteLine("{0}\t{1}\t{2}\t{3}",
                request.TypedPollingResultSet0[i].Employee_ID,
                request.TypedPollingResultSet0[i].Name,
                request.TypedPollingResultSet0[i].Designation,
                request.TypedPollingResultSet0[i].Salary);
            }
            Console.WriteLine("*************************************************");
            Console.WriteLine("\nHit <RETURN> to stop polling");
        }
    }

    class PollingCredentials : ClientCredentials, IServiceBehavior
    {
        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
        {
            bindingParameters.Add(this);
        }

        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        protected override ClientCredentials CloneCore()
        {
            ClientCredentials clone = new PollingCredentials();
            clone.UserName.UserName = this.UserName.UserName;
            clone.UserName.Password = this.UserName.Password;
            return clone;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost serviceHost = null;
            try
            {
                Console.WriteLine("Sample started...");
                Console.WriteLine("Press any key to start polling...");
                Console.ReadLine();

                SqlAdapterBinding binding = new SqlAdapterBinding();
                binding.InboundOperationType = InboundOperation.TypedPolling;
                binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
                binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";
                Console.WriteLine("Binding properties assigned...");

                // This URI is used to specify the address for the ServiceEndpoint
                // It must contain the InboundId that was used to generate
                // the WCF service callback interface
                Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?InboundId=Employee");

                // This URI is used to initialize the ServiceHost. It cannot contain
                // the InboundID; otherwise,an exception is thrown when
                // the ServiceHost is initialized.
                Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };

                PollingCredentials credentials = new PollingCredentials();
                credentials.UserName.UserName = "<Enter user name here>";
                credentials.UserName.Password = "<Enter password here>";

                Console.WriteLine("Opening service host...");
                PollingService service = new PollingService();
                serviceHost = new ServiceHost(service, baseUri);
                serviceHost.Description.Behaviors.Add(credentials);
                serviceHost.AddServiceEndpoint("TypedPolling_Employee", binding, ConnectionUri);
                serviceHost.Open();
                Console.WriteLine("Service host opened...");
                Console.WriteLine("Polling started...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception :" + e.Message);
                Console.ReadLine();

                /* If there is an error it will be specified in the inner exception */
                if (e.InnerException != null)
                {
                    Console.WriteLine("InnerException: " + e.InnerException.Message);
                    Console.ReadLine();
                }
            }
            finally
            {
                // IMPORTANT: you must close the ServiceHost to stop polling
                if (serviceHost.State == CommunicationState.Opened)
                    serviceHost.Close();
                else
                    serviceHost.Abort();
            }
        }
    }
}

See Also

Other Resources

Polling SQL Server by Using the SQL Adapter with WCF Service Model


Receiving Query Notifications Using the WCF Service Model

This topic demonstrates how to configure the SQL adapter to receive query notification messages from a SQL Server database. To demonstrate notifications, consider a table, Employee, with a “Status” column. When a new record is inserted to this table, the value of the Status column is set to 0. You can configure the adapter to receive notifications by registering for notifications using a SQL statement that retrieves all records that have Status column as “0.” You can do so by specifying the SQL statement for the NotificationStatement binding property. After the adapter client receives the notification, it can contain the logic to do any subsequent tasks on the SQL Server database. In this example, for the sake of simplicity, the adapter client lists all the records in the table that have the Status column as “0.”

Note
If you are performing operation on tables that have columns of user-defined types, make sure you refer to Operations on Tables and Views with User-Defined Types topic before you start developing your application.

Configuring Notifications with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure receiving notifications from SQL Server. You must specify these binding properties while running the .NET application to receive the notifications from a SQL Server database.

Binding Property | Description
InboundOperationType | Specifies the inbound operation that you want to perform. To receive notification messages, set this to Notification.
NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for query notifications. The adapter gets a notification message from SQL Server only when the result set for the specified SQL statement changes.
NotifyOnListenerStart | Specifies whether the adapter sends a notification to the adapter clients when the listener is started.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to receive notifications from SQL Server, read further.

Configuring Notifications Using the WCF Service Model

To receive the notifications using the WCF service model, you must:

  1. Generate a WCF service contract (interface) for the Notification operation from the metadata exposed by the adapter. To do this, you could use the Add Adapter Service Reference Plug-in.

  2. Generate a WCF client for the Select operation on the Employee table. To do this, you could use the Add Adapter Service Reference Plug-in.

  3. Implement a WCF service from this interface.

  4. Host this WCF service using a service host (System.ServiceModel.ServiceHost).

About the Examples Used in this Topic

The examples in this topic receive notification for the Employee table. A script to generate the table is supplied with the samples. For more information about the samples, see Samples. A sample, Notification_ServiceModel, which is based on this topic, is also provided with the SQL adapter samples.

The WCF Service Contract and Class

You can use the Add Adapter Service Reference Plug-in to create a WCF service contract (interface) and supporting classes for the Notification operation. For more information about generating a WCF service contract, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts.

The WCF Service Contract (Interface)

The following code shows the WCF service contract (interface) generated for the Notification operation.

Copy Code
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/", ConfigurationName="NotificationOperation")]
public interface NotificationOperation {

    // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/Notification/) of message
    // Notification does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
    [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="Notification")]
    void Notification(Notification request);
}

The Message Contracts

Following is the message contract for the Notification operation.

Copy Code
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="Notification", WrapperNamespace="http://schemas.microsoft.com/Sql/2008/05/Notification/", IsWrapped=true)]
public partial class Notification {

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/Notification/", Order=0)]
    public string Info;

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/Notification/", Order=1)]
    public string Source;

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://schemas.microsoft.com/Sql/2008/05/Notification/", Order=2)]
    public string Type;

    public Notification() {
    }

    public Notification(string Info, string Source, string Type) {
        this.Info = Info;
        this.Source = Source;
        this.Type = Type;
    }
}

WCF Service Class

The Add Adapter Service Reference Plug-in also generates a file that has a stub for the WCF service class implemented from the service contract (interface). The name of the file is SqlAdapterBindingService.cs. You can insert the logic to process the Notification operation directly into this class. The following code shows the WCF service class generated by the Add Adapter Service Reference Plug-in.

Copy Code
namespace SqlAdapterBindingNamespace {

    public class SqlAdapterBindingService : NotificationOperation {

        // CODEGEN: Generating message contract since the wrapper namespace (http://schemas.microsoft.com/Sql/2008/05/Notification/)
        // of message Notification does not match the default value (http://schemas.microsoft.com/Sql/2008/05/)
        public virtual void Notification(Notification request) {
            throw new System.NotImplementedException("The method or operation is not implemented.");
        }
    }
}

Receiving Query Notifications Using WCF Service Model

This section provides instructions on how to write a .NET application to receive query notifications using the SQL adapter.

To receive query notifications

  1. Use the Add Adapter Service Reference Plug-in to generate a WCF client for Select operation on the Employee table. You will use this client to perform Select operations after receiving a notification message. Add a new class, TableOperation.cs to your project and add the following code snippet to perform a Select operation.

    Copy Code
    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Notification_ServiceModel
{
    public class TableOperation
    {
        public void TableOp()
        {
            ///////////////////////////////////////////////////////////////////////
            // CREATING THE CLIENT
            ///////////////////////////////////////////////////////////////////////

            TableOp_dbo_EmployeeClient client = new TableOp_dbo_EmployeeClient("SqlAdapterBinding_TableOp_dbo_Employee");

            client.ClientCredentials.UserName.UserName = "<Enter user name here>";
            client.ClientCredentials.UserName.Password = "<Enter password here>";

            ///////////////////////////////////////////////////////////////////////
            // OPENING THE CLIENT
            ///////////////////////////////////////////////////////////////////////

            try
            {
                Console.WriteLine("Opening Client...");
                client.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex.Message);
                throw;
            }

            ///////////////////////////////////////////////////////////////////////
            // SELECTING THE LAST INSERTED RECORD FROM THE TABLE
            ///////////////////////////////////////////////////////////////////////
            schemas.microsoft.com.Sql._2008._05.Types.Tables.dbo.Employee[] selectRecords;

            try
            {
                selectRecords = client.Select("*", "where Status=0");
            }

            catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex.Message);
                throw;
            }

            Console.WriteLine("The details of the newly added employee are:");
            Console.WriteLine("********************************************");
            for (int i = 0; i < selectRecords.Length; i++)
            {
                Console.WriteLine("Employee Name      : " + selectRecords[i].Name);
                Console.WriteLine("Employee Designation: " + selectRecords[i].Designation);
                Console.WriteLine("Employee Status    : " + selectRecords[i].Status);
                Console.WriteLine();
            }
            Console.WriteLine("********************************************");
    Important
    Because this code snippet performs operations on the Employee table that contains a Point UDT column, make sure you put the UDT DLL under the project’s \bin\Debug folder while running the application.

  2. Use the Add Adapter Service Reference Plug-in to generate a WCF service contract (interface) and helper classes for the Notification operation.

    For more information, see Generating a WCF Client or WCF Service Contract for SQL Server Artifacts. You can optionally specify the binding properties while generating the service contract and helper classes. This guarantees that they are properly set in the generated configuration file.

  3. Implement a WCF service from the interface and helper classes generated in step 2. The Notification method of this class can throw an exception to abort the operation, if an error is encountered processing the data received from the Notification operation; otherwise the method does not return anything. You must attribute the WCF service class as follows:

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

    Within the Notification method, you can implement your application logic directly. This class can be found in SqlAdapterBindingService.cs. This code in this example sub-classes the SqlAdapterBindingService class. In this code, the notification message received is written to the console. Additionally, the TableOp method within the TableOperation class is invoked to perform the Select operation.

    Copy Code
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

public class NotificationService : SqlAdapterBindingNamespace.SqlAdapterBindingService
{
    public override void Notification(Notification request)
    {
        Console.WriteLine("\nNew Notification Received");
        Console.WriteLine("*************************************************");
        Console.WriteLine(request.Info);
        Console.WriteLine(request.Source);
        Console.WriteLine(request.Type);
        Console.WriteLine("*************************************************");

        // Invoke th TableOp method in the TableOperation class
        TableOperation Ops = new TableOperation();
        Ops.TableOp();
    }
}

  4. Because the SQL adapter does not accept credentials as part of the connection URI, you must implement the following class to pass credentials for the SQL Server database. In the latter part of the application, you will instantiate this class to pass on the SQL Server credentials.

    Copy Code
    class NotificationCredentials : ClientCredentials, IServiceBehavior
{
    public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
    {
        bindingParameters.Add(this);
    }

    public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
    { }

    protected override ClientCredentials CloneCore()
    {
        ClientCredentials clone = new NotificationCredentials();
        clone.UserName.UserName = this.UserName.UserName;
        clone.UserName.Password = this.UserName.Password;
        return clone;
    }
}

  5. Create a SqlAdapterBinding and configure the adapter to receive query notifications by specifying the binding properties. You can do this either explicitly in code or declaratively in configuration. At a minimum, you must specify the InboundOperationType and NotificationStatement binding properties.

    Copy Code
    SqlAdapterBinding binding = new SqlAdapterBinding();
binding.InboundOperationType = InboundOperation.Notification;
binding.NotificationStatement = "SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0";
binding.NotifyOnListenerStart = true;

  6. Specify SQL Server database credentials by instantiating the NotificationCredentials class you created in Step 4.

    Copy Code
    NotificationCredentials credentials = new NotificationCredentials();
credentials.UserName.UserName = "<Enter user name here>";
credentials.UserName.Password = "<Enter password here>";

  7. Create an instance of the WCF service created in step 3.

    Copy Code
    // create service instance
NotificationService service = new NotificationService();

  8. Create an instance of System.ServiceModel.ServiceHost by using the WCF service and a base connection URI. You must also specify the credentials here.

    Copy Code
    // Enable service host
Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };
ServiceHost serviceHost = new ServiceHost(service, baseUri);
serviceHost.Description.Behaviors.Add(credentials);

  9. Add a service endpoint to the service host. To do this:

    • Use the binding created in step 5.

    • Specify a connection URI that contains credentials and, if required, an inbound ID.

    • Specify the contract as "NotificationOperation".

    Copy Code
    // Add service endpoint: be sure to specify NotificationOperation as the contract
Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");
serviceHost.AddServiceEndpoint("NotificationOperation", binding, ConnectionUri);

  10. To receive notification message, open the service host.

    Copy Code
    // Open the service host to begin receiving notifications
serviceHost.Open();

  11. To stop receiving notifications, close the service host.

    Copy Code
    serviceHost.Close();

Example

The following example shows a .NET application to receive notification messages for the Employee table.

Note
The following code snippet instantiates a TableOperation.cs class and invokes the TableOp method. The class and the method are described in Step 1.

Copy Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Adapters.Sql;
using Microsoft.ServiceModel.Channels;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.Collections.ObjectModel;

namespace Notification_ServiceModel
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public class NotificationService : SqlAdapterBindingNamespace.SqlAdapterBindingService
    {
        public override void Notification(Notification request)
        {
            Console.WriteLine("\nNew Notification Received");
            Console.WriteLine("*************************************************");
            Console.WriteLine(request.Info);
            Console.WriteLine(request.Source);
            Console.WriteLine(request.Type);
            Console.WriteLine("*************************************************");
            TableOperation Ops = new TableOperation();
            Ops.TableOp();
        }
    }

    class NotificationCredentials : ClientCredentials, IServiceBehavior
    {
        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
        {
            bindingParameters.Add(this);
        }

        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        { }

        protected override ClientCredentials CloneCore()
        {
            ClientCredentials clone = new NotificationCredentials();
            clone.UserName.UserName = this.UserName.UserName;
            clone.UserName.Password = this.UserName.Password;
            return clone;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost serviceHost = null;
            try
            {
                SqlAdapterBinding binding = new SqlAdapterBinding();
                binding.InboundOperationType = InboundOperation.Notification;
                binding.NotificationStatement = "SELECT Employee_ID, Name FROM dbo.Employee WHERE Status=0";
                binding.NotifyOnListenerStart = true;

                // This URI is used to specify the address for the ServiceEndpoint
                // It must contain the InboundId (if any) that was used to generate
                // the WCF service callback interface
                Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");

                // This URI is used to initialize the ServiceHost. It cannot contain
                // a query_string (InboundID); otherwise,an exception is thrown when
                // the ServiceHost is initialized.
                Uri[] baseUri = new Uri[] { new Uri("mssql://mysqlserver//mydatabase") };

                NotificationCredentials credentials = new NotificationCredentials();
                credentials.UserName.UserName = "<Enter user name here>";
                credentials.UserName.Password = "<Enter password here>";

                Console.WriteLine("Opening service host...");
                NotificationService service = new NotificationService();
                serviceHost = new ServiceHost(service, baseUri);
                serviceHost.Description.Behaviors.Add(credentials);
                serviceHost.AddServiceEndpoint("NotificationOperation", binding, ConnectionUri);
                serviceHost.Open();
                Console.WriteLine("Service host opened...");
                Console.WriteLine("Waiting for notification...");

                Console.WriteLine("\nHit <RETURN> to stop receiving notification");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception :" + e.Message);
                Console.ReadLine();

                // If there is an error it will be specified in the inner exception
                if (e.InnerException != null)
                {
                    Console.WriteLine("InnerException: " + e.InnerException.Message);
                    Console.ReadLine();
                }
            }
            finally
            {
                // IMPORTANT: you must close the ServiceHost to stop receiving notifications
                if (serviceHost.State == CommunicationState.Opened)
                    serviceHost.Close();
                else
                    serviceHost.Abort();
            }
        }
    }
}

See Also

Other Resources

Developing Applications by Using the WCF Service Model


Developing Applications by Using the WCF Channel Model

You can use the Windows Communication Foundation (WCF) channel model to consume the Microsoft BizTalk Adapter for SQL Server by sending XML messages directly over a channel instance created with the SQL Server Binding.

One advantage of using the WCF channel model over using the strongly-typed classes and methods that the WCF service model exposes is that the channel model provides more fine-grained control over the operations that you perform on the SQL database. This control comes from the fact that in the WCF channel model, you directly control the contents of the messages that you send over the channel.

In certain scenarios, this extra level of control can be beneficial. For example, when you use the WCF channel model to perform an Update operation on a table, you can selectively update columns in the target rows by omitting columns from the update template that you pass in the message. The only columns that are required are those with “nillable=false” in the WSDL. The update method exposed by a WCF client uses a strongly-typed record parameter for the template that includes every column in the table schema.

The sections in this topic explain how to perform operations on the SQL adapter by using the WCF channel model.

In This Section

  • Overview of Using the WCF Channel Model with the Adapter

  • Creating a Channel

  • Performing an Insert Operation on a Table Using the WCF Channel Model

  • Receiving Polling-based Data-changed Messages from SQL Server by Using the WCF Channel Model

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Overview of Using the WCF Channel Model with the Adapter

To invoke operations on the Microsoft BizTalk Adapter for SQL Server, your code acts as a WCF client and sends outbound operations to the adapter. In the WCF channel model, your code invokes operations on the adapter by sending a request message over a channel.

To receive polling-based data-changed messages using the adapter, your code acts as a WCF service and receives the inbound Polling, TypedPolling, or Notification operation from the adapter. In other words, your code receives a request message for these operations from the adapter over a channel.

The topics in this section provide an overview of using the SQL adapter with the WCF channel model.

WCF Channel Model Overview

Clients and services communicate by exchanging SOAP messages. The WCF channel model is a low-level abstraction of this message exchange. It provides interfaces and types that enable you to send and receive messages by using a layered protocol stack called a channel stack. Each layer of the stack is composed of a channel, and each channel is created from a WCF binding. At the lowest layer is the transport channel. The transport channel implements the underlying transport mechanism between a service and a client and presents each message to the higher layers (and ultimately the consuming application) as a System.ServiceModel.Message. The WCF Message class is an abstraction of a SOAP message. WCF provides several channel interfaces, called channel shapes, that model the basic SOAP message exchange patterns, such as request-reply or one-way. A WCF transport binding provides an implementation of one or more channel shapes that higher layers can use to send and receive messages. For more information about the WCF channel model, see "Channel Model Overview" at http://go.microsoft.com/fwlink/?LinkId=82614.

The SQL adapter is a WCF custom transport binding that exposes a SQL Server database as a WCF service.

Supported Channel Shapes for the SQL Server Adapter

The adapter implements the following WCF channel shapes:

  • IRequestChannel (System.ServiceModel.Channels.IRequestChannel). The IRequestChannel interface implements the client side of a request-reply message exchange. You can use an IRequestChannel to perform operations for which you want to consume a response, for example to perform a SELECT query on a table.

  • IOutputChannel (System.ServiceModel.Channels.IOutputChannel). This shape implements the client side of a one-way message exchange. You can use an IOutputChannel to invoke an operation for which you do not need to consume a response, for example to call a procedure that has no return parameters.

    Important
    All underlying calls by the adapter to the SQL Server client are synchronous. This includes calls to the SQL Server client that are the result of operations invoked over an IOutputChannel. When you use an IOutputChannel, the adapter discards the response received from the SQL Server client.

  • IInputChannel (System.ServiceModel.Channels.IInputChannel). This shape implements the service side of a one-way message exchange. You use an IInputChannel to receive messages for inbound operations, such as Polling or Notification, from the adapter.

Like any WCF binding, the SQL adapter uses a factory pattern to provide channels to application code. You use a Microsoft.Adapters.SQLBinding object to create instances of:

  • System.ServiceModel.ChannelFactory<IRequestChannel> to provide IRequestChannel channels you can use to invoke request-response operations on the adapter.

  • System.ServiceModel.ChannelFactory<IOutputChannel> to provide IOutputChannel channels you can use to invoke one-way operations on the adapter.

  • System.ServiceModel.IChannelListener<IInputChannel> to provide IInputChannel channels you can use to receive messages for inbound operations, such as Polling or Notification, from the adapter.

Creating Messages for the SQL Server Database Adapter in the WCF Channel Model

In WCF the System.ServiceModel.Channels.Message class provides an in memory representation of a SOAP message. You create a Message instance by invoking the static Message.Create method.

There are two important parts to the SOAP message that you must specify when you create a Message instance to send to the SQL adapter.

  • The message action is a string that is part of the SOAP message header. The message action identifies the operation that should be invoked on the database. The following shows the message action specified to invoke the Select operation on the Employee table: TableOp/Select/dbo/Employee.

  • The message body contains the parameter data for the operation. The message body is composed of well-formed XML that corresponds to the message schema expected by the SQL adapter for the requested operation. The following message body specifies a Select operation on the Employee table (SELECT * FROM Employee WHERE Employee_ID=10001).

    Copy Code
    <Select xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <Columns>*</Columns>
  <Query>where Employee_ID=10001</Query>
</Select>

For information about the SQL adapter message schemas and message actions for operations, see Messages and Message Schemas for BizTalk Adapter for SQL Server.

This Create method is overloaded and offers many different options for providing the message body. The following code shows how to create a Message instance by using an XmlReader to supply the message body. In this code, the message body is read from a file.

Copy Code
XmlReader readerIn = XmlReader.Create("SelectInput.xml");
Message messageIn = Message.CreateMessage(MessageVersion.Default,
    "TableOp/Select/dbo/Employee",
    readerIn);
Important
You must provide a message action in your Message instance. This is typically done when the Message instance is created.

See Also

Other Resources

Developing Applications by Using the WCF Channel Model


Creating a Channel

In the WCF channel model, you invoke operations on the SQL Server database and receive the results by exchanging SOAP messages with the Microsoft BizTalk Adapter for SQL Server over a WCF channel.

  • You invoke outbound operations by using either an IRequestChannel or an IOutputChannel to send messages to the adapter.

  • You receive messages for inbound operations by receiving messages over an IInputChannel for Polling, TypedPolling, or Notification operations.

The procedures in this topic provide information about how to create and configure channel shapes that are used for inbound and outbound operations.

Creating Outbound (Client) Channels

You can use either an IRequestChannel or an IOutputChannel to invoke operations on the SQL Server database. In either case, you first create a System.ServiceModel.ChannelFactory using the appropriate interface. You then use the factory to create the channel. After you have created the channel you can use it to invoke operations on the adapter.

To create and open an outbound channel

  1. Create and initialize an instance of ChannelFactory for the desired channel shape by using an endpoint and a binding. The endpoint specifies a SQL Server connection URI and the binding is an instance of sqlBinding.

  2. Provide SQL Server credentials for the channel factory by using the Credentials property.

  3. Open the channel factory.

  4. Get an instance of the channel by invoking the CreateChannel method on the channel factory.

  5. Open the channel.

You can specify the binding and endpoint address in your code or from configuration.

Specifying the Binding and Endpoint Address in Code

The following code example shows how to create an IRequestChannel by specifying the binding and endpoint address in code. The code to create an IOutputChannel is the same except that you must specify an IOutputChannel interface for the ChannelFactory and channel type.

Copy Code
// Create binding -- set binding properties before you open the factory.
SqlAdapterBinding sdbBinding = new SqlAdapterBinding();

// Create address.
EndpointAddress sdbAddress = new EndpointAddress("mssql://<sql_server_name>//<database_name>?");

// Create channel factory from binding and address.
ChannelFactory<IRequestChannel> factory =
    new ChannelFactory<IRequestChannel>(sdbBinding, sdbAddress);

// Specify credentials.
factory.Credentials.UserName.UserName = "myuser";
factory.Credentials.UserName.Password = "mypassword";

// Open factory
factory.Open();

// Get channel and open it.
IRequestChannel channel = factory.CreateChannel();
channel.Open();

Specifying the Binding and Endpoint Address in Configuration

The following code example shows how to create a channel factory from a client endpoint specified in configuration.

Copy Code
// Create channel factory from configuration.
ChannelFactory<IRequestChannel> factory =
new ChannelFactory<IRequestChannel>("MyRequestChannel");

// Specify credentials.
factory.Credentials.UserName.UserName = "myuser";
factory.Credentials.UserName.Password = "mypassword";

// Open the factory.
factory.Open();

// Get a channel and open it.
IRequestChannel channel = factory.CreateChannel();
channel.Open();

The Configuration Settings

The following code shows the configuration settings used for the preceding example. The contract for the client endpoint must be "System.ServiceModel.Channels.IRequestChannel" or "System.ServiceModel.Channels.IOutputChannel" depending on the kind of channel shape that you want to create.

Copy Code
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <system.serviceModel>
        <bindings>
            <sqlBinding>
                <binding name="SqlAdapterBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" maxConnectionPoolSize="100"
                    encrypt="false" useAmbientTransaction="true" batchSize="20"
                    polledDataAvailableStatement="" pollingStatement="" pollingIntervalInSeconds="30"
                    pollWhileDataFound="false" notificationStatement="" notifyOnListenerStart="true"
                    enableBizTalkCompatibilityMode="true" chunkSize="4194304"
                    inboundOperationType="Polling" useDatabaseNameInXsdNamespace="false"
                    allowIdentityInsert="false" enablePerformanceCounters="false"
                    xmlStoredProcedureRootNodeName="" xmlStoredProcedureRootNodeNamespace="" />
            </sqlBinding>
        </bindings>
        <client>
            <endpoint address="mssql://mysqlserver//mydatabase?" binding="sqlBinding"
                bindingConfiguration="SqlAdapterBinding" contract="System.ServiceModel.Channels.IRequestChannel"
                name="MyRequestChannel" />
        </client>
    </system.serviceModel>
</configuration>

Creating Inbound (Service) Channels

You configure the SQL adapter to poll the SQL Server database tables and views by setting binding properties on an instance of sqlBinding. You then use this binding to build a channel listener from which you can get an IInputChannel channel to receive the Polling, TypedPolling, or Notification operation from the adapter.

To create and open an IInputChannel to receive inbound operations

  1. Create an instance of SQLBinding.

  2. Set the binding properties required for inbound operation. For example, for a Polling operation, at a minimum you must set the InboundOperationType, PolledDataAvailableStatement, and PollingStatement binding properties to configure the SQL adapter to poll the SQL Server database.

  3. Create a channel listener by invoking BuildChannelListener<IInputChannel> method on the SQLBinding. You specify the SQL Server connection URI as one of the parameters to this method.

  4. Open the listener.

  5. Get an IInputChannel channel by invoking the AcceptChannel method on listener.

  6. Open the channel.

The following code shows how to create a channel listener and get an IInputChannel to receive data-changed messages from the adapter.

Important
The SQL adapter only supports one-way receive. So, you must use IInputChannel to receive messages for inbound operations from SQL Server.

Copy Code
// Create a binding: specify the InboundOperationType, the PolledDataAvailableStatement, and
// the PollingStatement binding properties.
SqlAdapterBinding binding = new SqlAdapterBinding();
binding.InboundOperationType = InboundOperation.Polling;
binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";

// Create a binding parameter collection and set the credentials
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "myuser";
credentials.UserName.Password = "mypassword";

BindingParameterCollection bindingParams = new BindingParameterCollection();
bindingParams.Add(credentials);

// Get a listener from the binding and open it.
Uri connectionUri = new Uri("mssql://mysqlserver//mydatabase?");
IChannelListener<IInputChannel> listener = binding.BuildChannelListener<IInputChannel>(connectionUri, bindingParams);
listener.Open();

// Get a channel from the listener and open it.
IInputChannel channel = listener.AcceptChannel();
channel.Open();

See Also

Other Resources

Developing Applications by Using the WCF Channel Model


Performing an Insert Operation on a Table Using the WCF Channel Model

The SQL adapter discovers a set of basic Insert, Select, Update, and Delete operations on SQL Server database tables and views. By using these operations, you can perform simple SQL Insert, Select, Update, and Delete statements qualified by a Where clause on a target table or view. This topic provides instructions on how to perform an Insert operation on a SQL Server database table using the WCF channel model.

For more information on how the adapter supports these operations, see Performing Basic Insert, Update, Delete, and Select Operations on Tables and Views. For more information about how to perform operations on SQL Server using the WCF Channel model, see Overview of Using the WCF Channel Model with the Adapter.

About the Examples Used in this Topic

The example in this topic performs operations on the Employee table. The Employee table is created by running the SQL script provided with the samples. For more information about samples, see Samples. A sample, EmployeeInsertOp, which is based on this topic, is also provided with the SQL adapter samples.

The Insert Message

To perform operations on the SQL Server database using the WCF channel model, you must have the request message specific to the operation. The request message to perform an Insert operation on the Employee table in the SQL Server database resembles the following:

Copy Code
<Insert xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <Rows>
    <Employee xmlns="http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
      <Name>Tom Smith</Name>
      <Designation>Manager</Designation>
      <Salary>500000</Salary>
   </Employee>
  </Rows>
</Insert>

This request message inserts a record with following details:

Copy Code
Name = Tom Smith
Designation = Manager
Salary = 500000

You must copy the message to a file, e.g. InsertRequest.xml. This file is used in this example to send the request message to SQL Server using the SQL adapter. For more information about the message schema for operations on table, see Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views.

Creating a WCF Channel Application

This section provides instructions on how to create a WCF channel application to perform an Insert operation on the Employee table.

To create a WCF channel application for inserting records into the Employee table

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. In the Solution Explorer, add reference to Microsoft.Adapters.Sql, Microsoft.ServiceModel.Channels, System.ServiceModel, and System.Runtime.Serialization.

  3. Open the Program.cs file and add the following namespaces:

    • Microsoft.Adapters.Sql

    • Microsoft.ServiceModel.Channels

    • System.ServiceModel

    • System.ServiceModel.Channels

    • System.Xml

  4. Create the binding and endpoint.

    Copy Code
    SqlAdapterBinding binding = new SqlAdapterBinding();
EndpointAddress address = new EndpointAddress("mssql://mysqlserver//mydatabase?");

  5. Create and open the channel factory. This application sends request message to SQL Server and receives a response, hence you must implement the IRequestChannel interface.

    Copy Code
    ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);
factory.Credentials.UserName.UserName = "<Enter user name here>";
factory.Credentials.UserName.Password = "<Enter password here>";
factory.Open();

  6. Create and open the channel.

    Copy Code
    IRequestChannel channel = factory.CreateChannel();
channel.Open();

  7. Create and send the request message.

    Copy Code
    XmlReader readerIn;
Console.WriteLine("Creating the message");
try
{
   readerIn = XmlReader.Create("InsertRequest.xml");
   Console.WriteLine("Reader created");
}
catch (Exception ex)
{
   Console.WriteLine("Exception: " + ex.Message);
   throw;
}
Message messageIn = Message.CreateMessage(MessageVersion.Default, "TableOp/Insert/dbo/Employee", readerIn);
Message messageOut = channel.Request(messageIn);

    While creating the request message, you must specify the message action that indicates the action that the adapter performs on the SQL Server table. To perform an Insert operation on the Employee table, the message action is TableOp/Insert/dbo/Employee. For information about how you can determine the message action for various operations on tables, see Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views.

  8. Get the response message.

    Copy Code
    XmlReader readerOut = messageOut.GetReaderAtBodyContents();
XmlDocument doc = new XmlDocument();
doc.Load(readerOut);
doc.Save("C:\\Response.xml");

  9. Close the message, channel, and channel factory.

    Copy Code
    messageOut.Close();
channel.Close();
factory.Close();

  10. Build the project. After building the project, you must perform the following tasks:

    • Copy the request message, InsertRequest.xml, at the same location as your project executable. Typically, this location is \bin\Debug\ under your project directory.

    • The "Employee" table used in this example has a column of Point user-defined type (UDT). So, before running the project you must create the assembly for the Point UDT as described at http://go.microsoft.com/fwlink/?LinkID=138066. You must also copy the assembly DLL at the same location as the project executable. Typically, this location is \bin\Debug\ under your project directory.

  11. Run the application. The response message, Response.xml, is saved at the location you specified in the application. The response message contains the ID of the newly added employee and resembles the following:

    Copy Code
    <InsertResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee">
  <InsertResult>
    <long xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">10006</long>
  </InsertResult>
</InsertResponse>

    Because the Employee table has the Employee_ID column as the identity column, the Insert operation returns the value for the identity column of the newly inserted record. If there is no identity column in a table, the return value is NULL.

See Also

Other Resources

Developing Applications by Using the WCF Channel Model


Receiving Polling-based Data-changed Messages from SQL Server by Using the WCF Channel Model

You can configure the SQL adapter to receive periodic data-change messages for SQL Server tables or views. You can specify a polling statement that the adapter executes to poll the database. The polling statement can be a SELECT statement or a stored procedure that returns a result set.

For more information on how the adapter supports polling, see Support for Polling.

Important
If you want to have more than one polling operation in a single application, you must specify an InboundID connection property as part of the connection URI to make it unique. The inbound ID you specify is added to the operation namespace to make it unique.

How This Topic Demonstrates Polling

In this topic, to demonstrate how the SQL adapter supports receiving data change messages, create a .NET application for the Polling operation. For this topic, specify the PolledDataAvailableStatement as:

Copy Code
SELECT COUNT(*) FROM Employee

The PolledDataAvailableStatement must return a result set with the first cell containing a positive value. If the first cell does not contain a positive value, the adapter does not execute the polling statement.

As part of the polling statement, perform the following operations:

  1. Select all the rows from the Employee table.

  2. Execute a stored procedure (MOVE_EMP_DATA) to move all the records from the Employee table to an EmployeeHistory table.

  3. Execute a stored procedure (ADD_EMP_DETAILS) to add a new record to the Employee table. This procedure takes the employee name, designation, and salary as parameters.

To perform these operations, you must specify the following for the PollingStatement binding property:

Copy Code
SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000

After the polling statement is executed, all the records from the Employee table are selected and the message from SQL Server is received. Once the MOVE_EMP_DATA stored procedure is executed by the adapter, all the records are moved to the EmployeeHistory table. Then, the ADD_EMP_DETAILS stored procedure is executed to add a new record to the Employee table. The next polling execution will only return a single record. This cycle continues until you close the channel listener.

Configuring a Polling Query with the SQL Adapter Binding Properties

The following table summarizes the SQL adapter binding properties that you use to configure the adapter to receive data-change messages. You must specify these binding properties as part of the .NET application for polling.

Binding Property | Description
InboundOperationType | Specifies whether you want to perform Polling, TypedPolling, or Notification inbound operation. Default is Polling.
PolledDataAvailableStatement | Specifies the SQL statement that the adapter executes to determine whether any data is available for polling. The SQL statement must return a result set consisting of rows and columns. Only if a row is available, the SQL statement specified for the PollingStatement binding property will be executed.
PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property. The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter waits for the remaining time in the interval.
PollingStatement | Specifies the SQL statement to poll the SQL Server database table. You can specify a simple SELECT statement or a stored procedure for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property. You can specify any number of SQL statements separated by a semi-colon.
PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled. If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval. Default is false.

For a more complete description of these properties, see Working with BizTalk Adapter for SQL Server Binding Properties. For a complete description of how to use the SQL adapter to poll SQL Server, read the remainder of this topic.

Consuming the Polling Request Message

The adapter invokes the Polling operation on your code to poll the SQL Server database. That is, the adapter sends a Polling request message that you receive over an IInputChannel channel shape. The Polling request message contains the result set of the query specified by the PollingStatement binding property. You can consume the Polling message in one of two ways:

  • To consume the message using node-value streaming you must call the WriteBodyContents method on the response message and pass it an XmlDictionaryWriter that implements node-value streaming.

  • To consume the message using node streaming you can call GetReaderAtBodyContents on the response message to get an XmlReader.

About the Examples Used in this Topic

The examples in this topic poll the Employee table. The example also uses the MOVE_EMP_DATA and ADD_EMP_DETAILS stored procedure. A script to generate these artifacts is supplied with the samples. For more information about the samples, see Samples. A sample, Polling_ChannelModel, which is based on this topic, is also provided with the SQL adapter samples.

Receiving Inbound Messages for Polling Operation Using the WCF Channel Model

This section provides instructions on how to write a .NET application (channel model) to receive inbound polling messages using the SQL adapter.

To receive polling messages from the SQL adapter

  1. Create a Microsoft Visual C# project in Visual Studio. For this topic, create a console application.

  2. In the Solution Explorer, add reference to Microsoft.Adapters.Sql, Microsoft.ServiceModel.Channels, System.ServiceModel, and System.Runtime.Serialization.

  3. Open the Program.cs file and add the following namespaces:

    • Microsoft.Adapters.Sql

    • System.ServiceModel

    • System.ServiceModel.Description

    • System.ServiceModel.Channels

    • System.Xml

  4. Specify a connection URI. For more information about the adapter connection URI, see SQL Server Connection URI.

    Copy Code
    Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");

  5. Create an instance of SqlAdapterBinding and set the binding properties required to configure polling. At a minimum you must set the InboundOperationType, PolledDataAvailableStatement, and PollingStatement binding properties. For more information about binding properties used to configure polling, see Support for Polling.

    Copy Code
    SqlAdapterBinding binding = new SqlAdapterBinding();
binding.InboundOperationType = InboundOperation.Polling;
binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";

  6. Create a binding parameter collection and set the credentials.

    Copy Code
    ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "<Enter user name here>";
credentials.UserName.Password = "<Enter password here>";

BindingParameterCollection bindingParams = new BindingParameterCollection();
bindingParams.Add(credentials);

  7. Create a channel listener and open it. You create the listener by invoking BuildChannelListener<IInputChannel> method on the SqlAdapterBinding.

    Copy Code
    IChannelListener<IInputChannel> listener = binding.BuildChannelListener<IInputChannel>(connectionUri, bindingParams);
listener.Open();

  8. Get an IInputChannel channel by invoking the AcceptChannel method on the listener and open it.

    Copy Code
    IInputChannel channel = listener.AcceptChannel();
channel.Open();

  9. Invoke Receive on the channel to get the next POLLINGSTMT message from the adapter.

    Copy Code
    Message message = channel.Receive();

  10. Consume the result set returned by the POLLINGSTMT operation. You can consume the message using either an XmlReader or an XmlDictionaryWriter.

    Copy Code
    XmlReader reader = message.GetReaderAtBodyContents();

  11. Close the channel when you have completed processing the request.

    Copy Code
    channel.Close()
    Important
    You must close the channel after you have finished processing the POLLINGSTMT operation. Failure to close the channel may affect the behavior of your code.

  12. Close the listener when you are finished receiving data-changed messages.

    Copy Code
    listener.Close()
    Important
    Closing the listener does not close channels created using the listener. You must explicitly close each channel created using the listener.

Example

The following example shows a polling query that executes the Employee table. The polling statement performs the following tasks:

  • Selects all the records from the Employee table.

  • Executes the MOVE_EMP_DATA stored procedure to move all records from Employee table to EmployeeHistory table.

  • Executes the ADD_EMP_DETAILS stored procedure to add a single record to the Employee table.

The polling messages are saved at C:\PollingOutput.xml.

Copy Code
using System;
using Microsoft.Adapters.Sql;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;

using System.Xml;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Sample started. This sample will poll 5 times and will perform the following tasks:");
            Console.WriteLine("Press any key to start polling...");
            Console.ReadLine();
            IChannelListener<IInputChannel> listener = null;

            IInputChannel channel = null;

            try
            {
                TimeSpan messageTimeout = new TimeSpan(0, 0, 30);

                SqlAdapterBinding binding = new SqlAdapterBinding();
                binding.InboundOperationType = InboundOperation.Polling;
                binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM EMPLOYEE";
                binding.PollingStatement = "SELECT * FROM Employee;EXEC MOVE_EMP_DATA;EXEC ADD_EMP_DETAILS John, Tester, 100000";

                Uri ConnectionUri = new Uri("mssql://mysqlserver//mydatabase?");

                ClientCredentials credentials = new ClientCredentials();
                credentials.UserName.UserName = "<Enter user name here>";
                credentials.UserName.Password = "<Enter password here>";

                BindingParameterCollection bindingParams = new BindingParameterCollection();
                bindingParams.Add(credentials);

                listener = binding.BuildChannelListener<IInputChannel>(ConnectionUri, bindingParams);
                listener.Open();

                channel = listener.AcceptChannel();
                channel.Open();

                Console.WriteLine("Channel and Listener opened...");
                Console.WriteLine("\nWaiting for polled data...");
                Console.WriteLine("Receive request timeout is {0}", messageTimeout);

                // Poll five times with the specified message timeout
                // If a timeout occurs polling will be aborted
                for (int i = 0; i < 5; i++)
                {
                    Console.WriteLine("Polling: " + i);
                    Message message = null;
                    XmlReader reader = null;
                    try
                    {
                        //Message is received so process the results
                        message = channel.Receive(messageTimeout);
                    }
                    catch (System.TimeoutException toEx)
                    {
                        Console.WriteLine("\nNo data for request number {0}: {1}", i + 1, toEx.Message);
                        continue;
                    }

                    // Get the query results using an XML reader
                    try
                    {
                        reader = message.GetReaderAtBodyContents();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Exception :" + ex);
                        throw;
                    }

                    XmlDocument doc = new XmlDocument();
                    doc.Load(reader);
                    using (XmlWriter writer = XmlWriter.Create("C:\\PollingOutput.xml"))
                    {
                        doc.WriteTo(writer);
                        Console.WriteLine("The polling response is saved at 'C:\\PollingOutput.xml'");
                    }

                    // return the cursor
                    Console.WriteLine();

                    // close the reader
                    reader.Close();

                    message.Close();
                }
                Console.WriteLine("\nPolling done -- hit <RETURN> to finish");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception is: " + ex.Message);
                if (ex.InnerException != null)
                {
                    Console.WriteLine("Inner Exception is: " + ex.InnerException.Message);
                }
            }
            finally
            {
                // IMPORTANT: close the channel and listener to stop polling
                if (channel != null)
                {
                    if (channel.State == CommunicationState.Opened)
                        channel.Close();
                    else
                        channel.Abort();
                }

                if (listener != null)
                {
                    if (listener.State == CommunicationState.Opened)
                        listener.Close();
                    else
                        listener.Abort();
                }
            }
        }
    }
}

See Also

Other Resources

Developing Applications by Using the WCF Channel Model


Samples

Samples for Microsoft BizTalk Adapter for SQL Server are categorized into:

  • BizTalk Server samples

  • WCF service model samples

  • WCF channel model samples

The samples are available at http://go.microsoft.com/fwlink/?LinkID=196854.The SQL scripts for creating the objects used in the samples, such as database, tables, procedures, etc., are also available along with the samples.

The following list contains the names and descriptions of the samples for the SQL adapter.

BizTalk Server Samples

Sample Directory Name | Description
ExecuteStoredProcedure | Demonstrates how to invoke a stored procedure in SQL Server database using the adapter with BizTalk Server .
SelectTable | Demonstrates how to perform a Select operation on a SQL Server database table using the adapter with BizTalk Server.
CompositeOperations | Demonstrates how to perform composite operations on a SQL Server database using the adapter with BizTalk Server.
TypedPolling | Demonstrates how to perform strongly-typed polling on a SQL Server database using the adapter with BizTalk Server.
FILESTREAMOperation | Demonstrates how to perform FILESTREAM operations on a SQL Server 2008 database using the adapter with BizTalk Server.
IncrementalNotification | Demonstrates how to receive incremental notification from a SQL Server database using the adapter with BizTalk Server.
Employee_PurchaseOrder | Sample based on Tutorial 2: Employee - Purchase Order Process.

WCF Service Model Samples

Sample Directory Name | Description
EmployeeBasicOps | Demonstrates how to perform Insert, Select, Update, and Delete operation on a SQL Server database using the adapter.
ExecuteReader | Demonstrates how to invoke an ExecuteReader operation on a SQL Server database using the adapter.
Execute_StoredProc | Demonstrates how to invoke a stored procedure in SQL Server database using the adapter.
Execute_TypedStoredProcedure | Demonstrates how to invoke a strongly-typed stored procedure in SQL Server database using the adapter.
Records_FILESTREAM_Op | Demonstrates how to update FILESTREAM data in a SQL Server database table using the adapter.
ScalarFunction_ServiceModel | Demonstrates how to invoke scalar functions in a SQL Server database using the adapter.
TableFunction_ServiceModel | Demonstrates how to invoke table-valued functions in a SQL Server database using the adapter.
Polling_ServiceModel | Demonstrates how to receive polling-based data-changed messages from a SQL Server database using the adapter.
TypedPolling_ServiceModel | Demonstrates how to receive strongly-typed polling-based data-changed messages from a SQL Server database using the adapter.
Notification_ServiceModel | Demonstrates how to receive query notifications from a SQL Server database using the adapter.

WCF Channel Model Samples

Sample Directory Name | Description
EmployeeInsertOp | Demonstrates how to perform an Insert operation on a SQL Server database using the adapter.
Polling_ChannelModel | Demonstrates how to receive polling-based data-changed messages from a SQL Server database using the adapter.

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


How Do I?

The topic in this section describes how to configure transaction isolation level and the transaction timeout value in BizTalk Server while using the Polling and Notification operations in the Microsoft BizTalk Adapter for SQL Server.

In This Section

Configure Transaction Isolation Level and Transaction Timeout

See Also

Other Resources

Development

© 2013 Microsoft Corporation. All rights reserved.


Configure Transaction Isolation Level and Transaction Timeout

While performing inbound operations (Polling and Notification) using the Microsoft BizTalk Adapter for SQL Server with BizTalk Server, you should appropriately configure the transaction isolation level and the transaction timeout values. To do this:

  1. Start the BizTalk Server Administration console.

  2. In the console tree, expand the BizTalk Group, and then expand Applications.

  3. Expand the application under which you want to deploy the SQL adapter.

  4. Right-click Receive Ports, point to New, and then click One-way Receive Port.

  5. In the Receive Port Properties dialog box, on the General tab, type a name for the receive port.

  6. In the left pane of the Receive Port Properties dialog box, click Receive Locations, and then click New in the right pane to define a new receive location.

  7. In the Receive Location Properties dialog box, click WCF-Custom in the Type list.

  8. Click Configure adjacent to the Type list.

  9. In the WCF-Custom Transport Properties dialog box, click the Behavior tab.

  10. In the Behavior list, right-click ServiceBehavior, and click Add extension.

  11. In the Select Behavior Extension dialog box, select sqlAdapterInboundTransactionBehavior, and click OK.

  12. In the left pane of the WCF-Custom Transport Properties, select the sqlAdapterInboundTransactionBehavior service under ServiceBehavior. For receive (Inbound operation message), one can use the sqlAdapterInboundTransactionBehavior to control the isolation level and the default value is ReadCommitted.

  13. In the right pane of the WCF-Custom Transport Properties, specify appropriate values for the transactionIsolationLevel and transactionTimeout parameters. You can select any of the following transaction isolation levels: Serializable, RepeatableRead, ReadCommitted, ReadUncommitted, Snapshot, Chaos, and Unspecified.

    Note
    The default value of Transaction Isolation Level is Serializable for the WCF-SQL adapter for both inbound and outbound operations. For information about these transaction isolation levels, see the Members section at Isolation Level Enumeration (http://go.microsoft.com/fwlink/?LinkId=126983).

    Setting Transaction Isolation Level
  14. Click OK in the WCF-Custom Transport Properties dialog box.

  15. Click OK in the open dialog boxes to save the changes.


Deployment

This section provides information about deploying the Microsoft BizTalk Adapter Pack. It also provides answers to some frequently asked questions and a link to information about troubleshooting common installation issues.

In This Section

  • Installing the BizTalk Adapter Pack

  • Troubleshooting Your Installation


Installing the BizTalk Adapter Pack

You can install the SQL adapter either as part of the BizTalk Adapter Pack installation or as a separate adapter.

  • If you want to install the SQL adapter as part of the BizTalk Adapter Pack, see the BizTalk Adapter Pack installation guide (InstallationGuide.htm) for installation prerequisites and complete instructions for installing the BizTalk Adapter Pack. This document is installed on your computer, typically under <installation drive>:\Program Files\Microsoft BizTalk Adapter Pack\Documents.

  • If you want to install only the SQL adapter as a separate adapter, see the SQL adapter installation guide (SQLAdapterInstallGuide.htm) for installation prerequisites and complete instructions for installing the SQL adapter. This document is installed on your computer, typically under <installation drive>:\Program Files\Microsoft BizTalk Adapter for SQL Server\Documents.

Important
The BizTalk Adapter Pack and the SQL adapter that is shipped separately cannot coexist on the same computer.

See Also

Concepts

Troubleshooting Your Installation

Other Resources

Deployment

© 2013 Microsoft Corporation. All rights reserved.


Troubleshooting Your Installation

Installation of the Microsoft BizTalk Adapter Pack or the separate SQL adapter copies the product binaries on a computer and registers the bindings for each adapter. For information about troubleshooting installation issues, see Troubleshooting Installation Issues.

See Also

Tasks

Troubleshooting Installation Issues

Other Resources

Deployment

© 2013 Microsoft Corporation. All rights reserved.


Troubleshooting

The BizTalk Adapter Pack uses or depends on several Microsoft technologies, including but not limited to the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, Microsoft Visual Studio, the Microsoft .NET Framework 3.5 SP1, and .NET Framework 4.5. The BizTalk Adapter Pack is built on top of the WCF LOB Adapter SDK, which in turn requires the .NET Framework 3.5 SP1 and .NET Framework 4.5. The adapters can be consumed either by writing applications using the Visual Studio or by creating BizTalk applications. For issues related to each of these technologies and products, see the respective documentation.

This section provides information about troubleshooting the BizTalk Adapter Pack, including:

  • Enabling tracing to diagnose issues with the adapters.

  • Handling installation and operational issues that you might encounter when working with the adapters, including probable cause, and a resolution.

  • Using performance counters to gauge adapter performance.

In This Section

  • Diagnostic Tracing and Message Logging

  • Troubleshooting Installation Issues

  • Troubleshooting Operational Issues

  • Using Performance Counters


Diagnostic Tracing and Message Logging

Diagnostic tracing helps to effectively diagnose problems that you might encounter when using the adapters. Adapter clients can activate diagnostic tracing at two levels:

  • Between the adapter client and the adapter

  • Within the adapter

This section provides information about activating tracing at these levels.

Tracing Between the Adapter Client and the Adapter

Adapter clients can enable WCF tracing to trace issues between the adapter client and the adapter. WCF tracing is used to trace the input XML that comes from the adapter client by using the WCF service model and is useful in diagnosing serialization issues. WCF tracing is not used for the WCF channel model or for output messages from the adapter to the adapter client. You can activate WCF tracing for BizTalk applications and WCF service model applications by adding an excerpt to the respective configuration files. Also, you can enable tracing both at design time and run time.

  • Tracing at design time. For the design-time experience, you may use the Add Adapter Service Reference Plug-in, Consume Adapter Service Add-in, or the Add Adapter Metadata Wizard. All these tools can be used from Visual Studio. So, to enable tracing for the design-time experience, you must add the excerpt to the devenv.exe.config file located in <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • Tracing at run time. For run-time tracing, you must add the excerpt depending on the application you are using.

    • For a BizTalk Server application, you must add the excerpt to the BizTalk configuration file, typically BTSNTSvc.exe.config. For BizTalk Server 2013, this file is available typically under <installation drive>:\Program Files\Microsoft BizTalk Server 2013.

    • For a WCF service model .NET application, you must add the excerpt to the app.config file of your project.

To enable WCF tracing, add the following excerpt within the <configuration> tag.

Copy Code
<system.diagnostics>
    <sources>
      <source name ="System.ServiceModel" switchValue="Verbose">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
      <source name ="System.ServiceModel.MessageLogging"
              switchValue="Verbose, ActivityTracing">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
      <source name ="System.Runtime.Serialization" switchValue="Verbose">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
   </sources>
   <sharedListeners>
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener"
           traceOutputOptions="LogicalOperationStack"
           initializeData="C:\log\WCFTrace.svclog" />
   </sharedListeners>
   <trace autoflush="true" />
  </system.diagnostics>
  <system.serviceModel>
    <diagnostics>
      <messageLogging
           logEntireMessage="true"
           logMalformedMessages="false"
           logMessagesAtServiceLevel="true"
           logMessagesAtTransportLevel="false"/>
    </diagnostics>
  </system.serviceModel>

This saves the WCF traces to C:\log\WCFTrace.svclog. For more information about WCF tracing, see "Tracing" at http://go.microsoft.com/fwlink/?LinkId=91242.

Important
Make sure you mitigate potential security threats of exposing sensitive business data by enabling tracing. For recommendations see Best Practices.

Tracing Within the Adapter

The adapters log different categories of useful information to the trace file such as errors, warnings, and information messages. Such information is useful in understanding the process flow within the adapter and diagnosing issues with the adapter. You can activate the WCF LOB Adapter SDK and adapter tracing for BizTalk applications and WCF service model applications by adding an excerpt to the respective configuration files. Also, you can enable tracing both at design time and run time.

  • Tracing at design time. For the design-time experience, you may use the Add Adapter Service Reference Plug-in, Consume Adapter Service Add-in, or the Add Adapter Metadata Wizard. All these tools can be used from Visual Studio. So, to enable tracing for the design-time experience, you must add the excerpt to the devenv.exe.config file located in <installation drive>:\Program Files\Microsoft Visual Studio <version>\Common7\IDE.

  • Tracing at run time. For run-time tracing, you must add the excerpt depending on the application you are using.

    • For a BizTalk Server application, you must add the excerpt to the BizTalk configuration file, typically BTSNTSvc.exe.config. For BizTalk Server 2013, this file is available typically under <installation drive>:\Program Files\Microsoft BizTalk Server 2013.

    • For a WCF service model .NET application, you must add the excerpt to the app.config file of your project.

To enable WCF LOB Adapter SDK and adapter tracing, add the following excerpt within the <configuration> tag.

Copy Code
<system.diagnostics>
    <sources>
      <source name="Microsoft.ServiceModel.Channels" switchValue="Error">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
      <source name="Microsoft.Adapters.Sql" switchValue="Information">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener"
   traceOutputOptions="LogicalOperationStack"
          initializeData="C:\log\AdapterTrace.svclog" />
    </sharedListeners>
    <trace autoflush="true" />
  </system.diagnostics>

This saves the WCF traces to C:\log\AdapterTrace.svclog.

Viewing the Traces

You can use the Windows Communication Foundation (WCF) Service Trace Viewer tool to view the traces. For more information about the tool, see "Using Service Trace Viewer for Viewing Correlated Traces and Troubles" at http://go.microsoft.com/fwlink/?LinkId=91243.

Configuring Tracking for BizTalk Applications

The BizTalk Server Administration console lets you configure various tracking options for items such as send ports and receive ports. The tracking configuration settings enable you to track inbound and outbound event data, message properties, message bodies, and orchestrations. For more information about configuring tracking for BizTalk applications, see "Configuring Tracking Using the BizTalk Server Administration Console" at http://go.microsoft.com/fwlink/?LinkId=106851.

You can also use Health and Activity Tracking (HAT) to view historical or tracked data. For more information, see "Viewing Historical or Tracked Data Using HAT" at http://go.microsoft.com/fwlink/?LinkId=106852.

See Also

Other Resources

Troubleshooting

© 2013 Microsoft Corporation. All rights reserved.


Troubleshooting Installation Issues

This topic was last updated on: June 05, 2009

Important
The SQL adapter is available as part of the BizTalk Adapter Pack as well as a separate adapter. If you are accessing this topic to know about installation issues with the SQL adapter that is separate from the BizTalk Adapter Pack, all references to the BizTalk Adapter Pack Setup must be interpreted as SQL adapter Setup.

Installation of the Microsoft BizTalk Adapter Pack copies the product binaries on the computer and registers the bindings for each adapter. This section discusses using troubleshooting techniques to resolve installation errors.

Logging Messages for Setup Actions

The BizTalk Adapter Pack setup program performs the standard task of installing the BizTalk Adapter Pack. Additionally, the setup also performs certain custom actions such as registering the adapter bindings. You can log messages for both the standard as well as custom actions that the setup performs.

  • The BizTalk Adapter Pack setup installs the adapter-specific files using an MSI. Therefore, the logging for the setup is the standard MSI logging.

  • All logs for the custom actions that the setup program performs are available at %TEMP%\adaptersetup.log. If the tracing to the log file fails, the traces are also available in the event log.

Known Issues

The following are the most common errors you might encounter when installing the BizTalk Adapter Pack, along with their probable cause and resolution.

  • Setup fails to register adapter bindings

  • Error while using the Consume Adapter Service add-in or Add Adapter Service Reference plug-in on a 64-bit installation

  • Invalid binding error while configuring SQL adapter ports in BizTalk Server Administration Console on a 64-bit installation

Setup fails to register adapter bindings

Problem

The Microsoft BizTalk Adapter Pack Setup Wizard fails to register the adapter bindings, but proceeds with the adapter installation.

Cause

This might result due to problems with Windows Communication Foundation (WCF) installation, Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK installation, or the machine.config file being corrupt. The adapter bindings are written to the machine.config file.

Resolution

You should manually register the SQL adapter binding.

To register the adapter binding

  1. Navigate to the machine.config file on the computer. For example, on a 32-bit platform, the machine.config is available under <system drive>:\WINDOWS\Microsoft.NET\Framework\<version>\CONFIG.

    In this path, <version> is the version of the .NET Framework. For example, for Microsoft .NET Framework 3.5 SP1, the version will be v2.0.50727.

  2. Open the file by using a text editor.

  3. To register the SQL adapter binding:

    1. Search for the element "system.serviceModel" and add the following under it:

      Copy Code
      <client>
  <endpoint binding="sqlBinding" contract="IMetadataExchange" name="mssql" />
</client>
    2. Search for the element "bindingElementExtensions" under system.serviceModel\extensions.

    3. Look for the missing SQL adapter binding. Add the following section under the "bindingElementExtensions" node.

      For SQL adapter, add:

      Copy Code
      <add name="sqlAdapter" type="Microsoft.Adapters.Sql.SqlAdapterBindingElementExtensionElement,Microsoft.Adapters.Sql, Version=<version>, Culture=neutral, PublicKeyToken=<public key>" />
    4. Search for the element "bindingExtensions" under system.serviceModel\extensions.

    5. Look for the missing SQL adapter binding. Add the following section under the "bindingExtensions" node.

      For SQL adapter, add:

      Copy Code
      <add name="sqlBinding" type="Microsoft.Adapters.Sql.SqlAdapterBindingCollectionElement,Microsoft.Adapters.Sql, Version=<version>, Culture=neutral, PublicKeyToken=<public key>" />

    Note
    For information about how to determine the public key and the version, see Determining the Public Key and Version.

  4. Save and close the machine.config file.

Determining the Public Key and Version

Perform the following steps to determine the public key for SQL adapter.

To determine the public key

  1. Navigate to the Windows directory, typically C:\WINDOWS\assembly.

  2. Right-click the DLL for which you want the public key and the version, and then select Properties. The following table lists the name of the DLL for SQL adapter.

    Adapter Name of the DLL

    SQL adapter

    Microsoft.Adapters.Sql

  3. On the General tab, the value against the Public Key Token label specifies the public key for the DLL. Similarly, value against the Version label specifies the version number for the DLL.

  4. Copy the public key, and then click Cancel.

Error while using the Consume Adapter Service add-in or Add Adapter Service Reference plug-in on a 64-bit installation

Problem

Using the Add Adapter Service Reference Visual Studio Plug-in or the Consume Adapter Service BizTalk Project Add-in from Visual Studio on a 64-bit computer running 64-bit version of the BizTalk Adapter Pack results in the following error:

Copy Code
No valid adapters are installed on this machine

Cause

The SQL adapter is a WCF custom binding, which is registered under System.ServiceModel in the machine.config file. A 64-bit platform has two machine.config files, one used by the 32-bit applications and the other used by the 64-bit applications. So, when you install the 64-bit version of the BizTalk Adapter Pack, the setup wizard registers the bindings in the 64-bit version of the machine.config file. However, Visual Studio runs as a 32-bit process and hence when you launch the Consume Adapter Service Add-in from Visual Studio, the plug-in checks for the bindings in the 32-bit version of the machine.config file and fails giving an error.

Resolution

Install both the 32-bit and 64-bit versions of the BizTalk Adapter Pack on a 64-bit WCF LOB Adapter SDK installation.

Important
You must only have a 64-bit WCF LOB Adapter SDK installation. Side-by-side installation of 32-bit and 64-bit WCF LOB Adapter SDK on a single computer is not supported.

Invalid binding error while configuring SQL adapter ports in BizTalk Server Administration Console on a 64-bit installation

Problem

When you try to configure a port for the adapter in BizTalk Server Administration console, you get the following error:

Copy Code
"Unable to create binding configuration element for editing. Check the values of the BindingType and BindingConfiguration properties.
(Microsoft.Biztalk.Adapter.Wcf.Converters.CreateBindingException) Unable to get binding type for binding extension "sqlBinding".
Verify the binding extension is registered in machine.config."

Cause

The SQL adapter is a WCF custom binding, which is registered under System.ServiceModel in the machine.config file. A 64-bit platform has two machine.config files, one used by the 32-bit applications and the other used by the 64-bit applications. So, when you install the 64-bit version of the BizTalk Adapter Pack, the setup wizard registers the bindings in the 64-bit version of the machine.config file. However, BizTalk Server Administration console runs as a 32-bit process and hence when you configure a port for the adapter, it checks for the bindings in the 32-bit version of the machine.config file and fails giving an error.

Resolution

Install both the 32-bit and 64-bit versions of the BizTalk Adapter Pack on a 64-bit WCF LOB Adapter SDK installation.

Important
You must only have a 64-bit WCF LOB Adapter SDK installation. Side-by-side installation of 32-bit and 64-bit WCF LOB Adapter SDK on a single computer is not supported.

See Also

Other Resources

Troubleshooting

© 2013 Microsoft Corporation. All rights reserved.


Troubleshooting Operational Issues

This topic was last updated on: June 05, 2009

This section discusses using troubleshooting techniques to resolve operational errors that you might encounter when using Microsoft BizTalk Adapter for SQL Server.

Enabling Tracing

You must enable tracing between the adapter, WCF LOB Adapter SDK, and SQL Server to gather more information about any issues you encounter while using the SQL adapter. For more information about tracing support in the SQL adapter, see Diagnostic Tracing and Message Logging.

Known Issues

The following are the most common errors you might encounter when using the SQL adapter, along with their probable cause and resolution.

  • Error in loading the adapter bindings

  • The SQL adapter does not display in the list of adapters in BizTalk Server Administration console

  • Error while performing operations on a SQL Server database

  • InvalidOperationException with ErrorCode=5 while performing FILESTREAM operations

  • Polling operation does not return any messages even if valid statements are specified for PollingStatement and PolledDataAvailableStatement

  • The adapter fails to insert, update, or delete large volumes of data in a single operation using BizTalk Server

  • Full schema validation in BizTalk Server fails for response messages containing DataSet

  • Error with RootNode TypeName in BizTalk Projects

  • Adapter fails to generate metadata of strongly-typed stored procedure with temporary tables

  • Invalid binding warning when using the adapter in Visual Studio

  • BizTalk Server throws an exception if you use more than one Notification schema in the same application or use the Notification schema across multiple applications on the same host

  • Adapter client throws an exception on performing an operation after the connectivity is restored between the adapter client and the SQL Server database

  • Memory usage and thread count increases when using the adapter in a transacted inbound operation

Error in loading the adapter bindings

Problem

When you try to start the Add Adapter Service Reference Visual Studio Plug-in or the Consume Adapter Service BizTalk Project Add-in, you get the following error:

Copy Code
There was an error loading the binding, <binding name>, from your system configuration.
ConfigurationErrorsException: Exception has been thrown by the target of an invocation.

Cause

When you try to start the Add Adapter Service Reference Plug-in or the Consume Adapter Service Add-in, WCF loads the adapter bindings for all the installed adapters. In turn, the adapter bindings are dependent on the specific client software for the enterprise application. You might face this issue if you did a Typical or Complete installation of the adapter, which installs all the adapters contained in the BizTalk Adapter Pack. However, the LOB client libraries might be installed for only one enterprise application. As a result, the GUI fails to load the bindings for the other adapters.

Resolution

Make sure you do a custom installation of the adapters to install only the adapter you need.

The SQL adapter does not display in the list of adapters in BizTalk Server Administration console

Problem

Unlike the earlier version of the adapters shipped with BizTalk Server, the SQL adapter shipped with BizTalk Adapter Pack does not show up in the list of adapters in the BizTalk Server Administration console.

Cause

The latest SQL adapter is a WCF custom binding. So, although the BizTalk Server Administration console displays the WCF-Custom adapter, it does not display the WCF custom bindings and hence, does not display the WCF-based SQL adapter.

Resolution

You can explicitly add the SQL adapter to the BizTalk Server Administration console by following the steps mentioned in Adding the SQL Adapter to BizTalk Server Administration Console.

Error while performing operations on a SQL Server database

Problem

The adapter gives the following error when performing any operation on a SQL Server database using BizTalk Server.

  • For BizTalk Server 2013

    Copy Code
    System.ArgumentNullException: Value cannot be null.

Cause

The WCF action for the message is not specified. WCF requires a SOAP action to be specified for every operation, which informs the adapter about the operation to be performed on the LOB application.

Resolution

Specify the SOAP action in the send port or as a message context property in a BizTalk orchestration. For instructions, see Specifying SOAP Action. See Technical Reference to see a list of actions for each operation.

InvalidOperationException with ErrorCode=5 while performing FILESTREAM operations

Problem

You get the following error while using the SQL adapter to perform FILESTREAM operations.

Copy Code
System.InvalidOperationException: OpenSqlFileStream returned error.
ErrorCode:5

Cause

You might have specified database credentials to connect to the SQL Server database. To perform FILESTREAM operations, you must always use Windows Authentication. The error code “5” denotes that access is denied because of incorrect credentials. For more information about the different error codes, see http://go.microsoft.com/fwlink/?LinkId=126619.

Resolution

Use Windows Authentication to connect to the SQL Server database. In BizTalk Server Administration console, you can do so by leaving the user name and password fields blank in the WCF-Custom or WCF-SQL port configuration dialog box.

Polling operation does not return any messages even if valid statements are specified for PollingStatement and PolledDataAvailableStatement

Problem

Even if valid values are specified for the PollingStatement and PolledDataAvailableStatement binding properties, the adapter does not receive a polling message from SQL Server.

Cause

Verify whether any other transaction has taken a lock on the table that the adapter is polling.

Resolution

If you want to poll a table that is being updated as part of another transaction, you can consider using “with (nolock)” parameter as part of the query specified for PolledDataAvailableStatement binding property to ensure that data is returned even if a lock is imposed by the other transaction. For information about locking in the SQL Server database, see http://go.microsoft.com/fwlink/?LinkId=126715.

The adapter fails to insert, update, or delete large volumes of data in a single operation using BizTalk Server

Problem

The SQL adapter fails to insert, update, or delete large volumes of data in a single operation using BizTalk Server.

Cause

Inserting, updating, or deleting large volumes of data may take time and the SQL adapter or the transaction in which the operation is being performed, may time out.

Resolution

  • For BizTalk Server 2013

    1. Specify the timeout for the WCF adapter in the machine.config. Navigate to the machine.config file under <system drive>:\WINDOWS\Microsoft.NET\Framework\<version>\CONFIG and add the excerpt that resembles the following.

      Copy Code
      <configuration>
 <system.transactions>
  <machineSettings maxTimeout="02:00:00" />
 </system.transactions>
</configuration>
      With this setting, the WCF adapter timeout is set to 2 hours.

    2. Specify the timeout settings for MSDTC transactions in the machine.config. Navigate to the machine.config file under <system drive>:\WINDOWS\Microsoft.NET\Framework\<version>\CONFIG and add the excerpt that resembles the following.

      Copy Code
      <system.transactions>
        <defaultSettings distributedTransactionManagerName="<computer_name>" timeout="02:00:00"/>
    </system.transactions>
      With this setting, the MSDTC timeout is set to 2 hours. The default value for MSDTC timeout is 10 minutes.

      Important
      You must make this change on the computers running the adapter client and SQL Server. In the excerpt, replace <computer_name> with the name of computer running the adapter client and SQL Server.

    3. Set the SendTimeout binding property for the SQL adapter to a fairly large value. For instructions on how to set the binding properties, see Specifying Binding Properties.

Full schema validation in BizTalk Server fails for response messages containing DataSet

Problem

For operations that return a response message containing a DataSet, for example ExecuteReader, full schema validation fails in BizTalk Server.

Resolution

We recommend you to not do a full schema validation for response messages containing a dataset. Instead, you could do the following:

  1. Execute the operation once that returns the response message with the schema.

  2. Copy the schema from the response message to a .xsd file and add this file to your BizTalk project.

  3. Use an xpath query in your orchestration to extract the data from the response message.

Error with RootNode TypeName in BizTalk Projects

Problem

In a BizTalk project in Visual Studio, if the schemas generated from the Consume Adapter Service Add-in contains invalid characters or reserved words for the RootNode TypeName property, the following error will occur while compiling the project:

Copy Code
Node <node reference> - Specify a valid .NET type name for this root node.
The current .NET type name of this root node is invalid (it is a reserved BizTalk Keyword or is an invalid C# identifier).

Resolution

  1. Right-click the rood node referenced in the error and select Properties.

  2. For the RootNode TypeName property, remove any illegal characters or reserved words, for example, dot (.).

Adapter fails to generate metadata of strongly-typed stored procedure with temporary tables

Problem

The adapter fails to generate metadata for strongly-typed stored procedures that include temporary tables in their definition. The adapter gives the following exception.

Copy Code
Microsoft.ServiceModel.Channels.Common.MetadataException:
Retrieval of Operation Metadata has failed while building WSDL at 'TypedProcedure/<schema>/<stored_procedure_name>' --->
System.Data.SqlClient.SqlException: Invalid object name '<temp_table_name>'.

Resolution

The SQL adapter does not support generating metadata for strongly-typed stored procedures that contain temporary tables in their definition. Instead, you should generate metadata for the same procedure from under the Procedures node while using the Add Adapter Service Reference Plug-in or Consume Adapter Service Add-in.

Invalid binding warning when using the adapter in Visual Studio

Problem

When you use the adapter to create an application in Visual Studio 2012 and you open the configuration file (app.config) generated by the adapter, you see a warning similar to the following:

Copy Code
The element 'bindings' has invalid child element 'sqlBinding'. List of possible elements expected: 'basicHttpBinding, customBinding, ...

Cause

This warning appears because the SQL adapter binding, sqlBinding, is not a standard binding shipped with the Windows Communication Foundation (WCF).

Resolution

You can safely ignore this warning.

BizTalk Server throws an exception if you use more than one Notification schema in the same application or use the Notification schema across multiple applications on the same host

Problem

BizTalk Server throws an XLANG exception or an exception stating that the application cannot locate the document specification because multiple schemas matched the message type.

Cause

This happens because of either of the following:

  • You have generated more than one Notification schema in a BizTalk Server project, deployed it to a BizTalk Server application, and then ran the application to receive notifications from the SQL Server database. Because the Notification schemas are common, there is a conflict between the schemas that are deployed in the BizTalk Server application.

  • In case of multiple projects, you have generated a Notification schema for each of the BizTalk Server projects, deployed each project to a separate BizTalk Server application on the same host, and then ran an application or applications to receive notifications from the SQL Server database. Because the schemas and assemblies are accessible across the applications in BizTalk Server, there is a conflict between the common schemas deployed under various BizTalk Server applications and assemblies.

Resolution

Use a single Notification schema file for a BizTalk Server application. If you need to use the Notification schema in multiple BizTalk Server applications on the same host, create an application containing a single Notification schema, and then use the notification schema from all other applications in BizTalk Server.

Adapter client throws an exception on performing an operation after the connectivity is restored between the adapter client and the SQL Server database

Problem

Adapter client throws the following exception on executing an operation on the SQL Server database:

Copy Code
{System.Data.Common.DbException} = {"A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)"}

Cause

During the execution of an operation, the adapter uses the connection from the SQL ADO.NET connection pool to connect to the SQL Server database, and perform the operation. If there is a brief network outage between the adapter client and the SQL Server database or if the SQL Server database is down temporarily, all the connections in the SQL ADO.NET connection pool become invalid. After the connectivity is restored and you try to perform an operation on the SQL Server database, the adapter uses the same invalid connections from the SQL ADO.NET connection pool, and therefore the adapter client throws the exception.

Resolution

The adapter client should implement retry logic in their operation execution where they should catch the exception and specify the operation retry count as “n+1”, where “n” is the value specified for the MaxConnectionPoolSize binding property. This implies that if there are “n” number of connections in the connection pool that have been rendered invalid, theoretically the adapter client should retry for a maximum of “n+1” times to get a valid connection, and hence perform the operation.

For example, to specify the retry count in BizTalk Server, open the Properties dialog box of a send port in an application, click Transport Advanced Options in the left pane of the dialog box, and in the Transport Options area, specify a value in the Retry count list.

Memory usage and thread count increases when using the adapter in a transacted inbound operation

Problem

In a transacted inbound operation, such as Polling, if there is no data available in the table being polled and the adapter continues to poll, over a period of time you experience an increase in the memory usage and the thread count.

Cause

If there is no data available in the table being polled, after every receive timeout cycle, Windows Communication Foundation (WCF) spawns a new thread to continue the polling operation. Hence, the thread count and memory usage increases over a period of time. However, if the table being polled has some data, the same thread continues to perform all subsequent polls.

Resolution

We recommend setting the ReceiveTimeout to the maximum possible value, which is 24.20:31:23.6470000 (24 days) so that a new thread is spawned only every 24 days. This will ensure that the memory usage and thread count does not grow too much too soon.

Note
If SqlAdapterInboundTransactionBehavior has been set, make sure the TransactionTimeout is also configured to maximum possible value, which is 24.20:31:23.6470000 (24 days). When using this workaround, we can add the SqlAdapterInboundTransactionBehavior only if the transaction isolation level has to be configured. Else, it is a best practice to remove that behavior.

For more information about the ReceiveTimeout binding property, see Working with BizTalk Adapter for SQL Server Binding Properties. For instructions on specifying binding properties, see Specifying Binding Properties.

Note
When using the adapter with BizTalk Server, setting the timeout to a large value does not impact the functionality of the adapter.

See Also

Other Resources

Troubleshooting

© 2013 Microsoft Corporation. All rights reserved.


Using Performance Counters

BizTalk Adapter Pack clients can use the performance counters to gauge the performance of the adapters. The BizTalk Adapter Pack setup program creates the performance counter category "Microsoft BizTalk Adapter for SQL Server" along with the Adapter Pack installation.

The LOB Time (Cumulative) Performance Counter

The BizTalk .NET Adapter for SQL category has one performance counter called "LOB Time (Cumulative)". This performance counter denotes the time, in milliseconds, that the SQL Server client library takes to complete an action that the adapter initiates. The SQL adapter creates an instance of the performance counter for each action, for a specific SQL Server instance and database name. The instances are created in the following pattern:

Copy Code
<processId>:<appDomainId>:<endpointId>:<actionId>

The <endpointId> is derived as <sql_server_name>, <instance_name>, <database_name>.

The <actionId> is derived in the following manner:

  • For opening a connection, the action ID is “Open”.

  • For inbound operations, the action ID is “Inbound”.

  • For outbound operations, the action ID is the action of the operation being invoked, with “/” replaced by an underscore “_”. Also, the action ID is prefixed with the “ExecuteScalar”, “ExecuteReader”, or “ExecuteNonQuery” depending on the method that the adapter internally uses to perform the operation on the SQL Server database. For example, the adapter internally uses the ExecuteReader method to execute a stored procedure in SQL Server. So, the action ID for the stored procedure, MyProcedure, will be:

    Copy Code
    ExecuteReader_Procedure_dbo_MyProcedure

The performance counter is initialized only after the adapter makes the first call to the SQL Server database. Also, the InstanceLifetime property of the performance counter is set to 'Process', which means that the performance counter ceases to exist as soon as the program that creates the counter terminates. For more information about the InstanceLifetime property, see http://go.microsoft.com/fwlink/?LinkId=104181.

Note
The precision of the LOB Time (Cumulative) performance counter is 16 milliseconds.

Enabling Performance Counters

The performance counters can be enabled or disabled by setting the binding property EnablePerformanceCounters. To enable performance counters, set the EnablePerformanceCounters binding property to True. To disable performance counters, set EnablePerformanceCounters to False. By default, the property is set to False. For more information about this binding property, see Working with BizTalk Adapter for SQL Server Binding Properties.

Performance Counters and the WCF LOB Adapter SDK

Changing the value of the EnablePerformanceCounters binding property also changes the value of the corresponding performance counter for the WCF LOB Adapter SDK. Also, the binding property for the WCF LOB Adapter SDK is static, whereas that for the SQL adapter is dynamic. Hence, if there are two instances of the SQL adapter binding in the application domain, and the EnablePerformanceCounters binding property is set to True in one and False in the other, the adapter-specific performance counter will be enabled in one and disabled in the other. However, because the binding property for WCF LOB Adapter SDK is static, it will either be set to True or False depending on what value was specified last.

See Also

Other Resources

Troubleshooting

© 2013 Microsoft Corporation. All rights reserved.


Technical Reference

This section covers technical reference information about Microsoft BizTalk Adapter for SQL Server.

In This Section

  • Messages and Message Schemas for BizTalk Adapter for SQL Server

  • Metadata Node IDs

  • Glossary


Messages and Message Schemas for BizTalk Adapter for SQL Server

The Microsoft BizTalk Adapter for SQL Server is a Windows Communication Foundation (WCF) custom binding. It exposes operations that applications can invoke on it and that it can, in turn, invoke on applications. These operations are invoked by sending SOAP messages over a channel. If a response is required, it is returned in a SOAP message over the same channel.

As a WCF service, the SQL adapter exposes metadata for its operations and data types by using standard WCF mechanisms. The sections in this topic describe the XML structure of the messages and data types that the SQL adapter uses.

In This Section

  • Basic SQL Server Data Types

  • Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views

  • Message Schemas for Procedures and Functions

  • Message Schemas for the Polling and TypedPolling Operations

  • Message Schemas for Query Notification

  • Message Schemas for Composite Operations

  • Message Schemas for the ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

See Also

Other Resources

Technical Reference

© 2013 Microsoft Corporation. All rights reserved.


Basic SQL Server Data Types

This topic describes how the Microsoft BizTalk Adapter for SQL Server surfaces basic SQL Server data types.

Supported SQL Server Data Types

The following table shows how the SQL Server data types are surfaced by the SQL adapter:

SQL Server Data Type XSD type .NET type Comments

Bigint

Long

Long

-

Binary

Base64Binary

Byte[]

-

Bit

Boolean

Bool

-

Char

String

String

-

Date

DateTime

DateTime

-

Datetime

DateTime

DateTime

While writing data to a Datetime field, the adapter always stores the time in GMT. If you specify the time-zone information, the adapter uses that to convert the value to a valid GMT value, and writes it to the database table. For example, 12/31/2008T23:59:59+5:30 is written to the table as 12/31/2008 6:29:59 PM.

However, if you do not specify the time-zone information, the adapter considers the value to be in GMT already, and writes the same value to the table. For example, 12/31/2008T23:59:59 is written to the table as 12/31/2008 11:59:59 PM.

Datetime2

DateTime

DateTime

-

Datetimeoffset

DateTime

DateTime

-

Decimal

xsd:decimal if precision <= 28

xsd:string if precision > 28

Decimal if precision <= 28

String if precision > 28

-

Filestream

Base64Binary

Byte[]

-

Float

Double

Double

-

Geography

String

String

-

Geometry

String

String

-

Hierarchyid

String

String

-

Image

Base64Binary

Byte[]

-

Int

Int

Int

-

Money

Decimal

Decimal

-

Nchar

String

String

-

Ntext

String

String

-

Numeric

Decimal

Decimal

-

Nvarchar

String

String

-

Nvarchar(Max)

String

String

-

Real

Float

Float

-

Smalldatetime

DateTime

DateTime

-

Smallint

Short

Short

-

Smallmoney

Decimal

Decimal

-

SQLVariant

String

String

-

Text

String

String

-

Time

Duration

Timespan

-

Timestamp

Base64Binary

Byte[]

-

Tinyint

UnsignedByte

Byte

-

Uniqueidentifier

{http://schemas.microsoft.com/2003/10/Serialization/}:guid

Guid

-

Varbinary

Base64Binary

Byte[]

-

Varbinary(Max)

Base64Binary

Byte[]

-

Varchar

String

String

-

Varchar(Max)

String

String

-

XML

String

String

-

See Also

Other Resources

Messages and Message Schemas for BizTalk Adapter for SQL Server


Message Schemas for Insert, Update, Delete, and Select Operations on Tables and Views

This topic was last updated on: June 05, 2009

The Microsoft BizTalk Adapter for SQL Server surfaces Insert, Update, Delete, and Select operations for each table and view in the SQL Server database. These operations perform the appropriate SQL statement qualified by a WHERE clause. The SQL adapter uses strongly-typed records and record sets in these operations.

Message Structure for Table Operations

The following table shows the XML message structure for the basic table operations exposed by the SQL adapter on SQL Server database tables. The target table for an operation is specified in the message action and also appears in the target namespace.

Operation XML Message Description SQL Executed by the Adapter

Insert

Copy Code
<Insert xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Rows>
    <[TABLE_NAME]>
      <[FIELD1_NAME]>value1</[FIELD1_NAME]>
      <[FIELD2_NAME]>value2</[FIELD2_NAME]>
      …
    </[TABLE_NAME]>
  </Rows>
</Insert>

Inserts the supplied record set of strongly-typed data into the target table.

Copy Code
INSERT INTO TABLE_NAME (FIELD1_NAME, FIELD2_NAME, …) VALUES (value1, value2, …);

Insert Response

Copy Code
<InsertResponse xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <InsertResult>
    <long>[Value]</long>
  </InsertResult>
</InsertResponse>

The Insert Response message contains an array of Long data type. The array stores the identity values of the inserted rows, if any. If there is no identity column in a table, the return value is NULL.

--

Select

Selecting all records:

Copy Code
<Select xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Columns>*</COLUMNS>
  <Query></Query>
</Select>

Selecting specific columns in a set of records:

Copy Code
<Select xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Columns>[COLUMN_list]</COLUMNS>
  <Query>where [WHERE_clause]</Query>
</Select>

Updating records as part of the Select Operation:

Copy Code
<Select xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Columns>[COLUMN_list]</Columns>
  <Query>where [WHERE_clause];UPDATE [TABLE_NAME] SET [FIELD1_NAME] = [value1] where [WHERE_clause]</Query>
</Select>

A SELECT query is performed on the target table using the WHERE clause specified in the element. The result set contains the columns in the comma-separated list of column names specified in the <Columns> element.

It is mandatory to provide value in the <Columns> element. If all columns have to be retrieved in a table or view, * must be specified in the <Columns> element. If specific columns have to be retrieved, the column names must be separated by comma, and specified in the same order as they are defined in the table or view.

It is mandatory to include the WHERE clause in the SELECT statement. If you do not want to specify a WHERE clause, you can either delete the <Query> element or leave it empty.

You can update records using the Select operation. An UPDATE statement is placed in the <Query> element of the SELECT request XML, separated from the WHERE clause by a semi-colon. Note that the UPDATE statement does not operation on the result set of the SELECT statement.

Selecting all records:

Copy Code
SELECT * FROM [TABLE_NAME] WHERE [WHERE_clause];

Selecting specific columns in a set of records:

Copy Code
SELECT [COLUMN_list] FROM [TABLE_NAME] WHERE [WHERE_clause];

Updating records as part of the Select Operation:

Copy Code
SELECT [COLUMN_list] FROM [TABLE_NAME] WHERE [WHERE_clause]; UPDATE [TABLE_NAME] SET [FIELD1_NAME] = value1 [WHERE_clause];

Select Response

Copy Code
<SelectResponse  xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <SelectResult>
    <[TABLE_NAME]>
      <[FIELD1_NAME]>[value1]</[FIELD1_NAME]>
      <[FIELD2_NAME]>[value2]</[FIELD2_NAME]>
      …
    </[TABLE_NAME]>
  </SelectResult>
</SelectResponse>

The strongly-typed result set generated by the SELECT query.

--

Update

Copy Code
<Update xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Rows>
    <RowPair>
      <After>
        <[FIELD1_NAME]>[value1]</[FIELD1_NAME]>
        <[FIELD2_NAME]>[value2]</[FIELD2_NAME]>
        …
      </After>
      <Before>
        <[FIELD1_NAME]>[value3]</[FIELD1_NAME]>
        <[FIELD2_NAME]>[value4]</[FIELD2_NAME]>
        …
      </Before>
    </RowPair>
  </Rows>
</Update>

Take an array of record pairs as input. Each record pair is a collection of two strongly-typed records:

  • First record (in the <After> element) corresponds to new values that need to be updated.

  • Second record (in the <Before>) corresponds to the old values of the rows.

Copy Code
UPDATE [TABLE_NAME] SET [FIELD1_NAME] = value1, [FIELD2_NAME] = value2, … WHERE [FIELD1_NAME] = value3, [FIELD2_NAME] = value4, …;

Update Response

Copy Code
<UpdateResponse xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <UpdateResult>[rows updated]</UpdateResult>
</UpdateResponse>

The number of rows updated is returned in the UpdateResult element.

--

Delete

Copy Code
<Delete xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <Rows>
    <[TABLE_NAME]>
      <[FIELD1_NAME]>value1</[FIELD1_NAME]>
      <[FIELD2_NAME]>value2</[FIELD2_NAME]>
      …
    </[TABLE_NAME]>
  </Rows>
</Delete>

--

Copy Code
DELETE FROM [TABLE_NAME] WHERE [FIELD1_NAME] = value1, [FIELD2_NAME] = value2, …;

Delete Response

Copy Code
<DeleteResponse xmlns="[VERSION]/TableOp/[SCHEMA]/[TABLE_NAME]">
  <DeleteResult>[rows deleted]</DeleteResult>
</DeleteResponse>

The number of rows deleted is returned in the DeleteResult element.

--

[VERSION] = The message version string; for example, http://schemas.microsoft.com/Sql/2008/05.

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[TABLE_NAME] = Name of the table; for example, Employee.

[FIELD1_NAME] = Table field name; for example, NAME.

[COLUMN_list] = Comma-separated list of columns; for example, Name, Age, Designation.

[SELECT_query] = A SQL SELECT statement specified in the QUERY element of a Bulk Insert operation; for example, "SELECT * from MyTable"

[WHERE_clause] = WHERE_clause for the SELECT statement used for the operation; for example, ID > 10.

Important
The message structure for the basic table operations on views is the same as that on tables except that the view replaces the table: Insert xmlns="[VERSION]/ViewOp/[SCHEMA]/[VIEW_NAME]".

Message Actions for Basic Table Operations

The following table shows the message actions that are used by the SQL adapter for the basic table operations on tables. The SQL adapter uses the table name specified in the message action to determine the target table of the operation.

Operation | Message Action | Example
Insert | TableOp/Insert/[SCHEMA]/[TABLE_NAME] | TableOp/Insert/dbo/Employee
Insert Response | TableOp/Insert/[SCHEMA]/[TABLE_NAME]/response | TableOp/Insert/dbo/Employee/response
Select | TableOp/Select/[SCHEMA]/[TABLE_NAME] | TableOp/Select/dbo/Employee
Select Response | TableOp/Select/[SCHEMA]/[TABLE_NAME]/response | TableOp/Select/dbo/Employee/response
Update | TableOp/Update/[SCHEMA]/[TABLE_NAME] | TableOp/Update/dbo/Employee
Update Response | TableOp/Update/[SCHEMA]/[TABLE_NAME]/response | TableOp/Update/dbo/Employee/response
Delete | TableOp/Delete/[SCHEMA]/[TABLE_NAME] | TableOp/Delete/dbo/Employee
Delete Response | TableOp/Delete/[SCHEMA]/[TABLE_NAME]/response | TableOp/Delete/dbo/Employee/response

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[TABLE_NAME] = Name of the table; for example, Employee.

Important
The message action for an operation on a view is the same as that for a table except that "ViewOp" replaces "TableOp"; for example, ViewOp/Insert/dbo/Employee_View.

See Also

Other Resources

Messages and Message Schemas for BizTalk Adapter for SQL Server


Message Schemas for Procedures and Functions

This topic was last updated on: June 05, 2009

The Microsoft BizTalk Adapter for SQL Server surfaces SQL Server database stored procedures and scalar and table valued functions as operations. This section describes the message structure and actions used to invoke procedures and functions.

Message Structure of Procedures and Functions

The operations surfaced for procedures and functions follow a request-response message exchange pattern. The following table shows the structure of these request and response messages.

Operation XML Message Description

Stored Procedure Request

Copy Code
<[SP_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/[SCHEMA]">
  <[PRM1_NAME]>value1</[PRM1_NAME]>
  <[PRM2_NAME]>value2</[PRM2_NAME]>
  …
</[SP_NAME]>

-

Stored Procedure Response

Copy Code
<[SP_NAME]Response xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/[SCHEMA]">
  <[SP_NAME]Result>
    <DataSet>
     <any>[Value]</any>
     <any>[Value]</any>
     …
    </DataSet>
  </[SP_NAME]Result>
  <ReturnValue>[Value]</ReturnValue>
</[SP_NAME]Response>

The return value of a stored procedure is an array of DataSet.

Strongly-Typed Stored Procedure Request

Copy Code
<[STRNG_SP_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/[SCHEMA]">
  <[PRM1_NAME]>value1<[PRM1_NAME]>
  <[PRM2_NAME]>value2</[PRM2_NAME]>
  …
</[STRNG_SP_NAME]>

-

Strongly-Typed Stored Procedure Response

Copy Code
<[STRNG_SP_NAME]Response xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/[SCHEMA]">
    <StoredProcedureResultSet0>
        <StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProcedureResultSets/[SCHEMA]/[STRNG_SP_NAME]">
              <[PRM1_NAME]>value1<[PRM1_NAME]>
              <[PRM2_NAME]>value2</[PRM2_NAME]>
              …
        </StoredProcedureResultSet0>
   </StoredProcedureResultSet0>
   <ReturnValue>[Value]</ReturnValue>
</[STRNG_SP_NAME]Response>

The return value of a strongly-typed stored procedure is an array of strongly-typed data.

Scalar Function Request

Copy Code
<[SCLR_FN_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/ScalarFunctions/[SCHEMA]">
  <[PRM_NAME]>value</[PRM_NAME]>
</[SCLR_FN_NAME]>

-

Scalar Function Response

Copy Code
<[SCLR_FN_NAME]Response xmlns="http://schemas.microsoft.com/Sql/2008/05/ScalarFunctions/[SCHEMA]">
  <[SCLR_FN_NAME]Result>return_value</[SCLR_FN_NAME]Result>
  <[PRM_NAME]>value</[PRM_NAME]>
</[SCLR_FN_NAME]Response>

-

Table Valued Function Request

Copy Code
<[TBL_FN_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/TableValuedFunctions/[SCHEMA]">
  <[PRM1_NAME]>value1</[PRM1_NAME]>
  <[PRM2_NAME]>value2</[PRM2_NAME]>
  …
</[TBL_FN_NAME]>

-

Table Valued Function Response

Copy Code
<[TBL_FN_NAME]Response xmlns="http://schemas.microsoft.com/Sql/2008/05/TableValuedFunctions/[SCHEMA]">
  <[TBL_FN_NAME]Result>
     <[TBL_FN_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/TableValuedFunctions/[SCHEMA]">
        <[PRM1_NAME]>value1</[PRM1_NAME]>
        <[PRM2_NAME]>value2</[PRM2_NAME]>
        ...
     </[TBL_FN_NAME]">
     ...
  </[TBL_FN_NAME]Result>
</[TBL_FN_NAME]Response>

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[SP_NAME] = The stored procedure to be executed; for example, ADD_EMP_DETAILS.

[STRNG_SP_NAME] = The strongly-typed stored procedure to be executed; for example, GET_EMP_DETAILS.

[SCLR_FN_NAME] = The scalar function to be executed; for example, GET_EMP_ID.

[TBL_FN_NAME] = The table valued function to be executed; for example, TVF_EMPLOYEE.

[PRM_NAME] = The name of the SQL Server parameter.

Message Actions of Functions and Procedures

The SQL adapter uses the following message actions for stored procedure and function operations.

Message | Action | Example
Stored Procedure Request | Procedure/[SCHEMA]/[SP_NAME] | Procedure/dbo/ADD_EMP_DETAILS
Stored Procedure Response | Procedure/[SCHEMA]/[SP_NAME]/response | Procedure/dbo/ADD_EMP_DETAILS/response
Strongly-Typed Stored Procedure Request | TypedProcedure/[SCHEMA]/[STRNG_SP_NAME] | TypedProcedure/dbo/GET_EMP_DETAILS
Strongly-Typed Stored Procedure Response | TypedProcedure/[SCHEMA]/[STRNG_SP_NAME]/response | TypedProcedure/dbo/GET_EMP_DETAILS/response
FOR XML Stored Procedure Request | XmlProcedure/[SCHEMA]/[SP_NAME] | XmlProcedure/dbo/GET_EMP_DETAILS_FOR_XML
FOR XML Stored Procedure Response | XmlProcedure/[SCHEMA]/[SP_NAME]/resp | XmlProcedure/dbo/GET_EMP_DETAILS_FOR_XML/response
Scalar Function Request | ScalarFunction/[SCHEMA]/[SCLR_FN_NAME] | ScalarFunction/dbo/GET_EMP_ID
Scalar Function Response | ScalarFunction/[SCHEMA]/[SCLR_FN_NAME]/response | ScalarFunction/dbo/GET_EMP_ID/response
Table Valued Function Request | TableFunction/[SCHEMA]/[TBL_FN_NAME] | TableFunction/dbo/TVF_EMPLOYEE
Table Valued Function Response | TableFunction/[SCHEMA]/[TBL_FN_NAME]/response | TableFunction/dbo/TVF_EMPLOYEE/response

[SP_NAME] = The stored procedure to be executed; for example, ADD_EMP_DETAILS.

[STRNG_SP_NAME] = The strongly-typed stored procedure to be executed; for example, GET_EMP_DETAILS.

[SCLR_FN_NAME] = The scalar function to be executed; for example, GET_EMP_ID.

[TBL_FN_NAME] = The name of the table valued function to be executed; for example, TVF_EMPLOYEE.

See Also

Other Resources

Messages and Message Schemas for BizTalk Adapter for SQL Server


Message Schemas for the Polling and TypedPolling Operations

The Microsoft BizTalk Adapter for SQL Server surfaces the Polling and TypedPolling inbound operations to return the result set of the polling query to an adapter client.

You configure the Polling and TypedPolling operations by setting binding properties in the SQL adapter. For more information about these binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties. You set the PollingStatement binding property to specify a SQL statement (SELECT or EXEC <stored procedure>) for the polling query. The result set of this query is returned as data to your code in the Polling operation, and as strongly-typed data in the TypedPolling operation. The structure of the result set is determined by the metadata that the adapter surfaces for the specified query.

Message Structure for the Polling and TypedPolling Operations

The following table shows the XML message structure for the Polling and TypedPolling operations.

Operation XML Message Description

Polling

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<Polling xmlns="http://schemas.microsoft.com/Sql/2008/05/Polling">
   <PolledData>
     <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
       <any>[Value]</any>
       <any>[Value]</any>
       …
     </DataSet>
   </PolledData>
</Polling>

This is the inbound message that is sent by the SQL Server to the adapter clients.

TypedPolling

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<TypedPollingResultSet xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedPolling">
   <COLUMN1>[Value]</Column1>
   <COLUMN2>[Value]</Column2>
   …
</TypedPollingResultSet>

This is the strongly-typed inbound message that is sent by the SQL Server to the adapter clients.

Message Action for the Polling and TypedPolling Operations

The message action for the:

  • Polling operation is “Polling.”

  • TypedPolling operation is “TypedPolling.”

See Also

Other Resources

Technical Reference

© 2013 Microsoft Corporation. All rights reserved.


Message Schemas for Query Notification

The Microsoft BizTalk Adapter for SQL Server surfaces the Notification operation to receive query notifications from the SQL Server database.

You configure the Notification operation by setting binding properties in the SQL adapter. For more information about the Notification-related binding properties, see Working with BizTalk Adapter for SQL Server Binding Properties. You set the NotificationStatement binding property to specify a SQL statement (SELECT or EXEC <stored procedure>) for the query notification. The result set of this query is returned as strongly-typed data to your code in the Notification operation.

Message Structure for the Notification Operation

The following table shows the XML message structure for the Notification operation.

Operation XML Message Description

Notification

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<Notification xmlns="http://schemas.microsoft.com/Sql/2008/05/Notification">
   <Info>Value</Info>
   <Source>Value</Source>
   <Type>Value</Type>
</Notification>

This is the inbound message that is sent by the SQL Server to the adapter clients. In the message:

  • The <Info> tag indicates the reason for the notification. For example, an “insert” value in this tag indicates that data has been inserted in one or more of the tables referenced in the notification statement.

  • The <Source> tag indicates the source for the notification. For example, a “data” value in this tag indicates a change in the data in a referenced object. Similarly, an “object” value in this tag indicates a change in a referenced object.

  • The <Type> tag indicates the type of data change. Query notification messages are of two types: change and subscribe. A “change” value in the <Type> tag indicates that the results of the query have changed, whereas a “subscribe” value in the <Type> tag indicates that a subscription request failed.

For more information about the query notification message tags, see the “Properties” section at http://go.microsoft.com/fwlink/?LinkId=122393.

Message Action for the Notification Operation

The message action for the notification operation is “Notification.”

See Also

Other Resources

Technical Reference

© 2013 Microsoft Corporation. All rights reserved.


Message Schemas for Composite Operations

The Microsoft BizTalk Adapter for SQL Server enables you to execute composite operations on the SQL Server database. A composite operation can contain multiple operations including the Insert, Update, and Delete operations on the tables and views, and operations on stored procedures. A composite operation can include these operations in any order.

For more information about:

  • Composite operations, see Support for Composite Operations.

  • How to perform composite operations using the SQL adapter, see Performing Composite Operations on SQL Server by Using BizTalk Server.

Message Structure for the Composite Operation

Since a composite operation contains multiple individual operations; the message structure of a composite operation contains message structures of the individual operations. As a composite operation contains operations on tables, views, and stored procedures, the composite operation message follows a request-response message exchange pattern.

The following table shows the structure of the request and response messages of a composite operation that contains an Insert operation, a stored procedure that does not take any input parameters, and a Delete operation.

Operation XML Message

Composite Operation Request

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<Request xmlns="http://[PROJECT_NAME].[COMPOSITE_SCHEMA_NAME]">
  <Insert xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/[SCHEMA]/[TABLE_NAME]">
    <Rows>
      <[TABLE_NAME]>
        <[FIELD1_NAME]>[Value1]</[FIELD1_NAME]>
        <[FIELD2_NAME]>[Value1]</[FIELD2_NAME]>
        …
      </[TABLE_NAME]>
    </Rows>
  </Insert>
  <[SP_NAME] xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/[SCHEMA]" />
  <Delete xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/[SCHEMA]/[TABLE_NAME]">
    <Rows>
      <[TABLE_NAME]>
        <[FIELD1_NAME]>[Value1]</[FIELD1_NAME]>
      </[TABLE_NAME]>
    </Rows>
  </Delete>
</Request>

Composite Operation Response

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<RequestResponse xmlns="http://[PROJECT_NAME].[COMPOSITE_SCHEMA_NAME]">
  <InsertResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/[SCHEMA]/[TABLE_NAME]">
    <InsertResult>
      <long>[value]</long>
    </InsertResult>
  </InsertResponse>
  <[SP_NAME]Response xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/[SCHEMA]">
    <[SP_NAME]Result>
      <DataSet>
        <any>[Value]</any>
        <any>[Value]</any>
        …
      </DataSet>
    </[SP_NAME]Result>
    <ReturnValue>[value]</ReturnValue>
  </[SP_NAME]Response>
  <DeleteResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/TableOp/[SCHEMA]/[TABLE_NAME]">
    <DeleteResult>[value]</DeleteResult>
  </DeleteResponse>
</RequestResponse>

[PROJECT_NAME] = Name of the BizTalk project that contains the composite operation schema.

[COMPOSITE_SCHEMA_NAME] = Name of the composite operation schema given by the user.

[SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[TABLE_NAME] = Name of the table; for example, Employee.

[FIELD1_NAME] = Table field name; for example, NAME.

[SP_NAME] = The stored procedure to be executed; for example, ADD_EMP_DETAILS.

Message Action for the Composite Operation

The message action for the composite operation is “CompositeOperation.”

See Also

Other Resources

Messages and Message Schemas for BizTalk Adapter for SQL Server


Message Schemas for the ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

The Microsoft BizTalk Adapter for SQL Server exposes the ExecuteNonQuery, ExecuteReader, and ExecuteScalar outbound operations at the root level to execute any arbitrary SQL statements in SQL Server.

For more information about:

  • These operations, see Support for Executing ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations.

  • Performing these operations using the SQL adapter, see Performing ExecuteReader, ExecuteScalar, or ExecuteNonQuery Operations by Using BizTalk Server.

Message Structure for the ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

The messages in these operations follow a request-response message exchange pattern, and the following table shows the structure of these request and response messages.

Operation XML Message Description

ExecuteNonQuery Request

Copy Code
<ExecuteNonQuery xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <Query>[PL/SQL STATEMENT1];[PL/SQL STATEMENT2];…</Query>
</ExecuteNonQuery>

Within the <Query> tag, you can specify multiple PL/SQL statements separated by a semi-colon.

ExecuteNonQuery Response

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<ExecuteNonQueryResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <ExecuteNonQueryResult>[value]</ExecuteNonQueryResult>
</ExecuteNonQueryResponse>

For the UPDATE, INSERT, and DELETE statements, [value] represents the number of rows affected by the PL/SQL statements in the ExecuteNonQuery Request message. For all other types of statements, [value] is -1.

ExecuteReader Request

Copy Code
<ExecuteReader xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <Query>[PL/SQL STATEMENT1];[PL/SQL STATEMENT2];…</Query>
</ExecuteReader>

Within the <Query> tag, you can specify multiple PL/SQL statements separated by a semi-colon.

ExecuteReader Response

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<ExecuteReaderResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <ExecuteReaderResult>
    <DataSet>
      <Any>[value]</Any>
      <Any>[value]</Any>
      …
    </DataSet>
  </ExecuteReaderResult>
</ExecuteReaderResponse>

The result set is the response message of the PL/SQL statements executed in the ExecuteReader Request message, and is returned as an array of DataSet. For information about DataSet, see “DataSet Class” at http://go.microsoft.com/fwlink/?LinkID=196853.

ExecuteScalar Request

Copy Code
<ExecuteScalar xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <Query>[PL/SQL STATEMENT1];[PL/SQL STATEMENT2];…</Query>
</ExecuteScalar>

Within the <Query> tag, you can specify multiple PL/SQL statements separated by a semi-colon.

ExecuteScalar Response

Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<ExecuteScalarResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/">
  <ExecuteScalarResult>[value]</ExecuteScalarResult>
</ExecuteScalarResponse>

The [value] represents the value in the first column of the first row in the result set returned by the PL/SQL statements in the ExecuteScalar Request message.

[PL/SQL STATEMENT] = The entire PL/SQL statement to be executed.

Message Action for the ExecuteNonQuery, ExecuteReader, and ExecuteScalar Operations

The following table shows the message actions that are used by the ExecuteNonQuery, ExecuteReader, and ExecuteScalar operations.

Operation | Action
ExecuteNonQuery Request | GenericOp/ExecuteNonQuery
ExecuteNonQuery Response | GenericOp/ExecuteNonQuery/response
ExecuteReader Request | GenericOp/ExecuteReader
ExecuteReader Response | GenericOp/ExecuteReader/response
ExecuteScalar Request | GenericOp/ExecuteScalar
ExecuteScalar Response | GenericOp/ExecuteScalar/response

See Also

Other Resources

Messages and Message Schemas for BizTalk Adapter for SQL Server


Metadata Node IDs

The Microsoft BizTalk Adapter for SQL Server surfaces SQL Server database artifacts in a hierarchical manner. The following table lists the node types and node IDs for SQL Server database artifacts that the SQL adapter surfaces. The node ID is the absolute path of the node that is used in the IMetadataRetrievalContractBrowse, Search, and GetMetadata methods.

Artifact Display Name Node Type Node ID Example Description

--

CATEGORY

/

/

WCF LOB Adapter SDK root node. Returns all first-level nodes; this includes the ExecuteNonQuery, ExecuteReader, and ExecuteScalar operation nodes and all schema nodes for the outbound operations, and the Polling operation node for the inbound operation.

ExecuteNonQuery

OUTBOUND OPERATION

GenericOp/ExecuteNonQuery

GenericOp/ExecuteNonQuery

ExecuteNonQuery operation node. Returns WSDL for the ExecuteNonQuery operation.

ExecuteReader

OUTBOUND OPERATION

GenericOp/ExecuteReader

GenericOp/ExecuteReader

ExecuteReader operation node. Returns WSDL for the ExecuteReader operation.

ExecuteScalar

OUTBOUND OPERATION

GenericOp/ExecuteScalar

GenericOp/ExecuteScalar

ExecuteScalar operation node. Returns WSDL for the ExecuteScalar operation.

Polling

INBOUND OPERATION

Polling

Polling

Polling operation node. Returns WSDL for the Polling operation.

Notification

INBOUND OPERATION

Notification

Notification

Notification operation node. Returns WSDL for the Notification operation.

Procedures

CATEGORY

Procedures/

Procedures/

Schema procedures node. Returns all procedures for the specified schema.

[DB_PROCEDURE]

OUTBOUND OPERATION

Procedure/[DB_SCHEMA]/[Procedure_Name]

Procedure/dbo/ADD_EMP_DETAILS

Procedure node. Returns the WSDL for the specified procedure.

Tables

CATEGORY

Tables/

Tables/

Schema tables node. Returns all table nodes for the specified schema.

[DB_TABLE]

CATEGORY

-

-

Table node. Returns all operation nodes (Insert, Select, Update, Delete, and Set) for the specified table.

The Set operation is only returned for tables that contain columns with any of the following data type: Varchar(Max), Nvarchar(Max) or Varbinary(Max).

Insert

OUTBOUND OPERATION

TableOp/Insert/[DB_SCHEMA]/[DB_TABLE]

TableOp/Insert/dbo/Employee

Table Insert operation node. Returns WSDL for the Insert operation for the specified table.

Select

OUTBOUND OPERATION

TableOp/Select/[DB_SCHEMA]/[DB_TABLE]

TableOp/Select/dbo/Employee

Table Select operation node. Returns WSDL for the Select operation for the specified table.

Update

OUTBOUND OPERATION

TableOp/Update/[DB_SCHEMA]/[DB_TABLE]

TableOp/Update/dbo/Employee

Table Update operation node. Returns WSDL for the Update operation for the specified table.

Delete

OUTBOUND OPERATION

TableOp/Delete/[DB_SCHEMA]/[DB_TABLE]

TableOp/Delete/dbo/Employee

Table Delete operation node. Returns WSDL for the Delete operation for the specified table.

Set[COLUMN_NAME]

OUTBOUND OPERATION

TableOp/WriteText/[DB_SCHEMA]/[DB_TABLE]/[COLUMN_NAME]

TableOp/WriteText/dbo/Employee/Job_Description

Table Set operation node. Returns WSDL for the Set operation for the specified column in the table. (Only surfaced if the table contains columns with any of the following data type: (Max), Nvarchar(Max) or Varbinary(Max)).

Views

CATEGORY

Views/

Views/

Schema views node. Returns all view nodes for the specified schema.

[DB_VIEW]

CATEGORY

-

-

View node. Returns all operation nodes (Insert, Select, Update, and Delete) for the specified view.

Insert

OUTBOUND OPERATION

ViewOp/Insert/[DB_SCHEMA]/[DB_VIEW]

ViewOp/Insert/dbo/Employee_View

View Insert operation node. Returns WSDL for the Insert operation for the specified view.

Select

OUTBOUND OPERATION

ViewOp/Select/[DB_SCHEMA]/[DB_VIEW]

ViewOp/Select/dbo/Employee_View

View Select operation node. Returns WSDL for the Select operation for the specified view.

Update

OUTBOUND OPERATION

ViewOp/Update/[DB_SCHEMA]/[DB_VIEW]

ViewOp/Update/dbo/Employee_View

View Update operation node. Returns WSDL for the Update operation for the specified view.

Delete

OUTBOUND OPERATION

ViewOp/Delete/[DB_SCHEMA]/[DB_VIEW]

ViewOp/Delete/dbo/Employee_View

View Delete operation node. Returns WSDL for the Delete operation for the specified view.

Scalar Functions

CATEGORY

ScalarFunctions/

ScalarFunctions/

Schema scalar functions node. Returns all scalar functions for the specified schema.

[DB_SCLR_FUNCTION]

OUTBOUND OPERATION

ScalarFunction/[DB_SCHEMA]/[DB_SCLR_FUNCTION]

ScalarFunction/dbo/GET_EMP_ID

Scalar function node. Returns the WSDL for the specified scalar function.

Table Valued Functions

CATEGORY

TableFunctions/

TableFunctions/

Schema table valued functions node. Returns all table valued functions for the specified schema.

[DB_TBL_FUNCTION]

OUTBOUND OPERATION

TableFunction/[DB_SCHEMA]/[DB_TBL_FUNCTION]

TableFunction/dbo/TVF_EMPLOYEE

Table valued function node. Returns the WSDL for the specified table valued function.

[DB_SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[DB_TABLE] = The name of an SQL Server table; for example, Employee.

[DB_VIEW] = The name of an SQL Server view; for example, Employee_View.

[DB_PROCEDURE] = The name of an SQL Server stored procedure; for example, ADD_EMP_DETAILS.

[DB_SCLR_FUNCTION] = The name of an SQL Server scalar function; for example, GET_EMP_ID.

[DB_TBL_FUNCTION] = The name of an SQL Server table valued function; for example, TVF_EMPLOYEE.

Metadata Search and Node IDs

Metadata search is a powerful feature that the WCF LOB Adapter SDK surfaces as part of its MetadataRetrievalContract interface. The SQL adapter uses this feature to support searching on the following SQL Server artifacts. The metadata search scope is restricted to the level immediately under the node at which the search operation is performed. For example, to search for a scalar function, you must be searching under /Scalar Function/[Schema]. Recursive search is not supported.

Artifact | Node ID | Node Type Returned | Description
/ (i.e. Root node) | / | CATEGORY | Return all schema nodes that match the search expression.
[DB_PROCEDURE] | /Procedure/[DB_SCHEMA] | OUTBOUND OPERATION | Return all procedure nodes in the specified schema that match the search expression.
[DB_TABLE] | /Table/[DB_SCHEMA] | CATEGORY | Return all table nodes in the specified schema that match the search expression.
[DB_VIEW] | /View/[DB_SCHEMA] | CATEGORY | Return all view nodes in the specified schema that match the search expression.
[DB_SCLR_FUNCTION] | /ScalarFunction/[DB_SCHEMA] | OUTBOUND OPERATION | Return all scalar function nodes in the specified schema that match the search expression.
[DB_TBL_FUNCTION] | /TableFunction/[DB_SCHEMA] | OUTBOUND OPERATION | Return all table valued function nodes in the specified schema that match the search expression.

[DB_SCHEMA] = Collection of SQL Server artifacts; for example, dbo.

[DB_TABLE] = The name of an SQL Server table; for example, Employee.

[DB_VIEW] = The name of an SQL Server view; for example, Employee_View.

[DB_PROCEDURE] = The name of an SQL Server procedure; for example, ADD_EMP_DETAILS.

[DB_SCLR_FUNCTION] = The name of an SQL Server scalar function; for example, GET_EMP_ID.

[DB_TBL_FUNCTION] = The name of an SQL Server table valued function; for example, TVF_EMPLOYEE.

You can specify search expressions that are compatible with any valid expression that can be used for the SQL Server LIKE operator. For example, to perform a search on the tables contained in a schema, the SQL adapter executes the following SQL: SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLE_NAME LIKE ‘[SEARCH_STR]’.

The following table lists the special characters that the SQL adapter supports in search expressions.

Special Character Interpretation

% (percentage)

Matches zero or more characters.

For example, "A%" matches "A", "AB", "ABC", and so on.

_ (underscore)

Matches exactly 1 character.

For example, "A_" matches "AB", "AC", "AD", and so on.

[ ]

  • Escapes the special meaning of _ and %.

  • Specifies a range or set of characters to be present.

For example:

  • %[%]% matches all names that include a % symbol.

  • [a-f] matches all names that have characters between and including ‘a’ and ‘f’.

  • [abc] matches all names that have characters ‘a’, ‘b’, and ‘c’.

[^]

Specifies a range or set of characters not to be present.

For example:

  • [^a-f] matches all names that do not have characters between and including ‘a’ and ‘f’.

  • [^abc] matches all names that do not have characters ‘a’, ‘b’, and ‘c’.

Metadata Retrieval and Node IDs

The following table summarizes the metadata characteristics returned by SQL adapter.

Artifact Metadata Characteristics

Table or View

  • Table name.

  • Table field names.

  • Table field data types are mapped to simple or complex WSDL types.

  • Table field length is mapped to facet maxLength.

  • Table field primary key constraint is mapped to facet minOccurs = 1.

  • Table field NULL constraint is mapped to facet isNillable = true.

  • Table operations

    • INSERT

    • SELECT

    • UPDATE

    • DELETE

    • SET<Column Name>

Procedure or Function

  • Procedure or function name is mapped to the operation name.

  • Procedure or function parameter names.

  • Procedure or function parameter data types are mapped to WSDL types.

  • Procedure or function parameter direction is mapped to WSDL parameter direction.

  • Procedure parameter or function parameter data type length is mapped to facet maxLength.

  • Procedure or function parameter order is mapped to element sequence.

  • Function return data type is mapped to WSDL type.

  • Function return data type length is mapped to facet maxLength.

For detailed information about the format of the metadata that the SQL adapter exposes for specific artifacts and operations on the SQL Server database, see Messages and Message Schemas for BizTalk Adapter for SQL Server.

See Also

Other Resources

Technical Reference

© 2013 Microsoft Corporation. All rights reserved.


Glossary

The following terms and definitions are used in Microsoft BizTalk Adapter for SQL Server Help.

Microsoft BizTalk Adapter Pack Glossary

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A

Term | Definition
adapter | A WCF-based component that helps exchange messages between applications (for example, a line-of-business system) and BizTalk Server. The adapter consists of design-time components and run-time components for receive and send operations.
adapter client | An application that interacts with a line-of-business (LOB) system through the adapter.

B

Term | Definition
binding | A process by which software components and layers are linked together. When a network component is installed, the binding relationships and dependencies for the components are established. Binding allows components to communicate with each other. In BizTalk Server, an established mapping between an orchestration adapter-agnostic endpoint (port or role link) and physical adapter-specific endpoints (send/receive ports or party).
BizTalk Server | Connects diverse software. BizTalk Server enables you to create and modify process logic that uses that software. BizTalk Server also enables information workers to monitor running processes, interact with trading partners, and perform other business-oriented tasks.

C

Term | Definition
channel | A concrete implementation of a binding element. The binding represents the configuration, and the channel is the implementation associated with that configuration. Therefore, there is a channel associated with each binding element. Channels stack on top of each other to create the concrete implementation of the binding: the channel stack.
connection URI | A string that identifies a resource in a distributed environment. Adapters use a connection Uniform Resource Identifier (URI) that contains the information necessary to establish a connection with the LOB system.
contract | Specifies the collection and structure of messages required to access the operations offered by the service.

D

Term | Definition
data manipulation language (DML) | The subset of SQL statements that is used to retrieve and manipulate data. DML statements typically start with SELECT, INSERT, UPDATE, or DELETE.
design-time experience | Procedures and operations that a developer performs during design time; for example, using the Consume Adapter Service BizTalk Project Add-in to retrieve message schemas.

E

Term | Definition
endpoint address | A network address that identifies the location of a Windows Communication Foundation (WCF) service endpoint. For an adapter, the endpoint address is expressed as a connection Uniform Resource Identifier (URI) that contains location and connection parameters. The adapter can use these to establish a connection to the underlying line-of-business (LOB) system.
Enterprise Single Sign-on system | An SSO database, a master secret server, and one or more Enterprise Single Sign-On (SSO) servers. These servers do the mapping between the Windows and non-Windows credentials, look up the credentials in the SSO database, and are used for administering the SSO system. The SSO database is also used as a configuration store to hold custom configuration data for adapters.
Extensible Markup Language | A markup language designed to describe data. XML tags are not predefined.

G

Term | Definition
GAC | See global assembly cache.
global assembly cache (GAC) | A machine-wide code cache that stores assemblies specifically installed to be shared by many applications on the computer. Applications deployed in the global assembly cache must have a strong name.

H

Term | Definition
Health and Activity Tracking (HAT) | A user interface that enables specified data to be tracked. This interface can be used to monitor the health of the BizTalk Server farm and to track and view specific events and messages.

I

Term | Definition
inbound operation | An operation that is invoked by a line-of-business (LOB) system on the adapter.

M

Term | Definition
metadata | In WCF, refers to a description of the contract exposed by a service. This is known as the service description and is expressed in a WSDL document. The metadata exposed by an adapter describes the (interface to) the operations that it can perform on the underlying LOB system.
Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK | The specifications for building BizTalk adapters using open standards based on Web services.

O

Term | Definition
one-way | A message exchange pattern (MEP) in which the sender sends a message, but no response is returned by the receiver. In BizTalk Server, MEPs are referred to as communication patterns.
outbound operation | An operation that is invoked by the adapter on the line-of-business system (LOB).
output.cs | The default output file created by the ServiceModel Metadata Utility tool (svcutil.exe).

P

Term | Definition
polling | A technique that device drivers use to find out from multiple devices whether they contain data to transmit. The devices are polled one at a time.
proxy | In WCF, refers to a managed-code object that implements the service contract exposed by a service. The WCF service model is based on the use of such proxies. In the WCF service model, the service contract is expressed as a .NET interface.

R

Term | Definition
request-response | A message exchange pattern (MEP) in which the sender sends a request message and expects a response message from the receiver. In BizTalk Server, MEPs are referred to as communication patterns. Depending on the messaging technology and the direction of the request message (inbound or outbound), this pattern is also called request-reply or solicit-response.
run-time experience | Procedures and operations performed by a developer during run time or when deploying a solution; for example, creating a physical port binding from the BizTalk Server Administration console.

S

Term | Definition
schema | The structure for a message. A schema can contain multiple subschema.
ServiceModel Metadata Utility Tool (svcutil.exe) | A command-line utility that is included with WCF. It is used to create service model proxy code from the service description (metadata) that is exposed by a WCF service such as an adapter. For outbound operations, the tool creates a WCF client class and helper code; for inbound operations, the tool creates a WCF service contract and helper code.
Simple Object Access Protocol | See SOAP.
SOAP | A simple, XML-based protocol for exchanging structured and type information in decentralized, distributed environments. WCF is based on the exchange of SOAP messages between clients and services to invoke operations and return results.
SOAP message | A well-formed XML document. It should use the SOAP envelope and SOAP encoding namespaces and include an optional XML declaration, followed by a SOAP envelope (the root element), which is made up of an optional SOAP header and a SOAP message body.
SQL Server Integration Services (SSIS) | A component that is used to import, export, and transform data from different data sources. Previously called data transformation service (DTS).
SSIS | See SQL Server Integration Services.
SSO | See Enterprise Single Sign-on system.
strongly-typed data | A data set or result set that is bound to an underlying object type. Each row in a strongly-typed XML data set is composed of typed, named elements that correspond to fields of the underlying object type.
svcutil.exe | See ServiceModel Metadata Utility Tool.
synonym | An alternative name for a schema-scoped object; introduced in SQL Server 2005.

U

Term | Definition
Uniform Resource Identifier (URI) | See connection URI

W

Term | Definition
WCF | See Windows Communication Foundation
WCF channel model | A programming model that relies on several interfaces and other types. Channels provide a low-level programming model for sending and receiving messages.
WCF client | A client-application construct that exposes the service operations as methods. You can use the Add Adapter Service Reference Visual Studio Plug-in or the ServiceModel Metadata Utility Tool to generate a WCF client class from the metadata exposed by an adapter.
WCF LOB Adapter SDK | See Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK
WCF service contract | A managed-code representation of the service contract. It is expressed as an interface in which classes and methods are attributed to define the service, operation, message, and data contracts used to communicate with a service. You can use the ServiceModel Metadata Utility tool or the Add Adapter Service Reference Visual Studio Plug-in to generate a WCF service contract from the metadata exposed by an adapter. You implement the WCF service contract to receive operations from an LOB system.
WCF service model | A WCF programming model in which a service is represented as a managed code object. The operations exposed by the service are represented as methods with strongly-typed data.
weakly-typed data | A data set or result set that is not bound to an underlying object type. Each row in a weakly-typed XML data set is composed of a collection of generic columns in which attributes describe the name and type of each element.
Web services | A unit of application logic providing data and services to other applications. Applications access XML Web services using standard Web protocols and data formats such as HTTP, XML, and SOAP, independent of how each XML Web service is implemented. XML Web services combine the best aspects of component-based development and the Web, and are a cornerstone of the Microsoft .NET programming model.
Web Services Description Language (WSDL) | An XML-based language that describes a service as a set of endpoints that operate on messages. The WSDL document describes the service contract, operation contracts, message contracts, and data contracts that a client must use to interface with the service.
Windows Communication Foundation (WCF) | A Microsoft service-oriented communication infrastructure. The framework inherently provides clients with a service programming model and a channel programming model for finer control of message exchanges.
WSDL | See Web Services Description Language.

X

Term | Definition
XML | See Extensible Markup Language.
XML Schema definition language (XSD) | A schema language. An XML Schema defines the elements, attributes, and data types that comply with the World Wide Web Consortium (W3C) XML Schema Part 1: Structures Recommendation for the XML Schema Definition Language. The W3C XML Schema Part 2: Datatypes Recommendation is the recommendation for defining data types that are used in XML schemas. The XML Schema definition language enables you to define the structure and data types for XML messages.
XSD | See XML Schema definition language.


Microsoft BizTalk Adapter for SQL Server Developer Reference

This section provides API reference for SQL adapter.


Class Library

Namespaces

Namespace
Microsoft.Adapters.Sql


Microsoft.Adapters.Sql Namespace

Classes

Class | Description
SqlAdapterBinding | Represents the SQL adapter binding.
SqlAdapterBindingCollectionElement | Describes an element of a SQL adapter binding collection.
SqlAdapterBindingConfigurationElement | Desccribes a SQL adapter binding configuration element.
SqlAdapterBindingElement | Describes a SQL adapter binding element.
SqlAdapterBindingElementExtensionElement | Represents the SQL adapter binding.
SqlAdapterConnectionUri | Contains the SQL adapter connection URI.
SqlAdapterInboundTransactionBehavior | Describes the SQL adapter inbound transaction behavior.

Enumerations

Enumeration | Description
InboundOperation | Describes the inbound operation.


InboundOperation Enumeration
[image]

Describes the inbound operation.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As InboundOperation

Syntax

Visual Basic
Public Enumeration InboundOperation
C#
public enum InboundOperation
C++
public enum class InboundOperation
J#
public enum InboundOperation
JScript
public enum InboundOperation

Members

Member name | Description
Notification | Specifies that the inbound operation type is a notification.
Polling | Specifies that the inbound operation is a polling operation.
TypedPolling | Specifies that the inbound operation is a typed polling operation.
XmlPolling | Specifies that the inbound operation is an XML polling operation.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Class
See Also Members
[image]

Represents the SQL adapter binding.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding

Syntax

Visual Basic
Public Class SqlAdapterBinding
    Inherits AdapterBinding
C#
public class SqlAdapterBinding : AdapterBinding
C++
public ref class SqlAdapterBinding : public AdapterBinding
J#
public class SqlAdapterBinding extends AdapterBinding
JScript
public class SqlAdapterBinding extends AdapterBinding

Inheritance Hierarchy

System.Object
System.ServiceModel.Channels.Binding
Microsoft.ServiceModel.Channels.Common.AdapterBinding
Microsoft.Adapters.Sql.SqlAdapterBinding

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Members
See Also Constructors Methods Properties
[image]

Represents the SQL adapter binding.

The following tables list the members exposed by the SqlAdapterBinding type.

Public Constructors

Name | Description
SqlAdapterBinding | Overloaded. Creates a new instance of the SqlAdapterBinding class.
Top

Public Properties

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | AssuresOrderedDelivery | (inherited from AdapterBinding)
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | CloseTimeout | (inherited from Binding)
public property | ConnectionUriType | Overridden. Gets or sets the connection URI type.
public property | DefaultXsdFileNamePrefix | Overridden. Gets or sets the default XSD file name prefix.
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | MessageVersion | (inherited from Binding)
public property | Name | (inherited from Binding)
public property | Namespace | (inherited from Binding)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | OpenTimeout | (inherited from Binding)
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | QueuedDelivery | (inherited from AdapterBinding)
public property | ReceiveTimeout | (inherited from Binding)
public property | Scheme | Overridden. Specifies the scheme name.
public property | SendTimeout | (inherited from Binding)
public property | SupportsCertificateAuthentication | (inherited from AdapterBinding)
public property | SupportsMetadataBrowse | Overridden. Specifies whether the SQL adapter supports metadata browsing.
public property | SupportsMetadataGet | Overridden. Specifies whether the adapter supports the exposing the metadata through a GET request.
public property | SupportsMetadataSearch | Overridden. Specifies whether the adapter supports a metadata serach.
public property | SupportsUserNameAuthentication | (inherited from AdapterBinding)
public property | SupportsWindowsAuthentication | (inherited from AdapterBinding)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | BuildChannelFactory | (inherited from Binding)
public method | BuildChannelFactory | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | CanBuildChannelFactory | (inherited from Binding)
public method | CanBuildChannelFactory | (inherited from Binding)
public method | CanBuildChannelListener | (inherited from Binding)
public method | CanBuildChannelListener | (inherited from Binding)
public method | CreateBindingElements | Overridden. Creates the binding elements.
public method | Equals | (inherited from Object)
public method | GetHashCode | (inherited from Object)
public method | GetProperty | (inherited from Binding)
public method | GetType | (inherited from Object)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)
Top

See Also

Reference

SqlAdapterBinding Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Constructor
[image]

Creates a new instance of the SqlAdapterBinding class.

Overload List

Name | Description
SqlAdapterBinding () | Creates a new instance of the SQLAdapterBinding class, using the default parameters.
SqlAdapterBinding (String) | Creates a new instance of the SQLAdapterBinding class, using the specified configuration name.

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Constructor ()
[image]

Creates a new instance of the SQLAdapterBinding class, using the default parameters.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterBinding

Syntax

Visual Basic
<SuppressMessageAttribute("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId:="dummyInstance")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId:="Microsoft.Adapters.Sql.SqlAdapterBindingElement")> _
Public Sub New
C#
[SuppressMessageAttribute("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId="dummyInstance")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId="Microsoft.Adapters.Sql.SqlAdapterBindingElement")]
public SqlAdapterBinding ()
C++
[SuppressMessageAttribute(L"Microsoft.Performance", L"CA1804:RemoveUnusedLocals", MessageId=L"dummyInstance")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1806:DoNotIgnoreMethodResults", MessageId=L"Microsoft.Adapters.Sql.SqlAdapterBindingElement")]
public:
SqlAdapterBinding ()
J#
/** @attribute SuppressMessageAttribute("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId="dummyInstance") */
/** @attribute SuppressMessageAttribute("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId="Microsoft.Adapters.Sql.SqlAdapterBindingElement") */
public SqlAdapterBinding ()
JScript
SuppressMessageAttribute("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId="dummyInstance")
SuppressMessageAttribute("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId="Microsoft.Adapters.Sql.SqlAdapterBindingElement")
public function SqlAdapterBinding ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Constructor (String)
[image]

Creates a new instance of the SQLAdapterBinding class, using the specified configuration name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim configurationName As String

Dim instance As New SqlAdapterBinding(configurationName)

Syntax

Visual Basic
Public Sub New ( _
    configurationName As String _
)
C#
public SqlAdapterBinding (
    string configurationName
)
C++
public:
SqlAdapterBinding (
    String^ configurationName
)
J#
public SqlAdapterBinding (
    String configurationName
)
JScript
public function SqlAdapterBinding (
    configurationName : String
)

Parameters

configurationName

The configuration name of the service contract to use.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | BuildChannelFactory | (inherited from Binding)
public method | BuildChannelFactory | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | BuildChannelListener | (inherited from Binding)
public method | CanBuildChannelFactory | (inherited from Binding)
public method | CanBuildChannelFactory | (inherited from Binding)
public method | CanBuildChannelListener | (inherited from Binding)
public method | CanBuildChannelListener | (inherited from Binding)
public method | CreateBindingElements | Overridden. Creates the binding elements.
public method | Equals | (inherited from Object)
public method | GetHashCode | (inherited from Object)
public method | GetProperty | (inherited from Binding)
public method | GetType | (inherited from Object)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)

See Also

Reference

SqlAdapterBinding Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.CreateBindingElements Method
[image]

Creates the binding elements.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim returnValue As BindingElementCollection

returnValue = instance.CreateBindingElements

Syntax

Visual Basic
Public Overrides Function CreateBindingElements As BindingElementCollection
C#
public override BindingElementCollection CreateBindingElements ()
C++
public:
virtual BindingElementCollection^ CreateBindingElements () override
J#
public BindingElementCollection CreateBindingElements ()
JScript
public override function CreateBindingElements () : BindingElementCollection

Return Value

Returns a BindingElementCollection containing the binding elements..

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding Properties
[image]

Public Properties

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | AssuresOrderedDelivery | (inherited from AdapterBinding)
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | CloseTimeout | (inherited from Binding)
public property | ConnectionUriType | Overridden. Gets or sets the connection URI type.
public property | DefaultXsdFileNamePrefix | Overridden. Gets or sets the default XSD file name prefix.
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | MessageVersion | (inherited from Binding)
public property | Name | (inherited from Binding)
public property | Namespace | (inherited from Binding)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | OpenTimeout | (inherited from Binding)
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | QueuedDelivery | (inherited from AdapterBinding)
public property | ReceiveTimeout | (inherited from Binding)
public property | Scheme | Overridden. Specifies the scheme name.
public property | SendTimeout | (inherited from Binding)
public property | SupportsCertificateAuthentication | (inherited from AdapterBinding)
public property | SupportsMetadataBrowse | Overridden. Specifies whether the SQL adapter supports metadata browsing.
public property | SupportsMetadataGet | Overridden. Specifies whether the adapter supports the exposing the metadata through a GET request.
public property | SupportsMetadataSearch | Overridden. Specifies whether the adapter supports a metadata serach.
public property | SupportsUserNameAuthentication | (inherited from AdapterBinding)
public property | SupportsWindowsAuthentication | (inherited from AdapterBinding)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.

See Also

Reference

SqlAdapterBinding Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.AcceptCredentialsInUri Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic

  Syntax
Visual Basic

C#

C++

J#

JScript

  Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
  Platforms
Development Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
Target Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
  See Also
Reference
SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.AllowIdentityInsert Property
[image]

Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.AllowIdentityInsert

instance.AllowIdentityInsert = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(False, True)> _
<CategoryAttribute("Miscellaneous")> _
Public Property AllowIdentityInsert As Boolean
C#
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute("Miscellaneous")]
public bool AllowIdentityInsert { get; set; }
C++
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute(L"Miscellaneous")]
public:
virtual property bool AllowIdentityInsert {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_AllowIdentityInsert ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_AllowIdentityInsert (boolean value)
JScript
CompilerGeneratedAttribute
public final function get AllowIdentityInsert () : boolean

CompilerGeneratedAttribute
public final function set AllowIdentityInsert (value : boolean)

Property Value

Returns a Boolean indicating if you can insert values for identity columns. The default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.BatchSize Property
[image]

Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Integer

value = instance.BatchSize

instance.BatchSize = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(False, True)> _
<CategoryAttribute("Buffering")> _
Public Property BatchSize As Integer
C#
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute("Buffering")]
public int BatchSize { get; set; }
C++
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute(L"Buffering")]
public:
virtual property int BatchSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final int get_BatchSize ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_BatchSize (int value)
JScript
CompilerGeneratedAttribute
public final function get BatchSize () : int

CompilerGeneratedAttribute
public final function set BatchSize (value : int)

Property Value

Returns Int32.

Remarks

The default is two.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.ChunkSize Property
[image]

Specifies the buffer size used for Set<clolumn_name> o0eprations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Integer

value = instance.ChunkSize

instance.ChunkSize = value

Syntax

Visual Basic
<CategoryAttribute("Buffering")> _
<BindingPropertyDirectionAttribute(False, True)> _
Public Property ChunkSize As Integer
C#
[CategoryAttribute("Buffering")]
[BindingPropertyDirectionAttribute(false, true)]
public int ChunkSize { get; set; }
C++
[CategoryAttribute(L"Buffering")]
[BindingPropertyDirectionAttribute(false, true)]
public:
virtual property int ChunkSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final int get_ChunkSize ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_ChunkSize (int value)
JScript
CompilerGeneratedAttribute
public final function get ChunkSize () : int

CompilerGeneratedAttribute
public final function set ChunkSize (value : int)

Property Value

Returns a Int32 containing the buffer size.

Remarks

The default is 419304 bytes. A higher value may improve performance, but affects memory consumption.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.ConnectionUriType Property
[image]

Gets or sets the connection URI type.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Type

value = instance.ConnectionUriType

Syntax

Visual Basic
Public Overrides ReadOnly Property ConnectionUriType As Type
C#
public override Type ConnectionUriType { get; }
C++
public:
virtual property Type^ ConnectionUriType {
    Type^ get () override;
}
J#
/** @property */
public Type get_ConnectionUriType ()
JScript
public override function get ConnectionUriType () : Type

Property Value

Returns a Type containing the URI type.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.DefaultXsdFileNamePrefix Property
[image]

Gets or sets the default XSD file name prefix.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.DefaultXsdFileNamePrefix

Syntax

Visual Basic
Public Overrides ReadOnly Property DefaultXsdFileNamePrefix As String
C#
public override string DefaultXsdFileNamePrefix { get; }
C++
public:
virtual property String^ DefaultXsdFileNamePrefix {
    String^ get () override;
}
J#
/** @property */
public String get_DefaultXsdFileNamePrefix ()
JScript
public override function get DefaultXsdFileNamePrefix () : String

Property Value

Returns a String containing the default prefix.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.EnableBizTalkCompatibilityMode Property
[image]

Gets or sets a value indicating if the BizTalk compatibility mode has been set.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.EnableBizTalkCompatibilityMode

instance.EnableBizTalkCompatibilityMode = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, True)> _
<CategoryAttribute("BizTalk")> _
Public Property EnableBizTalkCompatibilityMode As Boolean
C#
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute("BizTalk")]
public bool EnableBizTalkCompatibilityMode { get; set; }
C++
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute(L"BizTalk")]
public:
virtual property bool EnableBizTalkCompatibilityMode {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_EnableBizTalkCompatibilityMode ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_EnableBizTalkCompatibilityMode (boolean value)
JScript
CompilerGeneratedAttribute
public final function get EnableBizTalkCompatibilityMode () : boolean

CompilerGeneratedAttribute
public final function set EnableBizTalkCompatibilityMode (value : boolean)

Property Value

Returns a Boolean indicating if the compatibility mode has been set.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.EnablePerformanceCounters Property
[image]

Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.EnablePerformanceCounters

instance.EnablePerformanceCounters = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, True)> _
<CategoryAttribute("Diagnostics")> _
Public Property EnablePerformanceCounters As Boolean
C#
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute("Diagnostics")]
public bool EnablePerformanceCounters { get; set; }
C++
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute(L"Diagnostics")]
public:
virtual property bool EnablePerformanceCounters {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_EnablePerformanceCounters ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_EnablePerformanceCounters (boolean value)
JScript
CompilerGeneratedAttribute
public final function get EnablePerformanceCounters () : boolean

CompilerGeneratedAttribute
public final function set EnablePerformanceCounters (value : boolean)

Property Value

Returns a Boolean. indicating if the performance counters have been enabled.

Remarks

The default value is false; performance counters are disabled. The LOB latency performance counter measures the total time spent by the SQL adapter in making calls to the SQL server database.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.Encrypt Property
[image]

Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.Encrypt

instance.Encrypt = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property Encrypt As Boolean
C#
[CategoryAttribute("Connection")]
public bool Encrypt { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property bool Encrypt {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_Encrypt ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_Encrypt (boolean value)
JScript
CompilerGeneratedAttribute
public final function get Encrypt () : boolean

CompilerGeneratedAttribute
public final function set Encrypt (value : boolean)

Property Value

Returns a Boolean indicating if SQL server uses SSL encryption; the default value is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.InboundOperationType Property
[image]

Specifies if you want to perform a polling, typed polling, or notification operation.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As InboundOperation

value = instance.InboundOperationType

instance.InboundOperationType = value

Syntax

Visual Basic
<CategoryAttribute("Inbound")> _
<BindingPropertyDirectionAttribute(True, False)> _
Public Property InboundOperationType As InboundOperation
C#
[CategoryAttribute("Inbound")]
[BindingPropertyDirectionAttribute(true, false)]
public InboundOperation InboundOperationType { get; set; }
C++
[CategoryAttribute(L"Inbound")]
[BindingPropertyDirectionAttribute(true, false)]
public:
virtual property InboundOperation InboundOperationType {
    InboundOperation get () sealed;
    void set (InboundOperation value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final InboundOperation get_InboundOperationType ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_InboundOperationType (InboundOperation value)
JScript
CompilerGeneratedAttribute
public final function get InboundOperationType () : InboundOperation

CompilerGeneratedAttribute
public final function set InboundOperationType (value : InboundOperation)

Property Value

Returns a InboundOperation containing the operation type; the default is Polling.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.MaxConnectionPoolSize Property
[image]

Specifies the maximum number of connections allowed in a connection pool for a specific connection string.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Integer

value = instance.MaxConnectionPoolSize

instance.MaxConnectionPoolSize = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property MaxConnectionPoolSize As Integer
C#
[CategoryAttribute("Connection")]
public int MaxConnectionPoolSize { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property int MaxConnectionPoolSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final int get_MaxConnectionPoolSize ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_MaxConnectionPoolSize (int value)
JScript
CompilerGeneratedAttribute
public final function get MaxConnectionPoolSize () : int

CompilerGeneratedAttribute
public final function set MaxConnectionPoolSize (value : int)

Property Value

Returns a Int32 specifying the maximum number of connections; the default is 100.

Remarks

This property is used for performance tuning.

Use this property judiciously. If you set the value too large, you may exhaust the number of connections available.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.NotificationStatement Property
[image]

Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.NotificationStatement

instance.NotificationStatement = value

Syntax

Visual Basic
<CategoryAttribute("Notification (Inbound)")> _
<BindingPropertyDirectionAttribute(True, False)> _
Public Property NotificationStatement As String
C#
[CategoryAttribute("Notification (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
public string NotificationStatement { get; set; }
C++
[CategoryAttribute(L"Notification (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
public:
virtual property String^ NotificationStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_NotificationStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_NotificationStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get NotificationStatement () : String

CompilerGeneratedAttribute
public final function set NotificationStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.NotifyOnListenerStart Property
[image]

Specifies whether the adapter sends a notification message when the listener is started.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.NotifyOnListenerStart

instance.NotifyOnListenerStart = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Notification (Inbound)")> _
Public Property NotifyOnListenerStart As Boolean
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Notification (Inbound)")]
public bool NotifyOnListenerStart { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Notification (Inbound)")]
public:
virtual property bool NotifyOnListenerStart {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_NotifyOnListenerStart ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_NotifyOnListenerStart (boolean value)
JScript
CompilerGeneratedAttribute
public final function get NotifyOnListenerStart () : boolean

CompilerGeneratedAttribute
public final function set NotifyOnListenerStart (value : boolean)

Property Value

Returns a Boolean indicating if the adapter sends the notification message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.PolledDataAvailableStatement Property
[image]

Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.PolledDataAvailableStatement

instance.PolledDataAvailableStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<BindingPropertyDirectionAttribute(True, False)> _
Public Property PolledDataAvailableStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
public string PolledDataAvailableStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
public:
virtual property String^ PolledDataAvailableStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_PolledDataAvailableStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PolledDataAvailableStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get PolledDataAvailableStatement () : String

CompilerGeneratedAttribute
public final function set PolledDataAvailableStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

The specified statement must return a result set consisting of rows and columns. The value in the first cell of the result set indicates whether the adapter executes the SQL statement specified for the PollingStatement binding property. If the first cell of the result contains a positive value, the adapter executed the polling statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.PollingIntervalInSeconds Property
[image]

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Integer

value = instance.PollingIntervalInSeconds

instance.PollingIntervalInSeconds = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollingIntervalInSeconds As Integer
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Polling (Inbound)")]
public int PollingIntervalInSeconds { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property int PollingIntervalInSeconds {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final int get_PollingIntervalInSeconds ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PollingIntervalInSeconds (int value)
JScript
CompilerGeneratedAttribute
public final function get PollingIntervalInSeconds () : int

CompilerGeneratedAttribute
public final function set PollingIntervalInSeconds (value : int)

Property Value

Returns a Int32 containing the interval.

Remarks

The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter is inactive for the remaining time in the interval.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.PollingStatement Property
[image]

Specifies the SQL statement to poll a SQL Server database table.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.PollingStatement

instance.PollingStatement = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollingStatement As String
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Polling (Inbound)")]
public string PollingStatement { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property String^ PollingStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_PollingStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PollingStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get PollingStatement () : String

CompilerGeneratedAttribute
public final function set PollingStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

You can specify a simple SELECT statement or stored procedures for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property.

You can specify any number of SQL statements separated by a semicolon. You can use the polling statement to read or update data in a SQL Server database table. The SQL adapter executes the polling statements inside one transaction. When the adapter is used with BizTalk Server, the same transaction is used to submit messages from SQL Server to the BizTalk message box.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.PollWhileDataFound Property
[image]

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.PollWhileDataFound

instance.PollWhileDataFound = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollWhileDataFound As Boolean
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Polling (Inbound)")]
public bool PollWhileDataFound { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property bool PollWhileDataFound {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_PollWhileDataFound ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PollWhileDataFound (boolean value)
JScript
CompilerGeneratedAttribute
public final function get PollWhileDataFound () : boolean

CompilerGeneratedAttribute
public final function set PollWhileDataFound (value : boolean)

Property Value

Returns a Boolean specifying whether to ignore the polling interval; the default is false.

Remarks

If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval.

Consider a scenario where the polling interval is set to 60 seconds, and the statement specified for PolledDataAvailableStatement returns that data is available for polling. The adapter then executes the statement specified for the PollingStatement binding property. Assuming that the adapter takes just 10 seconds to execute the polling statement, it will now have to wait for 50 seconds before executing the PolledDataAvailableStatement again, and then subsequently execute the polling statement. Instead, to optimize the performance you can set the PollWhileDataFound binding property to true so that the adapter can start executing the next polling cycle as soon as the previous polling cycle ends.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.Scheme Property
[image]

Specifies the scheme name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.Scheme

Syntax

Visual Basic
Public Overrides ReadOnly Property Scheme As String
C#
public override string Scheme { get; }
C++
public:
virtual property String^ Scheme {
    String^ get () override;
}
J#
/** @property */
public String get_Scheme ()
JScript
public override function get Scheme () : String

Property Value

Returns a String containing the scheme name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.SupportsMetadataBrowse Property
[image]

Specifies whether the SQL adapter supports metadata browsing.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.SupportsMetadataBrowse

Syntax

Visual Basic
Public Overrides ReadOnly Property SupportsMetadataBrowse As Boolean
C#
public override bool SupportsMetadataBrowse { get; }
C++
public:
virtual property bool SupportsMetadataBrowse {
    bool get () override;
}
J#
/** @property */
public boolean get_SupportsMetadataBrowse ()
JScript
public override function get SupportsMetadataBrowse () : boolean

Property Value

Returns a Boolean indicating if the adapter supports metadata browsing.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.SupportsMetadataGet Property
[image]

Specifies whether the adapter supports the exposing the metadata through a GET request.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.SupportsMetadataGet

Syntax

Visual Basic
Public Overrides ReadOnly Property SupportsMetadataGet As Boolean
C#
public override bool SupportsMetadataGet { get; }
C++
public:
virtual property bool SupportsMetadataGet {
    bool get () override;
}
J#
/** @property */
public boolean get_SupportsMetadataGet ()
JScript
public override function get SupportsMetadataGet () : boolean

Property Value

Returns a Boolean indicating if the metadata has been exposed to a GET request.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.SupportsMetadataSearch Property
[image]

Specifies whether the adapter supports a metadata serach.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.SupportsMetadataSearch

Syntax

Visual Basic
Public Overrides ReadOnly Property SupportsMetadataSearch As Boolean
C#
public override bool SupportsMetadataSearch { get; }
C++
public:
virtual property bool SupportsMetadataSearch {
    bool get () override;
}
J#
/** @property */
public boolean get_SupportsMetadataSearch ()
JScript
public override function get SupportsMetadataSearch () : boolean

Property Value

Returns a Boolean indicating if the adapter supports a metadata search.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.UseAmbientTransaction Property
[image]

Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.UseAmbientTransaction

instance.UseAmbientTransaction = value

Syntax

Visual Basic
<CategoryAttribute("Transaction")> _
Public Property UseAmbientTransaction As Boolean
C#
[CategoryAttribute("Transaction")]
public bool UseAmbientTransaction { get; set; }
C++
[CategoryAttribute(L"Transaction")]
public:
virtual property bool UseAmbientTransaction {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_UseAmbientTransaction ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_UseAmbientTransaction (boolean value)
JScript
CompilerGeneratedAttribute
public final function get UseAmbientTransaction () : boolean

CompilerGeneratedAttribute
public final function set UseAmbientTransaction (value : boolean)

Property Value

Returns a Boolean indicating whether the SQL adapter performs operations using a transactional context; the default is true.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.UseDatabaseNameInXsdNamespace Property
[image]

Specifies whether the XSD generated for a particular artifact contains the database name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As Boolean

value = instance.UseDatabaseNameInXsdNamespace

instance.UseDatabaseNameInXsdNamespace = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, True)> _
<CategoryAttribute("Metadata")> _
Public Property UseDatabaseNameInXsdNamespace As Boolean
C#
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute("Metadata")]
public bool UseDatabaseNameInXsdNamespace { get; set; }
C++
[BindingPropertyDirectionAttribute(true, true)]
[CategoryAttribute(L"Metadata")]
public:
virtual property bool UseDatabaseNameInXsdNamespace {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_UseDatabaseNameInXsdNamespace ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_UseDatabaseNameInXsdNamespace (boolean value)
JScript
CompilerGeneratedAttribute
public final function get UseDatabaseNameInXsdNamespace () : boolean

CompilerGeneratedAttribute
public final function set UseDatabaseNameInXsdNamespace (value : boolean)

Property Value

Returns a Boolean indicating whether the XSD contains the database name; the default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.WorkstationId Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.WorkstationId

instance.WorkstationId = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property WorkstationId As String
C#
[CategoryAttribute("Connection")]
public string WorkstationId { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property String^ WorkstationId {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_WorkstationId ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_WorkstationId (String value)
JScript
CompilerGeneratedAttribute
public final function get WorkstationId () : String

CompilerGeneratedAttribute
public final function set WorkstationId (value : String)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.XmlStoredProcedureRootNodeName Property
[image]

Specifies the XML root node name of the stored procedures for the database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.XmlStoredProcedureRootNodeName

instance.XmlStoredProcedureRootNodeName = value

Syntax

Visual Basic
<CategoryAttribute("(FOR XML)")> _
Public Property XmlStoredProcedureRootNodeName As String
C#
[CategoryAttribute("(FOR XML)")]
public string XmlStoredProcedureRootNodeName { get; set; }
C++
[CategoryAttribute(L"(FOR XML)")]
public:
virtual property String^ XmlStoredProcedureRootNodeName {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_XmlStoredProcedureRootNodeName ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_XmlStoredProcedureRootNodeName (String value)
JScript
CompilerGeneratedAttribute
public final function get XmlStoredProcedureRootNodeName () : String

CompilerGeneratedAttribute
public final function set XmlStoredProcedureRootNodeName (value : String)

Property Value

Returns a String containing the root node name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBinding.XmlStoredProcedureRootNodeNamespace Property
[image]

Specifies the XML stored procedure root node namespace.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBinding
Dim value As String

value = instance.XmlStoredProcedureRootNodeNamespace

instance.XmlStoredProcedureRootNodeNamespace = value

Syntax

Visual Basic
<CategoryAttribute("(FOR XML)")> _
Public Property XmlStoredProcedureRootNodeNamespace As String
C#
[CategoryAttribute("(FOR XML)")]
public string XmlStoredProcedureRootNodeNamespace { get; set; }
C++
[CategoryAttribute(L"(FOR XML)")]
public:
virtual property String^ XmlStoredProcedureRootNodeNamespace {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_XmlStoredProcedureRootNodeNamespace ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_XmlStoredProcedureRootNodeNamespace (String value)
JScript
CompilerGeneratedAttribute
public final function get XmlStoredProcedureRootNodeNamespace () : String

CompilerGeneratedAttribute
public final function set XmlStoredProcedureRootNodeNamespace (value : String)

Property Value

Returns a String containing the namespace name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBinding Class
SqlAdapterBinding Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingCollectionElement Class
See Also Members
[image]

Describes an element of a SQL adapter binding collection.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingCollectionElement

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterBindingCollectionElement
    Inherits StandardBindingCollectionElement(Of SqlAdapterBinding, SqlAdapterBindingConfigurationElement)
C#
public sealed class SqlAdapterBindingCollectionElement : StandardBindingCollectionElement<SqlAdapterBinding,SqlAdapterBindingConfigurationElement>
C++
public ref class SqlAdapterBindingCollectionElement sealed : public StandardBindingCollectionElement<SqlAdapterBinding^, SqlAdapterBindingConfigurationElement^>
J#
public final class SqlAdapterBindingCollectionElement extends StandardBindingCollectionElement<SqlAdapterBinding,SqlAdapterBindingConfigurationElement>
JScript
public final class SqlAdapterBindingCollectionElement extends StandardBindingCollectionElement<SqlAdapterBinding,SqlAdapterBindingConfigurationElement>

Inheritance Hierarchy

System.Object
System.Configuration.ConfigurationElement
System.ServiceModel.Configuration.BindingCollectionElement
System.ServiceModel.Configuration.StandardBindingCollectionElement
Microsoft.Adapters.Sql.SqlAdapterBindingCollectionElement

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingCollectionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingCollectionElement Members
See Also Constructors Methods Properties
[image]

Describes an element of a SQL adapter binding collection.

The following tables list the members exposed by the SqlAdapterBindingCollectionElement type.

Public Constructors

Name | Description
SqlAdapterBindingCollectionElement | creates a new instance of the SQLAdapterBindingCollectionElement class.
Top

Public Properties (see also Protected Properties)

 | Name | Description
public property | BindingName | (inherited from BindingCollectionElement)
public property | Bindings | (inherited from StandardBindingCollectionElement)
public property | BindingType | Overridden. (inherited from BindingCollectionElement)
public property | ConfiguredBindings | Overridden. (inherited from BindingCollectionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
Top

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)
protected property | Properties | Overridden. (inherited from ConfigurationElement)
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | ContainsKey | Overridden. (inherited from BindingCollectionElement)
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)
Top

See Also

Reference

SqlAdapterBindingCollectionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingCollectionElement Constructor
[image]

creates a new instance of the SQLAdapterBindingCollectionElement class.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterBindingCollectionElement

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterBindingCollectionElement ()
C++
public:
SqlAdapterBindingCollectionElement ()
J#
public SqlAdapterBindingCollectionElement ()
JScript
public function SqlAdapterBindingCollectionElement ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingCollectionElement Class
SqlAdapterBindingCollectionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingCollectionElement Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | ContainsKey | Overridden. (inherited from BindingCollectionElement)
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingCollectionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingCollectionElement Properties
[image]

Public Properties (see also Protected Properties)

 | Name | Description
public property | BindingName | (inherited from BindingCollectionElement)
public property | Bindings | (inherited from StandardBindingCollectionElement)
public property | BindingType | Overridden. (inherited from BindingCollectionElement)
public property | ConfiguredBindings | Overridden. (inherited from BindingCollectionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)
protected property | Properties | Overridden. (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingCollectionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement Class
See Also Members
[image]

Desccribes a SQL adapter binding configuration element.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterBindingConfigurationElement
    Inherits StandardBindingElement
C#
public sealed class SqlAdapterBindingConfigurationElement : StandardBindingElement
C++
public ref class SqlAdapterBindingConfigurationElement sealed : public StandardBindingElement
J#
public final class SqlAdapterBindingConfigurationElement extends StandardBindingElement
JScript
public final class SqlAdapterBindingConfigurationElement extends StandardBindingElement

Inheritance Hierarchy

System.Object
System.Configuration.ConfigurationElement
System.ServiceModel.Configuration.StandardBindingElement
Microsoft.Adapters.Sql.SqlAdapterBindingConfigurationElement

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement Members
See Also Constructors Methods Properties
[image]

Desccribes a SQL adapter binding configuration element.

The following tables list the members exposed by the SqlAdapterBindingConfigurationElement type.

Public Constructors

Name | Description
SqlAdapterBindingConfigurationElement | Creates a new instance of the SqlAdapterBindingConfigurationElement class.
Top

Public Properties (see also Protected Properties)

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Specifies whether the adapter can insert values for identity columns during Insert and Update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize |
public property | CloseTimeout | (inherited from StandardBindingElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | Name | (inherited from StandardBindingElement)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | OpenTimeout | (inherited from StandardBindingElement)
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | ReceiveTimeout | (inherited from StandardBindingElement)
public property | SendTimeout | (inherited from StandardBindingElement)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.
Top

Protected Properties

 | Name | Description
protected property | BindingElementType | (inherited from StandardBindingElement)
protected property | EvaluationContext | (inherited from ConfigurationElement)
protected property | Properties | Overridden. (inherited from ConfigurationElement)
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | ApplyConfiguration | (inherited from StandardBindingElement)
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnApplyConfiguration | (inherited from StandardBindingElement)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)
Top

See Also

Reference

SqlAdapterBindingConfigurationElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement Constructor
[image]

Creates a new instance of the SqlAdapterBindingConfigurationElement class.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterBindingConfigurationElement

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterBindingConfigurationElement ()
C++
public:
SqlAdapterBindingConfigurationElement ()
J#
public SqlAdapterBindingConfigurationElement ()
JScript
public function SqlAdapterBindingConfigurationElement ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | ApplyConfiguration | (inherited from StandardBindingElement)
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnApplyConfiguration | (inherited from StandardBindingElement)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingConfigurationElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement Properties
[image]

Public Properties (see also Protected Properties)

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Specifies whether the adapter can insert values for identity columns during Insert and Update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize |
public property | CloseTimeout | (inherited from StandardBindingElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | Name | (inherited from StandardBindingElement)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | OpenTimeout | (inherited from StandardBindingElement)
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | ReceiveTimeout | (inherited from StandardBindingElement)
public property | SendTimeout | (inherited from StandardBindingElement)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.

Protected Properties

 | Name | Description
protected property | BindingElementType | (inherited from StandardBindingElement)
protected property | EvaluationContext | (inherited from ConfigurationElement)
protected property | Properties | Overridden. (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingConfigurationElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.AcceptCredentialsInUri Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic

  Syntax
Visual Basic

C#

C++

J#

JScript

  Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
  Platforms
Development Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
Target Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
  See Also
Reference
SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.AllowIdentityInsert Property
[image]

Specifies whether the adapter can insert values for identity columns during Insert and Update operations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.AllowIdentityInsert

instance.AllowIdentityInsert = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("allowIdentityInsert", DefaultValue:=False)> _
<CategoryAttribute("Miscellaneous")> _
<BindingPropertyDirectionAttribute(False, True)> _
Public Property AllowIdentityInsert As Boolean
C#
[ConfigurationPropertyAttribute("allowIdentityInsert", DefaultValue=false)]
[CategoryAttribute("Miscellaneous")]
[BindingPropertyDirectionAttribute(false, true)]
public bool AllowIdentityInsert { get; set; }
C++
[ConfigurationPropertyAttribute(L"allowIdentityInsert", DefaultValue=false)]
[CategoryAttribute(L"Miscellaneous")]
[BindingPropertyDirectionAttribute(false, true)]
public:
virtual property bool AllowIdentityInsert {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_AllowIdentityInsert ()

/** @property */
public final void set_AllowIdentityInsert (boolean value)
JScript
public final function get AllowIdentityInsert () : boolean

public final function set AllowIdentityInsert (value : boolean)

Property Value

Returns a Boolean indicating if you can insert values for identity columns. The default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.BatchSize Property
[image]

Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Integer

value = instance.BatchSize

instance.BatchSize = value

Syntax

Visual Basic
<CategoryAttribute("Buffering")> _
<ConfigurationPropertyAttribute("batchSize", DefaultValue:=20)> _
<BindingPropertyDirectionAttribute(False, True)> _
Public Property BatchSize As Integer
C#
[CategoryAttribute("Buffering")]
[ConfigurationPropertyAttribute("batchSize", DefaultValue=20)]
[BindingPropertyDirectionAttribute(false, true)]
public int BatchSize { get; set; }
C++
[CategoryAttribute(L"Buffering")]
[ConfigurationPropertyAttribute(L"batchSize", DefaultValue=20)]
[BindingPropertyDirectionAttribute(false, true)]
public:
virtual property int BatchSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_BatchSize ()

/** @property */
public final void set_BatchSize (int value)
JScript
public final function get BatchSize () : int

public final function set BatchSize (value : int)

Property Value

Returns a Int32 indicating the batch size.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.ChunkSize Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Integer

value = instance.ChunkSize

instance.ChunkSize = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("chunkSize", DefaultValue:=4194304)> _
<BindingPropertyDirectionAttribute(False, True)> _
<CategoryAttribute("Buffering")> _
Public Property ChunkSize As Integer
C#
[ConfigurationPropertyAttribute("chunkSize", DefaultValue=4194304)]
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute("Buffering")]
public int ChunkSize { get; set; }
C++
[ConfigurationPropertyAttribute(L"chunkSize", DefaultValue=4194304)]
[BindingPropertyDirectionAttribute(false, true)]
[CategoryAttribute(L"Buffering")]
public:
virtual property int ChunkSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_ChunkSize ()

/** @property */
public final void set_ChunkSize (int value)
JScript
public final function get ChunkSize () : int

public final function set ChunkSize (value : int)

Property Value

Returns Int32.

Remarks

The default is two.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.EnableBizTalkCompatibilityMode Property
[image]

Gets or sets a value indicating if the BizTalk compatibility mode has been set.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.EnableBizTalkCompatibilityMode

instance.EnableBizTalkCompatibilityMode = value

Syntax

Visual Basic
<CategoryAttribute("BizTalk")> _
<ConfigurationPropertyAttribute("enableBizTalkCompatibilityMode", DefaultValue:=True)> _
Public Property EnableBizTalkCompatibilityMode As Boolean
C#
[CategoryAttribute("BizTalk")]
[ConfigurationPropertyAttribute("enableBizTalkCompatibilityMode", DefaultValue=true)]
public bool EnableBizTalkCompatibilityMode { get; set; }
C++
[CategoryAttribute(L"BizTalk")]
[ConfigurationPropertyAttribute(L"enableBizTalkCompatibilityMode", DefaultValue=true)]
public:
virtual property bool EnableBizTalkCompatibilityMode {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnableBizTalkCompatibilityMode ()

/** @property */
public final void set_EnableBizTalkCompatibilityMode (boolean value)
JScript
public final function get EnableBizTalkCompatibilityMode () : boolean

public final function set EnableBizTalkCompatibilityMode (value : boolean)

Property Value

Returns a Boolean indicating if the compatibility mode has been set.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.EnablePerformanceCounters Property
[image]

Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.EnablePerformanceCounters

instance.EnablePerformanceCounters = value

Syntax

Visual Basic
<CategoryAttribute("Diagnostics")> _
<ConfigurationPropertyAttribute("enablePerformanceCounters", DefaultValue:=False)> _
Public Property EnablePerformanceCounters As Boolean
C#
[CategoryAttribute("Diagnostics")]
[ConfigurationPropertyAttribute("enablePerformanceCounters", DefaultValue=false)]
public bool EnablePerformanceCounters { get; set; }
C++
[CategoryAttribute(L"Diagnostics")]
[ConfigurationPropertyAttribute(L"enablePerformanceCounters", DefaultValue=false)]
public:
virtual property bool EnablePerformanceCounters {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnablePerformanceCounters ()

/** @property */
public final void set_EnablePerformanceCounters (boolean value)
JScript
public final function get EnablePerformanceCounters () : boolean

public final function set EnablePerformanceCounters (value : boolean)

Property Value

Returns a Boolean. indicating if the performance counters have been enabled.

Remarks

The default value is false; performance counters are disabled. The LOB latency performance counter measures the total time spent by the SQL adapter in making calls to the SQL server database.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.Encrypt Property
[image]

Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.Encrypt

instance.Encrypt = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("encrypt", DefaultValue:=False)> _
<CategoryAttribute("Connection")> _
Public Property Encrypt As Boolean
C#
[ConfigurationPropertyAttribute("encrypt", DefaultValue=false)]
[CategoryAttribute("Connection")]
public bool Encrypt { get; set; }
C++
[ConfigurationPropertyAttribute(L"encrypt", DefaultValue=false)]
[CategoryAttribute(L"Connection")]
public:
virtual property bool Encrypt {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_Encrypt ()

/** @property */
public final void set_Encrypt (boolean value)
JScript
public final function get Encrypt () : boolean

public final function set Encrypt (value : boolean)

Property Value

Returns a Boolean indicating if SQL server uses SSL encryption; the default value is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.InboundOperationType Property
[image]

Specifies if you want to perform a polling, typed polling, or notification operation.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As InboundOperation

value = instance.InboundOperationType

instance.InboundOperationType = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<ConfigurationPropertyAttribute("inboundOperationType", DefaultValue:=InboundOperation.Polling)> _
<CategoryAttribute("Inbound")> _
Public Property InboundOperationType As InboundOperation
C#
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute("inboundOperationType", DefaultValue=InboundOperation.Polling)]
[CategoryAttribute("Inbound")]
public InboundOperation InboundOperationType { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute(L"inboundOperationType", DefaultValue=InboundOperation::Polling)]
[CategoryAttribute(L"Inbound")]
public:
virtual property InboundOperation InboundOperationType {
    InboundOperation get () sealed;
    void set (InboundOperation value) sealed;
}
J#
/** @property */
public final InboundOperation get_InboundOperationType ()

/** @property */
public final void set_InboundOperationType (InboundOperation value)
JScript
public final function get InboundOperationType () : InboundOperation

public final function set InboundOperationType (value : InboundOperation)

Property Value

Returns a InboundOperation containing the operation type; the default is Polling.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.MaxConnectionPoolSize Property
[image]

Specifies the maximum number of connections allowed in a connection pool for a specific connection string.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Integer

value = instance.MaxConnectionPoolSize

instance.MaxConnectionPoolSize = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
<ConfigurationPropertyAttribute("maxConnectionPoolSize", DefaultValue:=100)> _
Public Property MaxConnectionPoolSize As Integer
C#
[CategoryAttribute("Connection")]
[ConfigurationPropertyAttribute("maxConnectionPoolSize", DefaultValue=100)]
public int MaxConnectionPoolSize { get; set; }
C++
[CategoryAttribute(L"Connection")]
[ConfigurationPropertyAttribute(L"maxConnectionPoolSize", DefaultValue=100)]
public:
virtual property int MaxConnectionPoolSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_MaxConnectionPoolSize ()

/** @property */
public final void set_MaxConnectionPoolSize (int value)
JScript
public final function get MaxConnectionPoolSize () : int

public final function set MaxConnectionPoolSize (value : int)

Property Value

Returns a Int32 specifying the maximum number of connections; the default is 100.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.NotificationStatement Property
[image]

Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.NotificationStatement

instance.NotificationStatement = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Notification (Inbound)")> _
<ConfigurationPropertyAttribute("notificationStatement", DefaultValue:="")> _
Public Property NotificationStatement As String
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Notification (Inbound)")]
[ConfigurationPropertyAttribute("notificationStatement", DefaultValue="")]
public string NotificationStatement { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Notification (Inbound)")]
[ConfigurationPropertyAttribute(L"notificationStatement", DefaultValue=L"")]
public:
virtual property String^ NotificationStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_NotificationStatement ()

/** @property */
public final void set_NotificationStatement (String value)
JScript
public final function get NotificationStatement () : String

public final function set NotificationStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.NotifyOnListenerStart Property
[image]

Specifies whether the adapter sends a notification message when the listener is started.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.NotifyOnListenerStart

instance.NotifyOnListenerStart = value

Syntax

Visual Basic
<CategoryAttribute("Notification (Inbound)")> _
<BindingPropertyDirectionAttribute(True, False)> _
<ConfigurationPropertyAttribute("notifyOnListenerStart", DefaultValue:=True)> _
Public Property NotifyOnListenerStart As Boolean
C#
[CategoryAttribute("Notification (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute("notifyOnListenerStart", DefaultValue=true)]
public bool NotifyOnListenerStart { get; set; }
C++
[CategoryAttribute(L"Notification (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute(L"notifyOnListenerStart", DefaultValue=true)]
public:
virtual property bool NotifyOnListenerStart {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_NotifyOnListenerStart ()

/** @property */
public final void set_NotifyOnListenerStart (boolean value)
JScript
public final function get NotifyOnListenerStart () : boolean

public final function set NotifyOnListenerStart (value : boolean)

Property Value

Returns a Boolean indicating if the adapter sends the notification message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.PolledDataAvailableStatement Property
[image]

Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.PolledDataAvailableStatement

instance.PolledDataAvailableStatement = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<CategoryAttribute("Polling (Inbound)")> _
<ConfigurationPropertyAttribute("polledDataAvailableStatement", DefaultValue:="")> _
Public Property PolledDataAvailableStatement As String
C#
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute("Polling (Inbound)")]
[ConfigurationPropertyAttribute("polledDataAvailableStatement", DefaultValue="")]
public string PolledDataAvailableStatement { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[CategoryAttribute(L"Polling (Inbound)")]
[ConfigurationPropertyAttribute(L"polledDataAvailableStatement", DefaultValue=L"")]
public:
virtual property String^ PolledDataAvailableStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_PolledDataAvailableStatement ()

/** @property */
public final void set_PolledDataAvailableStatement (String value)
JScript
public final function get PolledDataAvailableStatement () : String

public final function set PolledDataAvailableStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

The specified statement must return a result set consisting of rows and columns. The value in the first cell of the result set indicates whether the adapter executes the SQL statement specified for the PollingStatement binding property. If the first cell of the result contains a positive value, the adapter executed the polling statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.PollingIntervalInSeconds Property
[image]

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Integer

value = instance.PollingIntervalInSeconds

instance.PollingIntervalInSeconds = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<BindingPropertyDirectionAttribute(True, False)> _
<ConfigurationPropertyAttribute("pollingIntervalInSeconds", DefaultValue:=30)> _
Public Property PollingIntervalInSeconds As Integer
C#
[CategoryAttribute("Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute("pollingIntervalInSeconds", DefaultValue=30)]
public int PollingIntervalInSeconds { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute(L"pollingIntervalInSeconds", DefaultValue=30)]
public:
virtual property int PollingIntervalInSeconds {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_PollingIntervalInSeconds ()

/** @property */
public final void set_PollingIntervalInSeconds (int value)
JScript
public final function get PollingIntervalInSeconds () : int

public final function set PollingIntervalInSeconds (value : int)

Property Value

Returns a Int32 containing the interval.

Remarks

The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter is inactive for the remaining time in the interval.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.PollingStatement Property
[image]

Specifies the SQL statement to poll a SQL Server database table.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.PollingStatement

instance.PollingStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<BindingPropertyDirectionAttribute(True, False)> _
<ConfigurationPropertyAttribute("pollingStatement", DefaultValue:="")> _
Public Property PollingStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute("pollingStatement", DefaultValue="")]
public string PollingStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute(L"pollingStatement", DefaultValue=L"")]
public:
virtual property String^ PollingStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_PollingStatement ()

/** @property */
public final void set_PollingStatement (String value)
JScript
public final function get PollingStatement () : String

public final function set PollingStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

You can specify a simple SELECT statement or stored procedures for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property.

You can specify any number of SQL statements separated by a semicolon. You can use the polling statement to read or update data in a SQL Server database table. The SQL adapter executes the polling statements inside one transaction. When the adapter is used with BizTalk Server, the same transaction is used to submit messages from SQL Server to the BizTalk message box.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.PollWhileDataFound Property
[image]

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.PollWhileDataFound

instance.PollWhileDataFound = value

Syntax

Visual Basic
<BindingPropertyDirectionAttribute(True, False)> _
<ConfigurationPropertyAttribute("pollWhileDataFound", DefaultValue:=False)> _
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollWhileDataFound As Boolean
C#
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute("pollWhileDataFound", DefaultValue=false)]
[CategoryAttribute("Polling (Inbound)")]
public bool PollWhileDataFound { get; set; }
C++
[BindingPropertyDirectionAttribute(true, false)]
[ConfigurationPropertyAttribute(L"pollWhileDataFound", DefaultValue=false)]
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property bool PollWhileDataFound {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_PollWhileDataFound ()

/** @property */
public final void set_PollWhileDataFound (boolean value)
JScript
public final function get PollWhileDataFound () : boolean

public final function set PollWhileDataFound (value : boolean)

Property Value

Returns a Boolean specifying whether to ignore the polling interval; the default is false.

Remarks

If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval.

Consider a scenario where the polling interval is set to 60 seconds, and the statement specified for PolledDataAvailableStatement returns that data is available for polling. The adapter then executes the statement specified for the PollingStatement binding property. Assuming that the adapter takes just 10 seconds to execute the polling statement, it will now have to wait for 50 seconds before executing the PolledDataAvailableStatement again, and then subsequently execute the polling statement. Instead, to optimize the performance you can set the PollWhileDataFound binding property to true so that the adapter can start executing the next polling cycle as soon as the previous polling cycle ends.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.UseAmbientTransaction Property
[image]

Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.UseAmbientTransaction

instance.UseAmbientTransaction = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("useAmbientTransaction", DefaultValue:=True)> _
<CategoryAttribute("Transaction")> _
Public Property UseAmbientTransaction As Boolean
C#
[ConfigurationPropertyAttribute("useAmbientTransaction", DefaultValue=true)]
[CategoryAttribute("Transaction")]
public bool UseAmbientTransaction { get; set; }
C++
[ConfigurationPropertyAttribute(L"useAmbientTransaction", DefaultValue=true)]
[CategoryAttribute(L"Transaction")]
public:
virtual property bool UseAmbientTransaction {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_UseAmbientTransaction ()

/** @property */
public final void set_UseAmbientTransaction (boolean value)
JScript
public final function get UseAmbientTransaction () : boolean

public final function set UseAmbientTransaction (value : boolean)

Property Value

Returns a Boolean indicating whether the SQL adapter performs operations using a transactional context; the default is true.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.UseDatabaseNameInXsdNamespace Property
[image]

Specifies whether the XSD generated for a particular artifact contains the database name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As Boolean

value = instance.UseDatabaseNameInXsdNamespace

instance.UseDatabaseNameInXsdNamespace = value

Syntax

Visual Basic
<CategoryAttribute("Metadata")> _
<ConfigurationPropertyAttribute("useDatabaseNameInXsdNamespace", DefaultValue:=False)> _
Public Property UseDatabaseNameInXsdNamespace As Boolean
C#
[CategoryAttribute("Metadata")]
[ConfigurationPropertyAttribute("useDatabaseNameInXsdNamespace", DefaultValue=false)]
public bool UseDatabaseNameInXsdNamespace { get; set; }
C++
[CategoryAttribute(L"Metadata")]
[ConfigurationPropertyAttribute(L"useDatabaseNameInXsdNamespace", DefaultValue=false)]
public:
virtual property bool UseDatabaseNameInXsdNamespace {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_UseDatabaseNameInXsdNamespace ()

/** @property */
public final void set_UseDatabaseNameInXsdNamespace (boolean value)
JScript
public final function get UseDatabaseNameInXsdNamespace () : boolean

public final function set UseDatabaseNameInXsdNamespace (value : boolean)

Property Value

Returns a Boolean indicating whether the XSD contains the database name; the default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.WorkstationId Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.WorkstationId

instance.WorkstationId = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
<ConfigurationPropertyAttribute("workstationId", DefaultValue:="")> _
Public Property WorkstationId As String
C#
[CategoryAttribute("Connection")]
[ConfigurationPropertyAttribute("workstationId", DefaultValue="")]
public string WorkstationId { get; set; }
C++
[CategoryAttribute(L"Connection")]
[ConfigurationPropertyAttribute(L"workstationId", DefaultValue=L"")]
public:
virtual property String^ WorkstationId {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_WorkstationId ()

/** @property */
public final void set_WorkstationId (String value)
JScript
public final function get WorkstationId () : String

public final function set WorkstationId (value : String)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.XmlStoredProcedureRootNodeName Property
[image]

Specifies the XML root node name of the stored procedures for the database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeName

instance.XmlStoredProcedureRootNodeName = value

Syntax

Visual Basic
<CategoryAttribute("(FOR XML)")> _
<ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeName", DefaultValue:="")> _
Public Property XmlStoredProcedureRootNodeName As String
C#
[CategoryAttribute("(FOR XML)")]
[ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeName", DefaultValue="")]
public string XmlStoredProcedureRootNodeName { get; set; }
C++
[CategoryAttribute(L"(FOR XML)")]
[ConfigurationPropertyAttribute(L"xmlStoredProcedureRootNodeName", DefaultValue=L"")]
public:
virtual property String^ XmlStoredProcedureRootNodeName {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_XmlStoredProcedureRootNodeName ()

/** @property */
public final void set_XmlStoredProcedureRootNodeName (String value)
JScript
public final function get XmlStoredProcedureRootNodeName () : String

public final function set XmlStoredProcedureRootNodeName (value : String)

Property Value

Returns a String containing the root node name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingConfigurationElement.XmlStoredProcedureRootNodeNamespace Property
[image]

Specifies the XML stored procedure root node namespace.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingConfigurationElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeNamespace

instance.XmlStoredProcedureRootNodeNamespace = value

Syntax

Visual Basic
<CategoryAttribute("(FOR XML)")> _
<ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeNamespace", DefaultValue:="")> _
Public Property XmlStoredProcedureRootNodeNamespace As String
C#
[CategoryAttribute("(FOR XML)")]
[ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeNamespace", DefaultValue="")]
public string XmlStoredProcedureRootNodeNamespace { get; set; }
C++
[CategoryAttribute(L"(FOR XML)")]
[ConfigurationPropertyAttribute(L"xmlStoredProcedureRootNodeNamespace", DefaultValue=L"")]
public:
virtual property String^ XmlStoredProcedureRootNodeNamespace {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_XmlStoredProcedureRootNodeNamespace ()

/** @property */
public final void set_XmlStoredProcedureRootNodeNamespace (String value)
JScript
public final function get XmlStoredProcedureRootNodeNamespace () : String

public final function set XmlStoredProcedureRootNodeNamespace (value : String)

Property Value

Returns a String containing the namespace name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingConfigurationElement Class
SqlAdapterBindingConfigurationElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Class
See Also Members
[image]

Describes a SQL adapter binding element.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterBindingElement
    Inherits CommonAdapter
C#
public sealed class SqlAdapterBindingElement : CommonAdapter
C++
public ref class SqlAdapterBindingElement sealed : public CommonAdapter
J#
public final class SqlAdapterBindingElement extends CommonAdapter
JScript
public final class SqlAdapterBindingElement extends CommonAdapter

Inheritance Hierarchy

System.Object
System.ServiceModel.Channels.BindingElement
System.ServiceModel.Channels.TransportBindingElement
Microsoft.ServiceModel.Channels.Common.Adapter
Microsoft.Adapters.AdapterUtilities.CommonAdapter
Microsoft.Adapters.Sql.SqlAdapterBindingElement

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Members
See Also Constructors Methods Properties
[image]

Describes a SQL adapter binding element.

The following tables list the members exposed by the SqlAdapterBindingElement type.

Public Constructors

Name | Description
SqlAdapterBindingElement | Overloaded. Creates a new instance of the SqlAdapterBindingElement class.
Top

Public Properties

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | ManualAddressing | (inherited from TransportBindingElement)
public property | MaxBufferPoolSize | (inherited from TransportBindingElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | MaxReceivedMessageSize | (inherited from TransportBindingElement)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | Scheme | Overridden. Specifies the scheme name.
public property | TransactedReceiveEnabled | (inherited from Adapter)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | BuildChannelFactory | Overridden. (inherited from BindingElement)
public method | BuildChannelListener | Overridden. (inherited from BindingElement)
public method | CanBuildChannelFactory | Overridden. (inherited from BindingElement)
public method | CanBuildChannelListener | Overridden. (inherited from BindingElement)
public method | Clone | Overridden. (inherited from BindingElement)
public method | Equals | (inherited from Object)
public method | GetHashCode | (inherited from Object)
public method | GetProperty | Overridden. (inherited from BindingElement)
public method | GetType | (inherited from Object)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | CloneAdapter | (inherited from Adapter)
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)
Top

See Also

Reference

SqlAdapterBindingElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Constructor
[image]

Creates a new instance of the SqlAdapterBindingElement class.

Overload List

Name | Description
SqlAdapterBindingElement () | Creates a new instance of the SqlAdapterBindingElement class, using the default values.
SqlAdapterBindingElement (SqlAdapterBindingElement) | Creates a new instance of the SqlAdapterBindingElement class, using the values from the specified adapter.

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Constructor ()
[image]

Creates a new instance of the SqlAdapterBindingElement class, using the default values.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterBindingElement

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterBindingElement ()
C++
public:
SqlAdapterBindingElement ()
J#
public SqlAdapterBindingElement ()
JScript
public function SqlAdapterBindingElement ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Constructor (SqlAdapterBindingElement)
[image]

Creates a new instance of the SqlAdapterBindingElement class, using the values from the specified adapter.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim adapterToBeCloned As SqlAdapterBindingElement

Dim instance As New SqlAdapterBindingElement(adapterToBeCloned)

Syntax

Visual Basic
Public Sub New ( _
    adapterToBeCloned As SqlAdapterBindingElement _
)
C#
public SqlAdapterBindingElement (
    SqlAdapterBindingElement adapterToBeCloned
)
C++
public:
SqlAdapterBindingElement (
    SqlAdapterBindingElement^ adapterToBeCloned
)
J#
public SqlAdapterBindingElement (
    SqlAdapterBindingElement adapterToBeCloned
)
JScript
public function SqlAdapterBindingElement (
    adapterToBeCloned : SqlAdapterBindingElement
)

Parameters

adapterToBeCloned

The adapter to clone.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | BuildChannelFactory | Overridden. (inherited from BindingElement)
public method | BuildChannelListener | Overridden. (inherited from BindingElement)
public method | CanBuildChannelFactory | Overridden. (inherited from BindingElement)
public method | CanBuildChannelListener | Overridden. (inherited from BindingElement)
public method | Clone | Overridden. (inherited from BindingElement)
public method | Equals | (inherited from Object)
public method | GetHashCode | (inherited from Object)
public method | GetProperty | Overridden. (inherited from BindingElement)
public method | GetType | (inherited from Object)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | CloneAdapter | (inherited from Adapter)
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)

See Also

Reference

SqlAdapterBindingElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement Properties
[image]

Public Properties

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | ManualAddressing | (inherited from TransportBindingElement)
public property | MaxBufferPoolSize | (inherited from TransportBindingElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | MaxReceivedMessageSize | (inherited from TransportBindingElement)
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | Scheme | Overridden. Specifies the scheme name.
public property | TransactedReceiveEnabled | (inherited from Adapter)
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.

See Also

Reference

SqlAdapterBindingElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.AcceptCredentialsInUri Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic

  Syntax
Visual Basic

C#

C++

J#

JScript

  Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
  Platforms
Development Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
Target Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
  See Also
Reference
SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.AllowIdentityInsert Property
[image]

Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.AllowIdentityInsert

instance.AllowIdentityInsert = value

Syntax

Visual Basic
<CategoryAttribute("Miscellaneous")> _
Public Property AllowIdentityInsert As Boolean
C#
[CategoryAttribute("Miscellaneous")]
public bool AllowIdentityInsert { get; set; }
C++
[CategoryAttribute(L"Miscellaneous")]
public:
virtual property bool AllowIdentityInsert {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_AllowIdentityInsert ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_AllowIdentityInsert (boolean value)
JScript
CompilerGeneratedAttribute
public final function get AllowIdentityInsert () : boolean

CompilerGeneratedAttribute
public final function set AllowIdentityInsert (value : boolean)

Property Value

Returns a Boolean indicating if you can insert values for identity columns. The default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.BatchSize Property
[image]

Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Integer

value = instance.BatchSize

instance.BatchSize = value

Syntax

Visual Basic
Public Property BatchSize As Integer
C#
public int BatchSize { get; set; }
C++
public:
virtual property int BatchSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_BatchSize ()

/** @property */
public final void set_BatchSize (int value)
JScript
public final function get BatchSize () : int

public final function set BatchSize (value : int)

Property Value

Returns Int32.

Remarks

The default is two.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.ChunkSize Property
[image]

Specifies the buffer size used for Set<clolumn_name> o0eprations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Integer

value = instance.ChunkSize

instance.ChunkSize = value

Syntax

Visual Basic
Public Property ChunkSize As Integer
C#
public int ChunkSize { get; set; }
C++
public:
virtual property int ChunkSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_ChunkSize ()

/** @property */
public final void set_ChunkSize (int value)
JScript
public final function get ChunkSize () : int

public final function set ChunkSize (value : int)

Property Value

Returns a Int32 containing the buffer size.

Remarks

The default is 419304 bytes. A higher value may improve performance, but affects memory consumption.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.EnableBizTalkCompatibilityMode Property
[image]

Gets or sets a value indicating if the BizTalk compatibility mode has been set.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.EnableBizTalkCompatibilityMode

instance.EnableBizTalkCompatibilityMode = value

Syntax

Visual Basic
Public Property EnableBizTalkCompatibilityMode As Boolean
C#
public bool EnableBizTalkCompatibilityMode { get; set; }
C++
public:
virtual property bool EnableBizTalkCompatibilityMode {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnableBizTalkCompatibilityMode ()

/** @property */
public final void set_EnableBizTalkCompatibilityMode (boolean value)
JScript
public final function get EnableBizTalkCompatibilityMode () : boolean

public final function set EnableBizTalkCompatibilityMode (value : boolean)

Property Value

Returns a Boolean indicating if the compatibility mode has been set.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.EnablePerformanceCounters Property
[image]

Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.EnablePerformanceCounters

instance.EnablePerformanceCounters = value

Syntax

Visual Basic
Public Property EnablePerformanceCounters As Boolean
C#
public bool EnablePerformanceCounters { get; set; }
C++
public:
virtual property bool EnablePerformanceCounters {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnablePerformanceCounters ()

/** @property */
public final void set_EnablePerformanceCounters (boolean value)
JScript
public final function get EnablePerformanceCounters () : boolean

public final function set EnablePerformanceCounters (value : boolean)

Property Value

Returns a Boolean. indicating if the performance counters have been enabled.

Remarks

The default value is false; performance counters are disabled. The LOB latency performance counter measures the total time spent by the SQL adapter in making calls to the SQL server database.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.Encrypt Property
[image]

Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.Encrypt

instance.Encrypt = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property Encrypt As Boolean
C#
[CategoryAttribute("Connection")]
public bool Encrypt { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property bool Encrypt {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_Encrypt ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_Encrypt (boolean value)
JScript
CompilerGeneratedAttribute
public final function get Encrypt () : boolean

CompilerGeneratedAttribute
public final function set Encrypt (value : boolean)

Property Value

Returns a Boolean indicating if SQL server uses SSL encryption; the default value is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.InboundOperationType Property
[image]

Specifies if you want to perform a polling, typed polling, or notification operation.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As InboundOperation

value = instance.InboundOperationType

instance.InboundOperationType = value

Syntax

Visual Basic
Public Property InboundOperationType As InboundOperation
C#
public InboundOperation InboundOperationType { get; set; }
C++
public:
virtual property InboundOperation InboundOperationType {
    InboundOperation get () sealed;
    void set (InboundOperation value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final InboundOperation get_InboundOperationType ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_InboundOperationType (InboundOperation value)
JScript
CompilerGeneratedAttribute
public final function get InboundOperationType () : InboundOperation

CompilerGeneratedAttribute
public final function set InboundOperationType (value : InboundOperation)

Property Value

Returns a InboundOperation containing the operation type; the default is Polling.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.MaxConnectionPoolSize Property
[image]

Specifies the maximum number of connections allowed in a connection pool for a specific connection string.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Integer

value = instance.MaxConnectionPoolSize

instance.MaxConnectionPoolSize = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property MaxConnectionPoolSize As Integer
C#
[CategoryAttribute("Connection")]
public int MaxConnectionPoolSize { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property int MaxConnectionPoolSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_MaxConnectionPoolSize ()

/** @property */
public final void set_MaxConnectionPoolSize (int value)
JScript
public final function get MaxConnectionPoolSize () : int

public final function set MaxConnectionPoolSize (value : int)

Property Value

Returns a Int32 specifying the maximum number of connections; the default is 100.

Remarks

This property is used for performance tuning.

Use this property judiciously. If you set the value too large, you may exhaust the number of connections available.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.NotificationStatement Property
[image]

Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.NotificationStatement

instance.NotificationStatement = value

Syntax

Visual Basic
<CategoryAttribute("Notification (Inbound)")> _
Public Property NotificationStatement As String
C#
[CategoryAttribute("Notification (Inbound)")]
public string NotificationStatement { get; set; }
C++
[CategoryAttribute(L"Notification (Inbound)")]
public:
virtual property String^ NotificationStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_NotificationStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_NotificationStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get NotificationStatement () : String

CompilerGeneratedAttribute
public final function set NotificationStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.NotifyOnListenerStart Property
[image]

Specifies whether the adapter sends a notification message when the listener is started.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.NotifyOnListenerStart

instance.NotifyOnListenerStart = value

Syntax

Visual Basic
<CategoryAttribute("Notification (Inbound)")> _
Public Property NotifyOnListenerStart As Boolean
C#
[CategoryAttribute("Notification (Inbound)")]
public bool NotifyOnListenerStart { get; set; }
C++
[CategoryAttribute(L"Notification (Inbound)")]
public:
virtual property bool NotifyOnListenerStart {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_NotifyOnListenerStart ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_NotifyOnListenerStart (boolean value)
JScript
CompilerGeneratedAttribute
public final function get NotifyOnListenerStart () : boolean

CompilerGeneratedAttribute
public final function set NotifyOnListenerStart (value : boolean)

Property Value

Returns a Boolean indicating if the adapter sends the notification message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.PolledDataAvailableStatement Property
[image]

Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.PolledDataAvailableStatement

instance.PolledDataAvailableStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
Public Property PolledDataAvailableStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
public string PolledDataAvailableStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property String^ PolledDataAvailableStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_PolledDataAvailableStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PolledDataAvailableStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get PolledDataAvailableStatement () : String

CompilerGeneratedAttribute
public final function set PolledDataAvailableStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

The specified statement must return a result set consisting of rows and columns. The value in the first cell of the result set indicates whether the adapter executes the SQL statement specified for the PollingStatement binding property. If the first cell of the result contains a positive value, the adapter executed the polling statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.PollingIntervalInSeconds Property
[image]

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Integer

value = instance.PollingIntervalInSeconds

instance.PollingIntervalInSeconds = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollingIntervalInSeconds As Integer
C#
[CategoryAttribute("Polling (Inbound)")]
public int PollingIntervalInSeconds { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property int PollingIntervalInSeconds {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_PollingIntervalInSeconds ()

/** @property */
public final void set_PollingIntervalInSeconds (int value)
JScript
public final function get PollingIntervalInSeconds () : int

public final function set PollingIntervalInSeconds (value : int)

Property Value

Returns a Int32 containing the interval.

Remarks

The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter is inactive for the remaining time in the interval.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.PollingStatement Property
[image]

Specifies the SQL statement to poll a SQL Server database table.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.PollingStatement

instance.PollingStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollingStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
public string PollingStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property String^ PollingStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_PollingStatement ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PollingStatement (String value)
JScript
CompilerGeneratedAttribute
public final function get PollingStatement () : String

CompilerGeneratedAttribute
public final function set PollingStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

You can specify a simple SELECT statement or stored procedures for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property.

You can specify any number of SQL statements separated by a semicolon. You can use the polling statement to read or update data in a SQL Server database table. The SQL adapter executes the polling statements inside one transaction. When the adapter is used with BizTalk Server, the same transaction is used to submit messages from SQL Server to the BizTalk message box.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.PollWhileDataFound Property
[image]

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.PollWhileDataFound

instance.PollWhileDataFound = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollWhileDataFound As Boolean
C#
[CategoryAttribute("Polling (Inbound)")]
public bool PollWhileDataFound { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property bool PollWhileDataFound {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_PollWhileDataFound ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_PollWhileDataFound (boolean value)
JScript
CompilerGeneratedAttribute
public final function get PollWhileDataFound () : boolean

CompilerGeneratedAttribute
public final function set PollWhileDataFound (value : boolean)

Property Value

Returns a Boolean specifying whether to ignore the polling interval; the default is false.

Remarks

If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval.

Consider a scenario where the polling interval is set to 60 seconds, and the statement specified for PolledDataAvailableStatement returns that data is available for polling. The adapter then executes the statement specified for the PollingStatement binding property. Assuming that the adapter takes just 10 seconds to execute the polling statement, it will now have to wait for 50 seconds before executing the PolledDataAvailableStatement again, and then subsequently execute the polling statement. Instead, to optimize the performance you can set the PollWhileDataFound binding property to true so that the adapter can start executing the next polling cycle as soon as the previous polling cycle ends.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.Scheme Property
[image]

Specifies the scheme name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.Scheme

Syntax

Visual Basic
Public Overrides NotOverridable ReadOnly Property Scheme As String
C#
public override sealed string Scheme { get; }
C++
public:
virtual property String^ Scheme {
    String^ get () override sealed;
}
J#
/** @property */
public final String get_Scheme ()
JScript
public override final function get Scheme () : String

Property Value

Returns a String containing the scheme name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.UseAmbientTransaction Property
[image]

Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.UseAmbientTransaction

instance.UseAmbientTransaction = value

Syntax

Visual Basic
Public Property UseAmbientTransaction As Boolean
C#
public bool UseAmbientTransaction { get; set; }
C++
public:
virtual property bool UseAmbientTransaction {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_UseAmbientTransaction ()

/** @property */
public final void set_UseAmbientTransaction (boolean value)
JScript
public final function get UseAmbientTransaction () : boolean

public final function set UseAmbientTransaction (value : boolean)

Property Value

Returns a Boolean indicating whether the SQL adapter performs operations using a transactional context; the default is true.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.UseDatabaseNameInXsdNamespace Property
[image]

Specifies whether the XSD generated for a particular artifact contains the database name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As Boolean

value = instance.UseDatabaseNameInXsdNamespace

instance.UseDatabaseNameInXsdNamespace = value

Syntax

Visual Basic
<CategoryAttribute("Metadata")> _
Public Property UseDatabaseNameInXsdNamespace As Boolean
C#
[CategoryAttribute("Metadata")]
public bool UseDatabaseNameInXsdNamespace { get; set; }
C++
[CategoryAttribute(L"Metadata")]
public:
virtual property bool UseDatabaseNameInXsdNamespace {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final boolean get_UseDatabaseNameInXsdNamespace ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_UseDatabaseNameInXsdNamespace (boolean value)
JScript
CompilerGeneratedAttribute
public final function get UseDatabaseNameInXsdNamespace () : boolean

CompilerGeneratedAttribute
public final function set UseDatabaseNameInXsdNamespace (value : boolean)

Property Value

Returns a Boolean indicating whether the XSD contains the database name; the default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.WorkstationId Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.WorkstationId

instance.WorkstationId = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
Public Property WorkstationId As String
C#
[CategoryAttribute("Connection")]
public string WorkstationId { get; set; }
C++
[CategoryAttribute(L"Connection")]
public:
virtual property String^ WorkstationId {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_WorkstationId ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_WorkstationId (String value)
JScript
CompilerGeneratedAttribute
public final function get WorkstationId () : String

CompilerGeneratedAttribute
public final function set WorkstationId (value : String)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.XmlStoredProcedureRootNodeName Property
[image]

Specifies the XML root node name of the stored procedures for the database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeName

instance.XmlStoredProcedureRootNodeName = value

Syntax

Visual Basic
Public Property XmlStoredProcedureRootNodeName As String
C#
public string XmlStoredProcedureRootNodeName { get; set; }
C++
public:
virtual property String^ XmlStoredProcedureRootNodeName {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_XmlStoredProcedureRootNodeName ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_XmlStoredProcedureRootNodeName (String value)
JScript
CompilerGeneratedAttribute
public final function get XmlStoredProcedureRootNodeName () : String

CompilerGeneratedAttribute
public final function set XmlStoredProcedureRootNodeName (value : String)

Property Value

Returns a String containing the root node name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElement.XmlStoredProcedureRootNodeNamespace Property
[image]

Specifies the XML stored procedure root node namespace.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeNamespace

instance.XmlStoredProcedureRootNodeNamespace = value

Syntax

Visual Basic
Public Property XmlStoredProcedureRootNodeNamespace As String
C#
public string XmlStoredProcedureRootNodeNamespace { get; set; }
C++
public:
virtual property String^ XmlStoredProcedureRootNodeNamespace {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final String get_XmlStoredProcedureRootNodeNamespace ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */
public final void set_XmlStoredProcedureRootNodeNamespace (String value)
JScript
CompilerGeneratedAttribute
public final function get XmlStoredProcedureRootNodeNamespace () : String

CompilerGeneratedAttribute
public final function set XmlStoredProcedureRootNodeNamespace (value : String)

Property Value

Returns a String containing the namespace name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElement Class
SqlAdapterBindingElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement Class
See Also Members
[image]

Represents the SQL adapter binding.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterBindingElementExtensionElement
    Inherits BindingElementExtensionElement
C#
public sealed class SqlAdapterBindingElementExtensionElement : BindingElementExtensionElement
C++
public ref class SqlAdapterBindingElementExtensionElement sealed : public BindingElementExtensionElement
J#
public final class SqlAdapterBindingElementExtensionElement extends BindingElementExtensionElement
JScript
public final class SqlAdapterBindingElementExtensionElement extends BindingElementExtensionElement

Inheritance Hierarchy

System.Object
System.Configuration.ConfigurationElement
System.ServiceModel.Configuration.ServiceModelExtensionElement
System.ServiceModel.Configuration.BindingElementExtensionElement
Microsoft.Adapters.Sql.SqlAdapterBindingElementExtensionElement

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement Members
See Also Constructors Methods Properties
[image]

Represents the SQL adapter binding.

The following tables list the members exposed by the SqlAdapterBindingElementExtensionElement type.

Public Constructors

Name | Description
SqlAdapterBindingElementExtensionElement | Creates a new instance of the SQLAdapterBindingElementExtensionElement class, using the default parameters.
Top

Public Properties (see also Protected Properties)

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | BindingElementType | Overridden. Specifies the binding element type.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | ConfigurationElementName | (inherited from ServiceModelExtensionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.
Top

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | ApplyConfiguration | Overridden. Applies the configuration to the specified binding element.
public method | CopyFrom | Overridden. copies the specified extension element to the current instance.
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | IsModified | Overridden. (inherited from ConfigurationElement)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SerializeElement | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)
Top

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement Constructor
[image]

Creates a new instance of the SQLAdapterBindingElementExtensionElement class, using the default parameters.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterBindingElementExtensionElement

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterBindingElementExtensionElement ()
C++
public:
SqlAdapterBindingElementExtensionElement ()
J#
public SqlAdapterBindingElementExtensionElement ()
JScript
public function SqlAdapterBindingElementExtensionElement ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | ApplyConfiguration | Overridden. Applies the configuration to the specified binding element.
public method | CopyFrom | Overridden. copies the specified extension element to the current instance.
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | IsModified | Overridden. (inherited from ConfigurationElement)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SerializeElement | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.ApplyConfiguration Method
[image]

Applies the configuration to the specified binding element.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim bindingElement As BindingElement

instance.ApplyConfiguration(bindingElement)

Syntax

Visual Basic
Public Overrides Sub ApplyConfiguration ( _
    bindingElement As BindingElement _
)
C#
public override void ApplyConfiguration (
    BindingElement bindingElement
)
C++
public:
virtual void ApplyConfiguration (
    BindingElement^ bindingElement
) override
J#
public void ApplyConfiguration (
    BindingElement bindingElement
)
JScript
public override function ApplyConfiguration (
    bindingElement : BindingElement
)

Parameters

bindingElement

The binding element to apply the configuration to.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.CopyFrom Method
[image]

copies the specified extension element to the current instance.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim from As ServiceModelExtensionElement

instance.CopyFrom(from)

Syntax

Visual Basic
Public Overrides Sub CopyFrom ( _
    from As ServiceModelExtensionElement _
)
C#
public override void CopyFrom (
    ServiceModelExtensionElement from
)
C++
public:
virtual void CopyFrom (
    ServiceModelExtensionElement^ from
) override
J#
public void CopyFrom (
    ServiceModelExtensionElement from
)
JScript
public override function CopyFrom (
    from : ServiceModelExtensionElement
)

Parameters

from

the extension element to copy.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement Properties
[image]

Public Properties (see also Protected Properties)

 | Name | Description
public property | AcceptCredentialsInUri |
public property | AllowIdentityInsert | Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.
public property | BatchSize | Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.
public property | BindingElementType | Overridden. Specifies the binding element type.
public property | ChunkSize | Specifies the buffer size used for Set<clolumn_name> o0eprations.
public property | ConfigurationElementName | (inherited from ServiceModelExtensionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | EnableBizTalkCompatibilityMode | Gets or sets a value indicating if the BizTalk compatibility mode has been set.
public property | EnablePerformanceCounters | Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.
public property | Encrypt | Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.
public property | InboundOperationType | Specifies if you want to perform a polling, typed polling, or notification operation.
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | MaxConnectionPoolSize | Specifies the maximum number of connections allowed in a connection pool for a specific connection string.
public property | NotificationStatement | Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.
public property | NotifyOnListenerStart | Specifies whether the adapter sends a notification message when the listener is started.
public property | PolledDataAvailableStatement | Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.
public property | PollingIntervalInSeconds | Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.
public property | PollingStatement | Specifies the SQL statement to poll a SQL Server database table.
public property | PollWhileDataFound | Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.
public property | UseAmbientTransaction | Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.
public property | UseDatabaseNameInXsdNamespace | Specifies whether the XSD generated for a particular artifact contains the database name.
public property | WorkstationId |
public property | XmlStoredProcedureRootNodeName | Specifies the XML root node name of the stored procedures for the database.
public property | XmlStoredProcedureRootNodeNamespace | Specifies the XML stored procedure root node namespace.

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.AcceptCredentialsInUri Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic

  Syntax
Visual Basic

C#

C++

J#

JScript

  Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
  Platforms
Development Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
Target Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008
  See Also
Reference
SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.AllowIdentityInsert Property
[image]

Gets or sets a value indicating whether you can insert values for identity columns during Insert and update operations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.AllowIdentityInsert

instance.AllowIdentityInsert = value

Syntax

Visual Basic
<CategoryAttribute("Miscellaneous")> _
<ConfigurationPropertyAttribute("allowIdentityInsert", DefaultValue:=False)> _
Public Property AllowIdentityInsert As Boolean
C#
[CategoryAttribute("Miscellaneous")]
[ConfigurationPropertyAttribute("allowIdentityInsert", DefaultValue=false)]
public bool AllowIdentityInsert { get; set; }
C++
[CategoryAttribute(L"Miscellaneous")]
[ConfigurationPropertyAttribute(L"allowIdentityInsert", DefaultValue=false)]
public:
virtual property bool AllowIdentityInsert {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_AllowIdentityInsert ()

/** @property */
public final void set_AllowIdentityInsert (boolean value)
JScript
public final function get AllowIdentityInsert () : boolean

public final function set AllowIdentityInsert (value : boolean)

Property Value

Returns a Boolean indicating if you can insert values for identity columns. The default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.BatchSize Property
[image]

Specifies the batch size for multiple record Insert and delete operations on a table or view in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Integer

value = instance.BatchSize

instance.BatchSize = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("batchSize", DefaultValue:=20)> _
<CategoryAttribute("Buffering")> _
Public Property BatchSize As Integer
C#
[ConfigurationPropertyAttribute("batchSize", DefaultValue=20)]
[CategoryAttribute("Buffering")]
public int BatchSize { get; set; }
C++
[ConfigurationPropertyAttribute(L"batchSize", DefaultValue=20)]
[CategoryAttribute(L"Buffering")]
public:
virtual property int BatchSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_BatchSize ()

/** @property */
public final void set_BatchSize (int value)
JScript
public final function get BatchSize () : int

public final function set BatchSize (value : int)

Property Value

Returns Int32.

Remarks

The default is two.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.BindingElementType Property
[image]

Specifies the binding element type.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Type

value = instance.BindingElementType

Syntax

Visual Basic
Public Overrides ReadOnly Property BindingElementType As Type
C#
public override Type BindingElementType { get; }
C++
public:
virtual property Type^ BindingElementType {
    Type^ get () override;
}
J#
/** @property */
public Type get_BindingElementType ()
JScript
public override function get BindingElementType () : Type

Property Value

Returns a Type containing the binding element.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.ChunkSize Property
[image]

Specifies the buffer size used for Set<clolumn_name> o0eprations.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Integer

value = instance.ChunkSize

instance.ChunkSize = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("chunkSize", DefaultValue:=4194304)> _
<CategoryAttribute("Buffering")> _
Public Property ChunkSize As Integer
C#
[ConfigurationPropertyAttribute("chunkSize", DefaultValue=4194304)]
[CategoryAttribute("Buffering")]
public int ChunkSize { get; set; }
C++
[ConfigurationPropertyAttribute(L"chunkSize", DefaultValue=4194304)]
[CategoryAttribute(L"Buffering")]
public:
virtual property int ChunkSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_ChunkSize ()

/** @property */
public final void set_ChunkSize (int value)
JScript
public final function get ChunkSize () : int

public final function set ChunkSize (value : int)

Property Value

Returns a Int32 containing the buffer size.

Remarks

The default is 419304 bytes. A higher value may improve performance, but affects memory consumption.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.EnableBizTalkCompatibilityMode Property
[image]

Gets or sets a value indicating if the BizTalk compatibility mode has been set.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.EnableBizTalkCompatibilityMode

instance.EnableBizTalkCompatibilityMode = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("enableBizTalkCompatibilityMode", DefaultValue:=True)> _
<CategoryAttribute("BizTalk")> _
Public Property EnableBizTalkCompatibilityMode As Boolean
C#
[ConfigurationPropertyAttribute("enableBizTalkCompatibilityMode", DefaultValue=true)]
[CategoryAttribute("BizTalk")]
public bool EnableBizTalkCompatibilityMode { get; set; }
C++
[ConfigurationPropertyAttribute(L"enableBizTalkCompatibilityMode", DefaultValue=true)]
[CategoryAttribute(L"BizTalk")]
public:
virtual property bool EnableBizTalkCompatibilityMode {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnableBizTalkCompatibilityMode ()

/** @property */
public final void set_EnableBizTalkCompatibilityMode (boolean value)
JScript
public final function get EnableBizTalkCompatibilityMode () : boolean

public final function set EnableBizTalkCompatibilityMode (value : boolean)

Property Value

Returns a Boolean indicating if the compatibility mode has been set.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.EnablePerformanceCounters Property
[image]

Gets or sets a value specifying whether to enable the WCF LOB Adpater SDK performance counters and the SQL adapter LOB latency performance counter.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.EnablePerformanceCounters

instance.EnablePerformanceCounters = value

Syntax

Visual Basic
<CategoryAttribute("Diagnostics")> _
<ConfigurationPropertyAttribute("enablePerformanceCounters", DefaultValue:=False)> _
Public Property EnablePerformanceCounters As Boolean
C#
[CategoryAttribute("Diagnostics")]
[ConfigurationPropertyAttribute("enablePerformanceCounters", DefaultValue=false)]
public bool EnablePerformanceCounters { get; set; }
C++
[CategoryAttribute(L"Diagnostics")]
[ConfigurationPropertyAttribute(L"enablePerformanceCounters", DefaultValue=false)]
public:
virtual property bool EnablePerformanceCounters {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_EnablePerformanceCounters ()

/** @property */
public final void set_EnablePerformanceCounters (boolean value)
JScript
public final function get EnablePerformanceCounters () : boolean

public final function set EnablePerformanceCounters (value : boolean)

Property Value

Returns a Boolean. indicating if the performance counters have been enabled.

Remarks

The default value is false; performance counters are disabled. The LOB latency performance counter measures the total time spent by the SQL adapter in making calls to the SQL server database.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.Encrypt Property
[image]

Specifies whether SQL Server (with a valid certificate installed) uses SSL encryption for all data transfers between SQL Server and the client.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.Encrypt

instance.Encrypt = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("encrypt", DefaultValue:=False)> _
<CategoryAttribute("Connection")> _
Public Property Encrypt As Boolean
C#
[ConfigurationPropertyAttribute("encrypt", DefaultValue=false)]
[CategoryAttribute("Connection")]
public bool Encrypt { get; set; }
C++
[ConfigurationPropertyAttribute(L"encrypt", DefaultValue=false)]
[CategoryAttribute(L"Connection")]
public:
virtual property bool Encrypt {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_Encrypt ()

/** @property */
public final void set_Encrypt (boolean value)
JScript
public final function get Encrypt () : boolean

public final function set Encrypt (value : boolean)

Property Value

Returns a Boolean indicating if SQL server uses SSL encryption; the default value is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.InboundOperationType Property
[image]

Specifies if you want to perform a polling, typed polling, or notification operation.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As InboundOperation

value = instance.InboundOperationType

instance.InboundOperationType = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("inboundOperationType", DefaultValue:=InboundOperation.Polling)> _
<CategoryAttribute("Inbound")> _
Public Property InboundOperationType As InboundOperation
C#
[ConfigurationPropertyAttribute("inboundOperationType", DefaultValue=InboundOperation.Polling)]
[CategoryAttribute("Inbound")]
public InboundOperation InboundOperationType { get; set; }
C++
[ConfigurationPropertyAttribute(L"inboundOperationType", DefaultValue=InboundOperation::Polling)]
[CategoryAttribute(L"Inbound")]
public:
virtual property InboundOperation InboundOperationType {
    InboundOperation get () sealed;
    void set (InboundOperation value) sealed;
}
J#
/** @property */
public final InboundOperation get_InboundOperationType ()

/** @property */
public final void set_InboundOperationType (InboundOperation value)
JScript
public final function get InboundOperationType () : InboundOperation

public final function set InboundOperationType (value : InboundOperation)

Property Value

Returns a InboundOperation containing the operation type; the default is Polling.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.MaxConnectionPoolSize Property
[image]

Specifies the maximum number of connections allowed in a connection pool for a specific connection string.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Integer

value = instance.MaxConnectionPoolSize

instance.MaxConnectionPoolSize = value

Syntax

Visual Basic
<CategoryAttribute("Connection")> _
<ConfigurationPropertyAttribute("maxConnectionPoolSize", DefaultValue:=100)> _
Public Property MaxConnectionPoolSize As Integer
C#
[CategoryAttribute("Connection")]
[ConfigurationPropertyAttribute("maxConnectionPoolSize", DefaultValue=100)]
public int MaxConnectionPoolSize { get; set; }
C++
[CategoryAttribute(L"Connection")]
[ConfigurationPropertyAttribute(L"maxConnectionPoolSize", DefaultValue=100)]
public:
virtual property int MaxConnectionPoolSize {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_MaxConnectionPoolSize ()

/** @property */
public final void set_MaxConnectionPoolSize (int value)
JScript
public final function get MaxConnectionPoolSize () : int

public final function set MaxConnectionPoolSize (value : int)

Property Value

Returns a Int32 specifying the maximum number of connections; the default is 100.

Remarks

This property is used for performance tuning.

Use this property judiciously. If you set the value too large, you may exhaust the number of connections available.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.NotificationStatement Property
[image]

Specifies the SQL statement (SELECT or EXEC <stored procedure>) used to register for SQL Server notifications.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.NotificationStatement

instance.NotificationStatement = value

Syntax

Visual Basic
<CategoryAttribute("Notification (Inbound)")> _
<ConfigurationPropertyAttribute("notificationStatement", DefaultValue:="")> _
Public Property NotificationStatement As String
C#
[CategoryAttribute("Notification (Inbound)")]
[ConfigurationPropertyAttribute("notificationStatement", DefaultValue="")]
public string NotificationStatement { get; set; }
C++
[CategoryAttribute(L"Notification (Inbound)")]
[ConfigurationPropertyAttribute(L"notificationStatement", DefaultValue=L"")]
public:
virtual property String^ NotificationStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_NotificationStatement ()

/** @property */
public final void set_NotificationStatement (String value)
JScript
public final function get NotificationStatement () : String

public final function set NotificationStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.NotifyOnListenerStart Property
[image]

Specifies whether the adapter sends a notification message when the listener is started.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.NotifyOnListenerStart

instance.NotifyOnListenerStart = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("notifyOnListenerStart", DefaultValue:=True)> _
<CategoryAttribute("Notification (Inbound)")> _
Public Property NotifyOnListenerStart As Boolean
C#
[ConfigurationPropertyAttribute("notifyOnListenerStart", DefaultValue=true)]
[CategoryAttribute("Notification (Inbound)")]
public bool NotifyOnListenerStart { get; set; }
C++
[ConfigurationPropertyAttribute(L"notifyOnListenerStart", DefaultValue=true)]
[CategoryAttribute(L"Notification (Inbound)")]
public:
virtual property bool NotifyOnListenerStart {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_NotifyOnListenerStart ()

/** @property */
public final void set_NotifyOnListenerStart (boolean value)
JScript
public final function get NotifyOnListenerStart () : boolean

public final function set NotifyOnListenerStart (value : boolean)

Property Value

Returns a Boolean indicating if the adapter sends the notification message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.PolledDataAvailableStatement Property
[image]

Specifies the SQL statement executed to determine whether any data is available for polling for a specific table in a SQL Server database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.PolledDataAvailableStatement

instance.PolledDataAvailableStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<ConfigurationPropertyAttribute("polledDataAvailableStatement", DefaultValue:="")> _
Public Property PolledDataAvailableStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
[ConfigurationPropertyAttribute("polledDataAvailableStatement", DefaultValue="")]
public string PolledDataAvailableStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[ConfigurationPropertyAttribute(L"polledDataAvailableStatement", DefaultValue=L"")]
public:
virtual property String^ PolledDataAvailableStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_PolledDataAvailableStatement ()

/** @property */
public final void set_PolledDataAvailableStatement (String value)
JScript
public final function get PolledDataAvailableStatement () : String

public final function set PolledDataAvailableStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

The specified statement must return a result set consisting of rows and columns. The value in the first cell of the result set indicates whether the adapter executes the SQL statement specified for the PollingStatement binding property. If the first cell of the result contains a positive value, the adapter executed the polling statement.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.PollingIntervalInSeconds Property
[image]

Specifies the interval, in seconds, at which the SQL adapter executes the statement specified for the PolledDataAvailableStatement binding property.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Integer

value = instance.PollingIntervalInSeconds

instance.PollingIntervalInSeconds = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<ConfigurationPropertyAttribute("pollingIntervalInSeconds", DefaultValue:=30)> _
Public Property PollingIntervalInSeconds As Integer
C#
[CategoryAttribute("Polling (Inbound)")]
[ConfigurationPropertyAttribute("pollingIntervalInSeconds", DefaultValue=30)]
public int PollingIntervalInSeconds { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[ConfigurationPropertyAttribute(L"pollingIntervalInSeconds", DefaultValue=30)]
public:
virtual property int PollingIntervalInSeconds {
    int get () sealed;
    void set (int value) sealed;
}
J#
/** @property */
public final int get_PollingIntervalInSeconds ()

/** @property */
public final void set_PollingIntervalInSeconds (int value)
JScript
public final function get PollingIntervalInSeconds () : int

public final function set PollingIntervalInSeconds (value : int)

Property Value

Returns a Int32 containing the interval.

Remarks

The default is 30 seconds. The polling interval determines the time interval between successive polls. If the statement is executed within the specified interval, the adapter is inactive for the remaining time in the interval.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.PollingStatement Property
[image]

Specifies the SQL statement to poll a SQL Server database table.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.PollingStatement

instance.PollingStatement = value

Syntax

Visual Basic
<CategoryAttribute("Polling (Inbound)")> _
<ConfigurationPropertyAttribute("pollingStatement", DefaultValue:="")> _
Public Property PollingStatement As String
C#
[CategoryAttribute("Polling (Inbound)")]
[ConfigurationPropertyAttribute("pollingStatement", DefaultValue="")]
public string PollingStatement { get; set; }
C++
[CategoryAttribute(L"Polling (Inbound)")]
[ConfigurationPropertyAttribute(L"pollingStatement", DefaultValue=L"")]
public:
virtual property String^ PollingStatement {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_PollingStatement ()

/** @property */
public final void set_PollingStatement (String value)
JScript
public final function get PollingStatement () : String

public final function set PollingStatement (value : String)

Property Value

Returns a String containing the SQL statement.

Remarks

You can specify a simple SELECT statement or stored procedures for the polling statement. The default is null. You must specify a value for PollingStatement to enable polling. The polling statement is executed only if there is data available for polling, which is determined by the PolledDataAvailableStatement binding property.

You can specify any number of SQL statements separated by a semicolon. You can use the polling statement to read or update data in a SQL Server database table. The SQL adapter executes the polling statements inside one transaction. When the adapter is used with BizTalk Server, the same transaction is used to submit messages from SQL Server to the BizTalk message box.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.PollWhileDataFound Property
[image]

Specifies whether the SQL adapter ignores the polling interval and continuously executes the SQL statement specified for the PolledDataAvailableStatement binding property, if data is available in the table being polled.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.PollWhileDataFound

instance.PollWhileDataFound = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("pollWhileDataFound", DefaultValue:=False)> _
<CategoryAttribute("Polling (Inbound)")> _
Public Property PollWhileDataFound As Boolean
C#
[ConfigurationPropertyAttribute("pollWhileDataFound", DefaultValue=false)]
[CategoryAttribute("Polling (Inbound)")]
public bool PollWhileDataFound { get; set; }
C++
[ConfigurationPropertyAttribute(L"pollWhileDataFound", DefaultValue=false)]
[CategoryAttribute(L"Polling (Inbound)")]
public:
virtual property bool PollWhileDataFound {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_PollWhileDataFound ()

/** @property */
public final void set_PollWhileDataFound (boolean value)
JScript
public final function get PollWhileDataFound () : boolean

public final function set PollWhileDataFound (value : boolean)

Property Value

Returns a Boolean specifying whether to ignore the polling interval; the default is false.

Remarks

If no data is available in the table, the adapter reverts to execute the SQL statement at the specified polling interval.

Consider a scenario where the polling interval is set to 60 seconds, and the statement specified for PolledDataAvailableStatement returns that data is available for polling. The adapter then executes the statement specified for the PollingStatement binding property. Assuming that the adapter takes just 10 seconds to execute the polling statement, it will now have to wait for 50 seconds before executing the PolledDataAvailableStatement again, and then subsequently execute the polling statement. Instead, to optimize the performance you can set the PollWhileDataFound binding property to true so that the adapter can start executing the next polling cycle as soon as the previous polling cycle ends.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.UseAmbientTransaction Property
[image]

Specifies whether the SQL adapter performs the operations using the transactional context provided by the caller.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.UseAmbientTransaction

instance.UseAmbientTransaction = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("useAmbientTransaction", DefaultValue:=True)> _
<CategoryAttribute("Transaction")> _
Public Property UseAmbientTransaction As Boolean
C#
[ConfigurationPropertyAttribute("useAmbientTransaction", DefaultValue=true)]
[CategoryAttribute("Transaction")]
public bool UseAmbientTransaction { get; set; }
C++
[ConfigurationPropertyAttribute(L"useAmbientTransaction", DefaultValue=true)]
[CategoryAttribute(L"Transaction")]
public:
virtual property bool UseAmbientTransaction {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_UseAmbientTransaction ()

/** @property */
public final void set_UseAmbientTransaction (boolean value)
JScript
public final function get UseAmbientTransaction () : boolean

public final function set UseAmbientTransaction (value : boolean)

Property Value

Returns a Boolean indicating whether the SQL adapter performs operations using a transactional context; the default is true.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.UseDatabaseNameInXsdNamespace Property
[image]

Specifies whether the XSD generated for a particular artifact contains the database name.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As Boolean

value = instance.UseDatabaseNameInXsdNamespace

instance.UseDatabaseNameInXsdNamespace = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("useDatabaseNameInXsdNamespace", DefaultValue:=False)> _
<CategoryAttribute("Metadata")> _
Public Property UseDatabaseNameInXsdNamespace As Boolean
C#
[ConfigurationPropertyAttribute("useDatabaseNameInXsdNamespace", DefaultValue=false)]
[CategoryAttribute("Metadata")]
public bool UseDatabaseNameInXsdNamespace { get; set; }
C++
[ConfigurationPropertyAttribute(L"useDatabaseNameInXsdNamespace", DefaultValue=false)]
[CategoryAttribute(L"Metadata")]
public:
virtual property bool UseDatabaseNameInXsdNamespace {
    bool get () sealed;
    void set (bool value) sealed;
}
J#
/** @property */
public final boolean get_UseDatabaseNameInXsdNamespace ()

/** @property */
public final void set_UseDatabaseNameInXsdNamespace (boolean value)
JScript
public final function get UseDatabaseNameInXsdNamespace () : boolean

public final function set UseDatabaseNameInXsdNamespace (value : boolean)

Property Value

Returns a Boolean indicating whether the XSD contains the database name; the default is false.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.WorkstationId Property
[image]

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.WorkstationId

instance.WorkstationId = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("workstationId", DefaultValue:="")> _
<CategoryAttribute("Connection")> _
Public Property WorkstationId As String
C#
[ConfigurationPropertyAttribute("workstationId", DefaultValue="")]
[CategoryAttribute("Connection")]
public string WorkstationId { get; set; }
C++
[ConfigurationPropertyAttribute(L"workstationId", DefaultValue=L"")]
[CategoryAttribute(L"Connection")]
public:
virtual property String^ WorkstationId {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_WorkstationId ()

/** @property */
public final void set_WorkstationId (String value)
JScript
public final function get WorkstationId () : String

public final function set WorkstationId (value : String)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.XmlStoredProcedureRootNodeName Property
[image]

Specifies the XML root node name of the stored procedures for the database.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeName

instance.XmlStoredProcedureRootNodeName = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeName", DefaultValue:="")> _
<CategoryAttribute("(FOR XML)")> _
Public Property XmlStoredProcedureRootNodeName As String
C#
[ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeName", DefaultValue="")]
[CategoryAttribute("(FOR XML)")]
public string XmlStoredProcedureRootNodeName { get; set; }
C++
[ConfigurationPropertyAttribute(L"xmlStoredProcedureRootNodeName", DefaultValue=L"")]
[CategoryAttribute(L"(FOR XML)")]
public:
virtual property String^ XmlStoredProcedureRootNodeName {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_XmlStoredProcedureRootNodeName ()

/** @property */
public final void set_XmlStoredProcedureRootNodeName (String value)
JScript
public final function get XmlStoredProcedureRootNodeName () : String

public final function set XmlStoredProcedureRootNodeName (value : String)

Property Value

Returns a String containing the root node name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterBindingElementExtensionElement.XmlStoredProcedureRootNodeNamespace Property
[image]

Specifies the XML stored procedure root node namespace.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterBindingElementExtensionElement
Dim value As String

value = instance.XmlStoredProcedureRootNodeNamespace

instance.XmlStoredProcedureRootNodeNamespace = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeNamespace", DefaultValue:="")> _
<CategoryAttribute("(FOR XML)")> _
Public Property XmlStoredProcedureRootNodeNamespace As String
C#
[ConfigurationPropertyAttribute("xmlStoredProcedureRootNodeNamespace", DefaultValue="")]
[CategoryAttribute("(FOR XML)")]
public string XmlStoredProcedureRootNodeNamespace { get; set; }
C++
[ConfigurationPropertyAttribute(L"xmlStoredProcedureRootNodeNamespace", DefaultValue=L"")]
[CategoryAttribute(L"(FOR XML)")]
public:
virtual property String^ XmlStoredProcedureRootNodeNamespace {
    String^ get () sealed;
    void set (String^ value) sealed;
}
J#
/** @property */
public final String get_XmlStoredProcedureRootNodeNamespace ()

/** @property */
public final void set_XmlStoredProcedureRootNodeNamespace (String value)
JScript
public final function get XmlStoredProcedureRootNodeNamespace () : String

public final function set XmlStoredProcedureRootNodeNamespace (value : String)

Property Value

Returns a String containing the namespace name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterBindingElementExtensionElement Class
SqlAdapterBindingElementExtensionElement Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri Class
See Also Members
[image]

Contains the SQL adapter connection URI.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterConnectionUri
    Inherits ConnectionUri
C#
public sealed class SqlAdapterConnectionUri : ConnectionUri
C++
public ref class SqlAdapterConnectionUri sealed : public ConnectionUri
J#
public final class SqlAdapterConnectionUri extends ConnectionUri
JScript
public final class SqlAdapterConnectionUri extends ConnectionUri

Inheritance Hierarchy

System.Object
Microsoft.ServiceModel.Channels.Common.ConnectionUri
Microsoft.Adapters.Sql.SqlAdapterConnectionUri

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri Members
See Also Constructors Methods Properties
[image]

Contains the SQL adapter connection URI.

The following tables list the members exposed by the SqlAdapterConnectionUri type.

Public Constructors

Name | Description
SqlAdapterConnectionUri | Contains a new instance of the SqlAdapterConnectionURI class.
Top

Public Properties

 | Name | Description
public property | FailoverPartner | Gets or sets the name of the failover SQL Server database to connect to if the primary SQL Server database is not available.
public property | InboundId | Gets or sets the identifier you add to the connection URI to make it unique.
public property | InitialCatalog | Gets or sets the initial catalog.
public property | InstanceName | Gets or sets the name of the SQL Server instance to connect to.
public property | SampleUriString | Overridden. Gets a sample URI string.
public property | SecureUriString | (inherited from ConnectionUri)
public property | Server | Gets or sets the name of the server on which SQL Server is installed.
public property | Uri | Overridden. Gets or sets the complete connection URI.
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | Equals | (inherited from Object)
public method | GetAttributes | (inherited from ConnectionUri)
public method | GetClassName | (inherited from ConnectionUri)
public method | GetComponentName | (inherited from ConnectionUri)
public method | GetConverter | (inherited from ConnectionUri)
public method | GetDefaultEvent | (inherited from ConnectionUri)
public method | GetDefaultProperty | (inherited from ConnectionUri)
public method | GetEditor | (inherited from ConnectionUri)
public method | GetEvents | (inherited from ConnectionUri)
public method | GetEvents | (inherited from ConnectionUri)
public method | GetHashCode | (inherited from Object)
public method | GetProperties | (inherited from ConnectionUri)
public method | GetProperties | (inherited from ConnectionUri)
public method | GetPropertyOwner | (inherited from ConnectionUri)
public method | GetType | (inherited from Object)
public method | ToString | Overridden. (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)
Top

See Also

Reference

SqlAdapterConnectionUri Class
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri Constructor
[image]

Contains a new instance of the SqlAdapterConnectionURI class.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterConnectionUri

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterConnectionUri ()
C++
public:
SqlAdapterConnectionUri ()
J#
public SqlAdapterConnectionUri ()
JScript
public function SqlAdapterConnectionUri ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | Equals | (inherited from Object)
public method | GetAttributes | (inherited from ConnectionUri)
public method | GetClassName | (inherited from ConnectionUri)
public method | GetComponentName | (inherited from ConnectionUri)
public method | GetConverter | (inherited from ConnectionUri)
public method | GetDefaultEvent | (inherited from ConnectionUri)
public method | GetDefaultProperty | (inherited from ConnectionUri)
public method | GetEditor | (inherited from ConnectionUri)
public method | GetEvents | (inherited from ConnectionUri)
public method | GetEvents | (inherited from ConnectionUri)
public method | GetHashCode | (inherited from Object)
public method | GetProperties | (inherited from ConnectionUri)
public method | GetProperties | (inherited from ConnectionUri)
public method | GetPropertyOwner | (inherited from ConnectionUri)
public method | GetType | (inherited from Object)
public method | ToString | Overridden. (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | MemberwiseClone | (inherited from Object)

See Also

Reference

SqlAdapterConnectionUri Class
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri Properties
[image]

Public Properties

 | Name | Description
public property | FailoverPartner | Gets or sets the name of the failover SQL Server database to connect to if the primary SQL Server database is not available.
public property | InboundId | Gets or sets the identifier you add to the connection URI to make it unique.
public property | InitialCatalog | Gets or sets the initial catalog.
public property | InstanceName | Gets or sets the name of the SQL Server instance to connect to.
public property | SampleUriString | Overridden. Gets a sample URI string.
public property | SecureUriString | (inherited from ConnectionUri)
public property | Server | Gets or sets the name of the server on which SQL Server is installed.
public property | Uri | Overridden. Gets or sets the complete connection URI.

See Also

Reference

SqlAdapterConnectionUri Class
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.FailoverPartner Property
[image]

Gets or sets the name of the failover SQL Server database to connect to if the primary SQL Server database is not available.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.FailoverPartner

instance.FailoverPartner = value

Syntax

Visual Basic
Public Property FailoverPartner As String
C#
public string FailoverPartner { get; set; }
C++
public:
property String^ FailoverPartner {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_FailoverPartner ()

/** @property */
public void set_FailoverPartner (String value)
JScript
public function get FailoverPartner () : String

public function set FailoverPartner (value : String)

Property Value

Returns a String containing the database name.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.InboundId Property
[image]

Gets or sets the identifier you add to the connection URI to make it unique.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.InboundId

instance.InboundId = value

Syntax

Visual Basic
Public Property InboundId As String
C#
public string InboundId { get; set; }
C++
public:
property String^ InboundId {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_InboundId ()

/** @property */
public void set_InboundId (String value)
JScript
public function get InboundId () : String

public function set InboundId (value : String)

Property Value

Returns a String containing the inbound ID.

Remarks

You must provide this connection parameter if you want to generate metadata for the TypedPolling inbound operation. Also, in a BizTalk application, if you have multiple receive locations polling the same database, the inbound ID makes the connection URI unique, thereby enabling adapter clients to receive polling messages from the same database on different receive locations.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.InitialCatalog Property
[image]

Gets or sets the initial catalog.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.InitialCatalog

instance.InitialCatalog = value

Syntax

Visual Basic
Public Property InitialCatalog As String
C#
public string InitialCatalog { get; set; }
C++
public:
property String^ InitialCatalog {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_InitialCatalog ()

/** @property */
public void set_InitialCatalog (String value)
JScript
public function get InitialCatalog () : String

public function set InitialCatalog (value : String)

Property Value

Returns a String containing the name of the initial catalog.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.InstanceName Property
[image]

Gets or sets the name of the SQL Server instance to connect to.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.InstanceName

instance.InstanceName = value

Syntax

Visual Basic
Public Property InstanceName As String
C#
public string InstanceName { get; set; }
C++
public:
property String^ InstanceName {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_InstanceName ()

/** @property */
public void set_InstanceName (String value)
JScript
public function get InstanceName () : String

public function set InstanceName (value : String)

Property Value

Returns a String containing the server instance name.

Remarks

If you do not specify a value, the adapter connects to the default database instance.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.SampleUriString Property
[image]

Gets a sample URI string.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.SampleUriString

Syntax

Visual Basic
Public Overrides NotOverridable ReadOnly Property SampleUriString As String
C#
public override sealed string SampleUriString { get; }
C++
public:
virtual property String^ SampleUriString {
    String^ get () override sealed;
}
J#
/** @property */
public final String get_SampleUriString ()
JScript
public override final function get SampleUriString () : String

Property Value

Returns a String containing a sample URI string.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.Server Property
[image]

Gets or sets the name of the server on which SQL Server is installed.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As String

value = instance.Server

instance.Server = value

Syntax

Visual Basic
Public Property Server As String
C#
public string Server { get; set; }
C++
public:
property String^ Server {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_Server ()

/** @property */
public void set_Server (String value)
JScript
public function get Server () : String

public function set Server (value : String)

Property Value

Returns a String containing the name of the server.

Remarks

If you do not specify a value, the adapter assumes the server name as “localhost” and establishes a connection with the SQL Server database on the local server.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterConnectionUri.Uri Property
[image]

Gets or sets the complete connection URI.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterConnectionUri
Dim value As Uri

value = instance.Uri

instance.Uri = value

Syntax

Visual Basic
Public Overrides NotOverridable Property Uri As Uri
C#
public override sealed Uri Uri { get; set; }
C++
public:
virtual property Uri^ Uri {
    Uri^ get () override sealed;
    void set (Uri^ value) override sealed;
}
J#
/** @property */
public final Uri get_Uri ()

/** @property */
public final void set_Uri (Uri value)
JScript
public override final function get Uri () : Uri

public override final function set Uri (value : Uri)

Property Value

Returns a Uri containing the URI.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterConnectionUri Class
SqlAdapterConnectionUri Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior Class
See Also Members
[image]

Describes the SQL adapter inbound transaction behavior.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterInboundTransactionBehavior

Syntax

Visual Basic
Public NotInheritable Class SqlAdapterInboundTransactionBehavior
    Inherits BehaviorExtensionElement
    Implements IServiceBehavior
C#
public sealed class SqlAdapterInboundTransactionBehavior : BehaviorExtensionElement, IServiceBehavior
C++
public ref class SqlAdapterInboundTransactionBehavior sealed : public BehaviorExtensionElement, IServiceBehavior
J#
public final class SqlAdapterInboundTransactionBehavior extends BehaviorExtensionElement implements IServiceBehavior
JScript
public final class SqlAdapterInboundTransactionBehavior extends BehaviorExtensionElement implements IServiceBehavior

Inheritance Hierarchy

System.Object
System.Configuration.ConfigurationElement
System.ServiceModel.Configuration.ServiceModelExtensionElement
System.ServiceModel.Configuration.BehaviorExtensionElement
Microsoft.Adapters.Sql.SqlAdapterInboundTransactionBehavior

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior Members
See Also Constructors Methods Properties
[image]

Describes the SQL adapter inbound transaction behavior.

The following tables list the members exposed by the SqlAdapterInboundTransactionBehavior type.

Public Constructors

Name | Description
SqlAdapterInboundTransactionBehavior | Creates a new instance of the SqlAdapterInboundTransactionBehavior class.
Top

Public Properties (see also Protected Properties)

 | Name | Description
public property | BehaviorType | Overridden. Gets the type of behavior for the inbound transaction.
public property | ConfigurationElementName | (inherited from ServiceModelExtensionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | TransactionIsolationLevel | Gets or sets the transaction isolation level.
public property | TransactionTimeout | Gets or sets the transaction timeout level.
Top

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)
Top

Public Methods (see also Protected Methods)

 | Name | Description
public method | CopyFrom | Overridden. Copies the transaction behavior from the specified extension element to the current instance.
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)
Top

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | IsModified | Overridden. (inherited from ConfigurationElement)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SerializeElement | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)
Top

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior Constructor
[image]

Creates a new instance of the SqlAdapterInboundTransactionBehavior class.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As New SqlAdapterInboundTransactionBehavior

Syntax

Visual Basic
Public Sub New
C#
public SqlAdapterInboundTransactionBehavior ()
C++
public:
SqlAdapterInboundTransactionBehavior ()
J#
public SqlAdapterInboundTransactionBehavior ()
JScript
public function SqlAdapterInboundTransactionBehavior ()

Remarks

The default constructor initializes any fields to their default values.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior Methods
[image]

Public Methods (see also Protected Methods)

 | Name | Description
public method | CopyFrom | Overridden. Copies the transaction behavior from the specified extension element to the current instance.
public method | Equals | Overridden. (inherited from Object)
public method | GetHashCode | Overridden. (inherited from Object)
public method | GetType | (inherited from Object)
public method | IsReadOnly | (inherited from ConfigurationElement)
public method | ToString | (inherited from Object)

Protected Methods

 | Name | Description
protected method | Finalize | (inherited from Object)
protected method | IsModified | Overridden. (inherited from ConfigurationElement)
protected method | ListErrors | (inherited from ConfigurationElement)
protected method | MemberwiseClone | (inherited from Object)
protected method | OnDeserializeUnrecognizedAttribute | (inherited from ConfigurationElement)
protected method | OnDeserializeUnrecognizedElement | (inherited from ConfigurationElement)
protected method | OnRequiredPropertyNotFound | (inherited from ConfigurationElement)
protected method | PostDeserialize | (inherited from ConfigurationElement)
protected method | PreSerialize | (inherited from ConfigurationElement)
protected method | Reset | Overridden. (inherited from ConfigurationElement)
protected method | SerializeElement | Overridden. (inherited from ConfigurationElement)
protected method | SetPropertyValue | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior.CopyFrom Method
[image]

Copies the transaction behavior from the specified extension element to the current instance.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterInboundTransactionBehavior
Dim from As ServiceModelExtensionElement

instance.CopyFrom(from)

Syntax

Visual Basic
Public Overrides Sub CopyFrom ( _
    from As ServiceModelExtensionElement _
)
C#
public override void CopyFrom (
    ServiceModelExtensionElement from
)
C++
public:
virtual void CopyFrom (
    ServiceModelExtensionElement^ from
) override
J#
public void CopyFrom (
    ServiceModelExtensionElement from
)
JScript
public override function CopyFrom (
    from : ServiceModelExtensionElement
)

Parameters

from

the transaction behavior to copy.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior Properties
[image]

Public Properties (see also Protected Properties)

 | Name | Description
public property | BehaviorType | Overridden. Gets the type of behavior for the inbound transaction.
public property | ConfigurationElementName | (inherited from ServiceModelExtensionElement)
public property | ElementInformation | (inherited from ConfigurationElement)
public property | LockAllAttributesExcept | (inherited from ConfigurationElement)
public property | LockAllElementsExcept | (inherited from ConfigurationElement)
public property | LockAttributes | (inherited from ConfigurationElement)
public property | LockElements | (inherited from ConfigurationElement)
public property | LockItem | (inherited from ConfigurationElement)
public property | TransactionIsolationLevel | Gets or sets the transaction isolation level.
public property | TransactionTimeout | Gets or sets the transaction timeout level.

Protected Properties

 | Name | Description
protected property | EvaluationContext | (inherited from ConfigurationElement)

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior.BehaviorType Property
[image]

Gets the type of behavior for the inbound transaction.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterInboundTransactionBehavior
Dim value As Type

value = instance.BehaviorType

Syntax

Visual Basic
Public Overrides ReadOnly Property BehaviorType As Type
C#
public override Type BehaviorType { get; }
C++
public:
virtual property Type^ BehaviorType {
    Type^ get () override;
}
J#
/** @property */
public Type get_BehaviorType ()
JScript
public override function get BehaviorType () : Type

Property Value

Returns a Type containing the behavior type.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior.TransactionIsolationLevel Property
[image]

Gets or sets the transaction isolation level.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterInboundTransactionBehavior
Dim value As IsolationLevel

value = instance.TransactionIsolationLevel

instance.TransactionIsolationLevel = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("transactionIsolationLevel", DefaultValue:=IsolationLevel.ReadCommitted)> _
Public Property TransactionIsolationLevel As IsolationLevel
C#
[ConfigurationPropertyAttribute("transactionIsolationLevel", DefaultValue=IsolationLevel.ReadCommitted)]
public IsolationLevel TransactionIsolationLevel { get; set; }
C++
[ConfigurationPropertyAttribute(L"transactionIsolationLevel", DefaultValue=IsolationLevel::ReadCommitted)]
public:
property IsolationLevel TransactionIsolationLevel {
    IsolationLevel get ();
    void set (IsolationLevel value);
}
J#
/** @property */
public IsolationLevel get_TransactionIsolationLevel ()

/** @property */
public void set_TransactionIsolationLevel (IsolationLevel value)
JScript
public function get TransactionIsolationLevel () : IsolationLevel

public function set TransactionIsolationLevel (value : IsolationLevel)

Property Value

Returns a IsolationLevel containing the isolation level.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


SqlAdapterInboundTransactionBehavior.TransactionTimeout Property
[image]

Gets or sets the transaction timeout level.

Namespace: Microsoft.Adapters.Sql
Assembly: Microsoft.Adapters.Sql (in Microsoft.Adapters.Sql.dll)

Usage

Visual Basic
Dim instance As SqlAdapterInboundTransactionBehavior
Dim value As TimeSpan

value = instance.TransactionTimeout

instance.TransactionTimeout = value

Syntax

Visual Basic
<ConfigurationPropertyAttribute("transactionTimeout")> _
Public Property TransactionTimeout As TimeSpan
C#
[ConfigurationPropertyAttribute("transactionTimeout")]
public TimeSpan TransactionTimeout { get; set; }
C++
[ConfigurationPropertyAttribute(L"transactionTimeout")]
public:
property TimeSpan TransactionTimeout {
    TimeSpan get ();
    void set (TimeSpan value);
}
J#
/** @property */
public TimeSpan get_TransactionTimeout ()

/** @property */
public void set_TransactionTimeout (TimeSpan value)
JScript
public function get TransactionTimeout () : TimeSpan

public function set TransactionTimeout (value : TimeSpan)

Property Value

Returns a TimeSpan containing the transaction timeout level.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

Target Platforms

The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); The 32-bit and 64-bit editions of Windows Server 2003 with SP2 (except the Web Edition); The 32-bit and 64-bit editions of Windows Server 2008 (except the Web Editions); The 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise, and Business editions; The 32-bit and 64-bit editions of Windows XP Professional with SP3; Windows Small Business Server 2003 with SP1 or SP2; Windows Small Business Server 2008

See Also

Reference

SqlAdapterInboundTransactionBehavior Class
SqlAdapterInboundTransactionBehavior Members
Microsoft.Adapters.Sql Namespace


Copyright Notice

Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2013 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, Active Directory, ActiveX, BizTalk, Excel, FrontPage, InfoPath, JScript, IntelliSense, MSDN, Outlook, PivotChart, PivotTable, Windows SharePoint Services, Tahoma, Visio, Visual Basic, Visual C++, Visual C#, Visual SourceSafe, Visual Studio, Win32, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

Enterprise integration patterns are taken from Enterprise Integration Patterns, by Gregor Hohpe and Bobby Woolf and the Pattern Catalog Table of Contents (http://go.microsoft.com/fwlink/?LinkID=62480) and are used under permission.

All other trademarks are property of their respective owners.