Cannot find the object “QueryNotificationErrorsQueue” because it does not exist or you do not have permissions

前端 未结 1 418
耶瑟儿~
耶瑟儿~ 2020-12-06 23:38

I am using SqlDependecy with signalR to push notifications to client browser when there is some database changes, I followed this and this post an

1条回答
  •  醉酒成梦
    2020-12-07 00:06

    In shared hosting because they restrict some features, so i was unable to use SqlDependency, but here is my solution to Play notifications without SqlDependency in asp mvc

    If you are new signalR, then first try this post to create simple chat web application.

    My requirement was to play notifications when new sales happens in shops

    1. Create SignalR Server Hub

    SignalR server hub class that sends messages to all clients browser.

    [HubName("PascalCaseNewSalesHub")]
    public class NewSalesHub : Hub
    {
    
        public void Send(string shopid)
        {
            // Call the alertNewSalesToPage method to update clients.
    
            Clients.All.alertNewSalesToPage(shopid);
        }
    
    }
    

    2. Javascript Send Method in PlaceOrder View

    When a customer places new order for this shop then the following javascript code Calls the Send method on the server hub to update clients.

    
    

    Used Howler.js Plugin to play notification , check this post.

    Hope helps someone.

    0 讨论(0)
提交回复
热议问题