0

I'm trying to amend our content management system so it'll handle SQL database failures more gracefully. It's a bunch of ASMX pages, and a Helpers.vb file in which I've written a SQL connection tester function. Each of the ASMX pages call the same function.

I need to create a variable I can check that's persistent and performant, otherwise I'm going to have fall back on something disasterously slow like reading a text file every time I set up a sql connection string.

I've tried using application caching, but either it doesn't work in the context of my helpers.vb file, or I've made a mess of the syntax. One problem that's already stymied some of the approaches I've found via google - I can't use 'Import System.Web.Caching' - IntelliSense doesn't show the 'Caching' part.

Has anyone got any example code that might get me up and running? Or an alternative approach?

4

1 回答 1

0

@麦克风,

非常感谢,现在我正在正确使用 HttpRuntime.Cache ......它有效!

感谢大家花时间发帖:)

于 2013-03-06T11:30:42.570 回答