Hello I had developed the below code to save the dataset in Global.asax
file. To consume that in webpage.aspx.vb
file, now it is working fine.
In the similar way, how could I call the stored procedure in Global.asax
?
Please help, Thank You in Advance!
Shared _cache As Cache = Nothing
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
_cache = Context.Cache
RefreshCache(Nothing, Nothing, 0)
End Sub
Private Shared Sub RefreshCache(ByVal key As String, ByVal item As Object, ByVal reason As CacheItemRemovedReason)
Dim adapter As New SqlDataAdapter("SELECT * FROM dbo.table where logid = 1", "server=server;database=database;uid=userid;pwd=password")
Dim ds As New DataSet()
adapter.Fill(ds, "Quotations")
Dim onRemove As CacheItemRemovedCallback
onRemove = New CacheItemRemovedCallback(AddressOf RefreshCache)
_cache.Insert("Quotes", ds, New CacheDependency("C:\AspNetSql\Quotes.Quotations"), Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.[Default], onRemove)
End Sub