SQL Server Notification Services
; http://en.wikipedia.org/wiki/SQL_Server_Notification_Services
wmi Sql table notification
; http://www.ureader.com/msg/14861679.aspx
Sample: Using the WMI Event Provider with the .NET Framework
; http://msdn.microsoft.com/en-us/library/ms179315.aspx
using System;
using System.Management;
class SQLWEPExample
{
public static void Main(string[] args)
{
string query = @"SELECT * FROM DDL_EVENTS " ;
// Default namespace for default instance of SQL Server
string managementPath =
@"\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER";
ManagementEventWatcher watcher =
new ManagementEventWatcher(new WqlEventQuery (query));
ManagementScope scope = new ManagementScope (managementPath);
scope.Connect();
watcher.Scope = scope;
Console.WriteLine("Watching...");
while (true)
{
ManagementBaseObject obj = watcher.WaitForNextEvent();
Console.WriteLine("Event!");
foreach (PropertyData data in obj.Properties)
{
Console.Write("{0}:", data.Name);
if (data.Value == null)
{
Console.WriteLine("<null>");
}
else
{
Console.WriteLine(data.Value.ToString());
}
}
Console.WriteLine("-----");
Console.WriteLine();
Console.WriteLine();
}
}
}
TreeNode 찾기 (0) | 2011.12.14 |
---|---|
c# InputBox (0) | 2011.12.14 |
File Transaction (0) | 2011.11.17 |
EscapeSequence (0) | 2011.11.17 |
WebClient Download Sample (0) | 2011.11.17 |