I am unable to get my pageload to update as I update the database table using SqlDependency. When I insert a new record into the desired table, the page fails to refresh it self.
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Cache Refresh: " +
DateTime.Now.ToLongTimeString();
// Create a dependency connection to the database.
SqlDependency.Start(GetConnectionString());
using (SqlConnection connection =
new SqlConnection(GetConnectionString()))
{
using (SqlCommand command =
new SqlCommand(GetSQL(), connection))
{
SqlCacheDependency dependency =
new SqlCacheDependency(command);
// Refresh the cache after the number of minutes
// listed below if a change does not occur ...
Go to the complete details ...