网友您好, 请在下方输入框内输入要搜索的题目:
YouareemployedasaWebApplicationDeveloperatCertkiller.com.YoumakeuseofMicrosoft.NETFrameworkv3.5tocreateanASP.NETapplication.
Youcreateaclassintheapplicationthatcontainsthecodebelow.(Thelinenumbersisincludedforreferencepurposes)
01publicobjectGetCachedProducts(sqlConnectionconn){
02
03if(Cache["products"]==null){
04SqlCommandcmd=newSqlCommand("SELECT*FROMProducts",conn);
05conn.Open();
06Cache.Insert("products",GetData(cmd));
07conn.Close();
08}
09returnCache["products"];
10}
11
12publicobjectGetData(SqlCommandprodCmd){
13
14}
YounoticethattheGetCachedProductsmethodiscalledtoprovidethislistfromtheCacheobjecteverytimeaWebformhastoaccessalistofproducts.ToensureproductivitymanagementwantsyoutomakesurethatthereisalwaysalistofproductsavailableintheCacheobject.Youthusneedtodeterminetheappropriatecodethatshouldbeaddedinline13.
Whatshouldyouidentify?()
参考答案
更多 “ YouareemployedasaWebApplicationDeveloperatCertkiller.com.YoumakeuseofMicrosoft.NETFrameworkv3.5tocreateanASP.NETapplication.Youcreateaclassintheapplicationthatcontainsthecodebelow.(Thelinenumbersisincludedforreferencepurposes)01publicobjectGetCachedProducts(sqlConnectionconn){0203if(Cache[products]==null){04SqlCommandcmd=newSqlCommand(SELECT*FROMProducts,conn);05conn.Open();06Cache.Insert(products,GetData(cmd));07conn.Close();08}09returnCache[products];10}1112publicobjectGetData(SqlCommandprodCmd){1314}YounoticethattheGetCachedProductsmethodiscalledtoprovidethislistfromtheCacheobjecteverytimeaWebformhastoaccessalistofproducts.ToensureproductivitymanagementwantsyoutomakesurethatthereisalwaysalistofproductsavailableintheCacheobject.Youthusneedtodeterminetheappropriatecodethatshouldbeaddedinline13.Whatshouldyouidentify?() ” 相关考题
![瑞牛题库 章节练习 历年真题 模拟试卷](http://assets.51tk.com/51_sidebar_right_index.jpg)