Last post Mar 15, 2011 02:56 PM by ignatandrei
Mar 15, 2011 11:54 AM|DaNuGai|LINK
I'm using the following method in my Global.asax file because I don't want to make a request to the database each time I want to obtain the current TermID, especially when it only changes 3 times a year. By using the method below, I can simply call Application("TermID")
on each page that needs it.
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim TermTA as New AppDataSetTableAdapters.TermTableAdapter
Application("TermID") = TermTA.GetCurrentTerm()
That being said, I'm not sure if this is the best way to approach this situation. If not, can someone explain what the best approach would be?
Mar 15, 2011 02:36 PM|ignatandrei|LINK
you can also put into Cache and set expiration time to 3 months...
Mar 15, 2011 02:48 PM|DaNuGai|LINK
Thanks for the quick reply.
Is there anything down side to what I'm doing in the code above?
Mar 15, 2011 02:56 PM|ignatandrei|LINK
No that I see now.