It looks like you're missing a vital step:
5. Execute the command using any of the Execute
methods of the SqlCommand
object. Because the command is bound to the notification object, the server recognizes that it must generate a notification, and the queue information will point to the dependencies queue.
In other words, the notification isn't registered until the associated command is executed. Since you never execute the command, the notification isn't registered, and the change event is never raised.
using (SqlCommand command = (SqlCommand)GetCommand(Configurations.AsQueryable()))
{
SqlDependency dep = new SqlDependency(command);
dep.OnChange += (sender, args) =>
{
ConfigurationView.Changed(sender, args);
};
using (SqlDataReader reader = command.ExecuteReader())
{
}
}