masmith
6/29/2006 10:14:00 PM
I have a ASP.NET web page with a SqlDataSource configured with the select
pointing to a stored procedure. This works as expected and using the
SqlDataSource_Selected event I test how many rows selected by:
Debug.WriteLine(e.AffectedRows);
When viewing the page I find the following:
When EnableCaching=False it returns the expected value of 2 (2 rows of data).
When EnableCaching=True and SqlCacheDependency=CommandNotification it
returns 0.
/***Stored procedure used by select***/
set ANSI_NULLS ON
set ANSI_PADDING ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_Test1_Sel]
AS
BEGIN
set ANSI_NULLS ON
set ANSI_PADDING ON
set ANSI_WARNINGS ON
set CONCAT_NULL_YIELDS_NULL ON
set QUOTED_IDENTIFIER ON
set NUMERIC_ROUNDABORT OFF
set ARITHABORT ON
Select ID, Name, ChangeDate, ChangeUserID, ListID From dbo.Test1 Order By ID
END
/*** ***/
I also have followed the instruction to enable SQL Server 2005 to support
this:
Enable SQL Server 2005 for Notificatgions:
(Assume you already hvae Notification Services installed)
/***Enable the .NET CLR***/
EXEC sp_configure 'show advanced options', '1'
go
reconfigure
go
EXEC sp_configure 'clr enabled', '1'
go
reconfigure
go
/***Enable Broker for database***/
Alter DATABASE <database name> SET ENABLE_BROKER
/***Grant permissions to sUBSCRIVE***/
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO <username>
Also the SQL Server 2005 is service is using "Network Service" for the logon
account.
Thanks,
--
Mark