Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

Classe SqlDependency

The SqlDependency object represents a query notification dependency between an application and an instance of SQL Server 2005. An application can create a SqlDependency object and register to receive notifications via the OnChangeEventHandler event handler.

Namespace:  System.Data.SqlClient
Assembly:  System.Data (em System.Data.dll)
public sealed class SqlDependency

SqlDependency is ideal for caching scenarios, where your ASP.NET application or middle-tier service needs to keep certain information cached in memory. SqlDependency allows you to receive notifications when the original data in the database changes so that the cache can be refreshed.

To set up a dependency, you need to associate a SqlDependency object to one or more SqlCommand objects.To receive notifications, you need to subscribe to the OnChange event.For more information about the requirements for creating queries for notifications, see "Creating a Query for Notification" in SQL Server Books Online.

ObservaçãoObservação:

SqlDependency was designed to be used in ASP.NET or middle-tier services where there is a relatively small number of servers having dependencies active against the database.It was not designed for use in client applications, where hundreds or thousands of client computers would have SqlDependency objects set up for a single database server.

SqlDependency requires the .NET Framework version 2.0 and SQL Server 2005.Para obter mais informações, consulte Usando notificações de consulta e "Building Notification Solutions" no SQL Server Books Online.

ObservaçãoObservação:

O OnChange event may be generated on a different thread from the thread that initiated command execution.

System.Object
  System.Data.SqlClient.SqlDependency
Quaisquer membros static (Shared no Visual Basic) públicos deste tipo são thread-safe. Não há garantia de que qualquer membro de instância seja thread-safe.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.

.NET Framework

Compatível com: 3.5, 3.0, 2.0
Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.