Database Change Notifications in ASP NET using SignalR and SqlDependency

mahmoud magdy · 43K views · 2016 · 15:06

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when they need a working example of SqlDependency plus SignalR for live database change notifications in ASP.NET.

Recommended by 1 people across 1 different months, 2017 to 2019.

What it is

A 15-minute tutorial by mahmoud magdy showing how to push real-time SQL Server data changes to an ASP.NET page using SignalR and the SqlDependency query notification object. It targets the case where a background process, such as a Windows service, updates the database and the UI must refresh live. A downloadable sample project is linked.

What people said

Recommends Phong Nguyễn · 2017-11 · Stack Overflow · on “After SqlDependency OnChange occur, I can't update my UI”

Thanks @EdwardN, after your suggest. I was think about SignalR and I received this video help me a lot: [this video]

Cites Charles · 2017-06 · Stack Overflow · on “Signalr and Devexpress”

I want to create a grid and automatic update it, when data changes in the database. It works with a simple table control. public partial class index : System.Web.UI.Page { static string connectionString = @"Data Source=*******;initial catalog=Test;persist security info=True; Integrated Security=SSPI;"; protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static IEnumerable<Person> GetData() { using (var connection = new SqlConnection(connectionString)) { connection.Open(); using (SqlCommand command = new SqlCommand(@"SELECT [Id],[Name] FROM [dbo].[Persons]", connection)) { command.Notification = null; SqlDependency.Start(connectionString); SqlDependency dependency = ne

Cites Rakesh Yadav · 2019-07 · Stack Overflow · on “SignalR not working with MVC But Working fine with webform”

SignalR Code Working in WebForm.aspx But Not Working With MVC Project It's Not working in mvc5 Visual Studio 2019,Not Showing Error and hub is not getting started.. i tried all posible solutions but coud not work i tried this Posible solution Also link are given below [this video] using SignalRArrayList.Models; using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Services; namespace SignalRArrayList.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult About() { ViewBag.Message = "Yo