Giovanni
5/24/2006 6:15:00 PM
Hi Folks,
Quick question: I have placed a GridView and SQLDataSource control in
a web user control. The SQLDataSource is bound to a parameterized stored
procedure. Consequently, the web user control is placed into a WebPartZone.
On the SQLDataSource, I have set the following properties: EnableCaching =
True, and set the SQLCacheDependency = CommandNotification. I have also
enabled the Service Broker on my SQL Server 2005 database. I also call the
SqlClient.SqlDependency.Start and SqlClient.SqlDependency.Stop Dependency in
the Global.asax file in the Application_Start and Application_End event. As
far as I know, my SQL Select commands (stored proc.'s) are compliant with all
the rules for creating a notification query.
Through SQL Profiler, I can see that caching works whenever I Add or
Delete a row from the table to which the SQLDataSource's stored procedure is
tied to. My page gets refreshed properly from the database instead of the
cache. If I were to UPDATE a row or field within a row (not add or delete),
my app does not get this new notification. I assume that this is because the
rowset count has not changed.
Am I doing something wrong? Is the caching meant to work with field
updates or only add/delete type updates as they change the rowset? Is there
anything I have to add? From what I have read thusfar, I need not include
any code to take advantage of the new caching features, only modify the 2
SQLDataSource properties.
Regards,
Giovanni P.