《網(wǎng)絡(luò)程序設(shè)計(jì)》實(shí)驗(yàn)報(bào)告-Exp3_第1頁(yè)
《網(wǎng)絡(luò)程序設(shè)計(jì)》實(shí)驗(yàn)報(bào)告-Exp3_第2頁(yè)
《網(wǎng)絡(luò)程序設(shè)計(jì)》實(shí)驗(yàn)報(bào)告-Exp3_第3頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、啊絡(luò)12卄-u!1、數(shù)據(jù)服務(wù)(訪問)層類代碼namespace lalalapublic class studentdata: laleiwebmodules.datadbobjcctpublic studentdata(string newconnectionstring):base(newcorinectionstring)public dataset getstudentinfo()return runsp(,/pro_get, new tdataparameter , "studenttno_get/public bool delctcstudcnt (int studcnt

2、id)sqlparcimeter parameters = newsqlparameter (,/studentid, sqldbtype. int);parameters0value = studentid;int rowsaffected;runsp("pro delete: parameters, out rowsaffected):return rowsaffee ted 二 1;2、業(yè)務(wù)邏輯層類代碼namespace lalalapub 1ic class stude: laiciwebmodules.businessbi力objectpublic static datas

3、et getstudentlnfo()newstudentdatasd=studentdata(lalei. webmodules. global. sqlconnectionstring);return sd gctstudcntlnfoo :public static bool deletestudent(int studentid)studentdatasd=newstudentdata(lalei. webmodules. global. sqlconnectionstring);return sddeletestudent (studentid);3、前臺(tái)表示層調(diào)用代碼namespa

4、ce lalalapublic partial class webla : system. web. ul. pageprotected void page load(object sender, eventargs e) protected void buttonl click(object sender, eventargs e)this. gridviewl. datasource = studentbi z. getstudenttnfoo. tables01 ;this. gridviewl. databind();protected void button4_c1ick(objec

5、t sender, eventargs e)int studentid = convert. toint32(this. txt_studentid. text);if (studentbiz. deletestudent(studentid)this. txt_shuoming. text ="成功刪除編號(hào)為"+ studentid + "學(xué)生的記錄! “; this. buttonl click(sender, c);elsethis, txt shuoming. text ="刪除編號(hào)為"+ studentid + "學(xué)生的記錄

6、失敗! ”;4、web主頁(yè)面截圖(1)獲取學(xué)生信息圖mbdcirdamibjxkltim*124王鑰勇1764|0?51woo?52011*7 4 8-41 %23!804102251992012!2013 u 8:40 3s25張華165410225199032412013.4 842 1028女1604io224i992o2342013.7 4 8 42 282016$4105l»l«802013 "21 10 5131女170410223199304212013 4 8 42 4432唐禮2004i0225wu9542013/7 4 $ 43 25入佗皂井遇

7、擇操作 學(xué)*(2)刪除罟號(hào)為24的學(xué)生的信息圖慮擊秩jr學(xué)生1見成功砂編號(hào)為2詳牛的記錄!itmuatidmx231804j022siw2012i2013 74s 403125女16$41022519903241201 4 8 42:10”女16041o2241wo23420b74s42-2s20q花165410225199165&02obt4 21 ios1)117020b7 41 4? 4432g禮2004102251991893420b7/4s4j:25st入低念井超1撮悵c 25、比較實(shí)驗(yàn)二、三進(jìn)行網(wǎng)絡(luò)程序設(shè)計(jì)的優(yōu)缺點(diǎn)答:做出來看的效果是一樣的。三層架構(gòu):1)表現(xiàn)層(ui):通

8、俗講就是展現(xiàn)給用戶的界面,即用戶在使用一個(gè)系統(tǒng)的時(shí)候他的所見 所得。2)業(yè)務(wù)邏輯層(bll):針對(duì)具體問題的操作,也可以說是對(duì)數(shù)據(jù)層的操作,對(duì)數(shù)據(jù)業(yè)務(wù) 邏輯處理。3)數(shù)據(jù)訪問層(dal):該層所做事務(wù)直接操作數(shù)據(jù)庫(kù),針對(duì)數(shù)據(jù)的增添、刪除、修改、 更新、查找等。區(qū)別:1)三層用戶不能看到你訪問數(shù)據(jù)庫(kù)的代碼,單層就能看到,安全性大大提高2)單層的維護(hù)起來不如三層架構(gòu)的方便。3)三層的可以做到各司其職,互不干擾。三層有這么幾個(gè)優(yōu)點(diǎn):1)不會(huì)把數(shù)據(jù)庫(kù)的結(jié)構(gòu)和關(guān)鍵代碼暴露出來。2)代碼復(fù)用性高,實(shí)際開發(fā)時(shí)可以互不干擾,修改也方便。單層的話修改一處可能就會(huì)引 起大量的修改,增加工作量。缺點(diǎn):1)降低了系統(tǒng)的性能。這是不言而喻的。如果不采用分層式結(jié)構(gòu),很多業(yè)務(wù)可以直接造訪 數(shù)據(jù)庫(kù),以

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論