.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net


I am trying to use SqlCacheDependency in my web site.

I got in touch with my hosting compnay and they said that they support cache but they set the trust level to medium and what I try to do needs full trust level whihch they cannot provide for me.

can someone show me a way or a code samples that use SqlCacheDependency with medium level trust?

the broker is enabled in the hosting sql server 

this code raise the error that the hosting providers said that they cannot support in medium level:


I have the tables needed in my developer SQL server , but I don't know how or if I can set it in the hosting SQL server db

and this is my code to get the data from cache or from DB that works on my developer station:

If Cache("allitems") Is Nothing Then
      Using dcdc As New DataClassesDataContext()

View Complete Post

More Related Resource Links

SqlCacheDependency, SQL Notifications, and Cache Expiration

I've spent the last few days trying to get caching working with my C# ASP.NET web application and SQL Sever 2005.  I'd like to take advantage of row-level caching by using a SqlCacheDependency on the SQL command used to fetch the row of data.  However, I can't seem to get it to work.From a high level I can retreive my data fine, get it into the cache, and then retrieve it just fine.  However, when the data is modified in the database, the cached object does not expire.  The best I can tell is that there are no SQL Notification subscriptions that are set up.  It appears that the broker service is set up on the database and I can see a SqlQueryNotificationService in the Queue and Services.  There don't seem to be any errors in the SQL log that I can find either.To set everything up on my database I did the following:Made sure that ENABLE_BROKER was set on the database (select is_broker_enabled from sys.databases where name = '<dbname>' returns 1)Set privaleges for my database user properly with:GRANT CREATE PROCEDURE TO <dbuser>GRANT CREATE QUEUE TO <dbuser>GRANT CREATE SERVICE TO <dbuser>GRANT SUBSCRIBE QUERY NOTIFICATIONS TO <dbuser>We typically use a data access layer for accessing our data, however, I wanted to test a stupid simple example of caching when I found I couldn't get it to work.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend