November 6, 2008 at 1:24 pm
hi mates...
i am using the query notification service where i need to subscribe to anpther database table
in my scenario i having table A and table B
Table A having one source table
Table B will have
CREATE QUEUE [dbo].[WebSiteCacheMessages]
WITH STATUS = ON , RETENTION = OFF ,
ACTIVATION
( STATUS = ON , PROCEDURE_NAME = [dbo].[usp_insertmessage] , MAX_QUEUE_READERS = 1 , EXECUTE AS OWNER )
CREATE SERVICE [WebCacheNotifications]
AUTHORIZATION [dbo]
ON QUEUE [dbo].[WebSiteCacheMessages]
([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification])
CREATE ROUTE [WebCacheMessagesRoute]
AUTHORIZATION [dbo]
WITH SERVICE_NAME = N'WebCacheNotifications' ,
ADDRESS = N'LOCAL'
in dot application am doing
using (SqlConnection connection
= new SqlConnection("database=table2;server=10.100.106.21;Integrated Security=SSPI;"))
{
connection.Open();
SqlCommand command = connection.CreateCommand();
// command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "select [MinsToLiveExpressionCacheAlternate] from table1.dbo.SYSTEM_Settings";
command.Notification = new SqlNotificationRequest(Guid.NewGuid().ToString(), string.Format("Service=WebCacheNotifications;local database=table2"), 5000);
command.ExecuteNonQuery();
Console.WriteLine("Registered the notification.");
connection.Close();
}
it giving me a invalid message but if the table and service in same database it working perfectly..
can any one help me out ....
November 6, 2008 at 2:05 pm
can any one come up with solution pl....
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply