I was caching the results inside a DataSet using the SqlCacheDependency .
Called out a simple code in page load
string conn= WebConfigurationManager.ConnectionStrings["NorthwindEntities"].ConnectionString;
SqlConnection con = new SqlConnection(conn);
string query = "SELECT EmployeeID, FirstName, LastName, City FROM dbo.Employees";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter dadapter= new SqlDataAdapter(cmd);
DataSet usage :
DataSet ds = new DataSet();
dadapter.Fill(ds, "Employees");
And cached it as :
SqlCacheDependency empDependency = new SqlCacheDependency(cmd);
Cache.Insert("Employees", ds, empDependency, DateTime.Now.AddMinutes(10),Cache.NoSlidingExpiration);
However, I run the page, data loads in grid view and then I modify manually from SQLServer itself. I reload the page and the changed data is immediately visible.
Which line is creating issue OR is anything missing ?