TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Koteswararao Mallisetti
NA
817
563.5k
While i perfrom sqlcache dependency i got the dependency polling error
Sep 21 2010 3:06 AM
i am using the following code to achieve the sqlcache dependency but i got the error that is Unable to connect to SQL database 'koti' for cache dependency polling. in the sqlCacheDependency statement and i give the web.config setting as follows
if (Cache["states"] == null)
{
// Create the cache dependency
SqlCacheDependency dep = new SqlCacheDependency("koti", "states");
string connectionString =ConfigurationManager .ConnectionStrings[
"constrkoti"].ConnectionString;
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter("SELECT * from states", myConnection);
DataSet ds2 = new DataSet();
ad.Fill(ds2);
Label2.Text = "data is comming from database";
Cache.Insert("states", ds2, dep);
}
we.config:-
<connectionStrings>
<add name="constrKoti" connectionString ="data source=sparsh151/sqlexpress;database=koti;user id=sa;password=sparsh"/>
</connectionStrings>
<caching>
<sqlCacheDependency enabled="true ">
<databases>
<add connectionStringName ="constrkoti" name="koti" pollTime="500"/>
</databases>
</sqlCacheDependency>
</caching>
Reply
Answers (
2
)
Query in Access
Word document open issue