




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、 數(shù)據(jù)庫課程設(shè)計姓 名: 學(xué) 號: 班 級:信息工程 102指導(dǎo)老師: 2021年7月1、 需求分析需求分析是程序設(shè)計中最關(guān)鍵的一個步驟,是其他步驟的基礎(chǔ)。其主要任務(wù)是“為了解決這個問題,目標(biāo)系統(tǒng)必須做什么”。主要確定目標(biāo)系統(tǒng)具有那些功能。在這個步驟里,程序員在用戶那里搜集所有的對將要開發(fā)的系統(tǒng)的需求信息,并且把這些信息編寫成為用戶和程序員都可以認(rèn)可的需求說明書??尚行匝芯?)技術(shù)可行性:因為該系統(tǒng)是要求是實現(xiàn)動態(tài)交互式的頁面設(shè)計及對數(shù)據(jù)庫的查詢、插入、刪除等操作,而本系統(tǒng)采用ASP技術(shù)設(shè)計網(wǎng)頁及使用數(shù)據(jù)庫來存儲數(shù)據(jù),所以技術(shù)上是可行的。2)經(jīng)濟可行性:開發(fā)本系統(tǒng)為用戶和管理員帶來了極大的方便
2、,而且所用的人力、物力、技術(shù)、資金等的花費不大,所以今后獲得的經(jīng)濟效益一定會大于開發(fā)成本。3)操作可行性:由于本聊天室是面向用戶的,所以任何注冊的用戶均可進入本系統(tǒng),操作方便。即時消息系統(tǒng)(InstantMessenger,IM)是一種在后PC時代興起的,以Internet網(wǎng)絡(luò)為基礎(chǔ)的,允許交互雙方即時地傳送文字、語音、視頻等信息,能夠跟蹤網(wǎng)絡(luò)用戶在線狀態(tài)的網(wǎng)絡(luò)應(yīng)用軟件。即時消息系統(tǒng)產(chǎn)生有著深刻的社會原因:人們都有渴望社交,獲得社會尊重、實現(xiàn)自我的需求,這正是即時消息軟件風(fēng)行的原動力,而物質(zhì)文明的日益發(fā)達所帶來副作用,又使得人們習(xí)慣與周圍的人保持距離,以致人們更愿意對陌生人敞開心扉,在網(wǎng)絡(luò)中可
3、以跨越年齡、身份、行業(yè)、地域的限制,達到人與人、人與信息之間的零距離交流。從這點上講,即時消息系統(tǒng)的出現(xiàn)改變了人們的溝通方式和交友文化,大大拓展了個人生活交流的空間。編寫本報告主要是為了對擬開發(fā)系統(tǒng)的系統(tǒng)功能,系統(tǒng)總體需求及開發(fā)系統(tǒng)的可行性進行分析,為決策者及系統(tǒng)開發(fā)人員提供是否開發(fā)該系統(tǒng)的依據(jù)和建議。2、 功能設(shè)計 用戶如果是首次登陸,需要注冊。注冊內(nèi)容為昵稱、年齡、密碼。在用戶登陸后,就可以進行聊天。具體的功能還有,查看聊天記錄,修改密碼、修改昵稱。如果登陸時,密碼不正確,會有提示密碼不正確,或者用戶名不存在,系統(tǒng)都會有提示。在數(shù)據(jù)庫中,用到了存儲過程、觸發(fā)器、與視圖。修改密碼后,會在視圖
4、中顯示出來;在調(diào)用存儲過程時,執(zhí)行觸發(fā)器,修改昵稱。3、 數(shù)據(jù)庫設(shè)計存儲過程:create proc 修改昵稱 newname varchar(10)asupdate 注冊 set 昵稱=newname 觸發(fā)器:create trigger 改昵稱 on 注冊for updateasdeclare newname char(10)select newname=昵稱 from insertedupdate 聊天記錄 set 昵稱=newnamewhere 昵稱 in (select 昵稱 from deleted)視圖:create view 修改密碼 as select 昵稱,密碼from 注
5、冊數(shù)據(jù)庫中的表有三張,分別為登陸表、注冊表、聊天記錄表。每次用戶登錄、注冊、聊天都會像數(shù)據(jù)庫中插入新數(shù)據(jù),而修改昵稱、密碼時,會進行數(shù)據(jù)庫的修改。4、 系統(tǒng)實現(xiàn) 登陸表聊天記錄表修改密碼表存儲過程修改昵稱觸發(fā)器登陸界面如下:代碼如下:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using
6、 System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class zhuce2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) /=連接數(shù)據(jù)庫= SqlConnection myConnection = new Sq
7、lConnection(); string mystr = Data Source=localhost;Initial Catalog=聊天室1;Integrated Security=true;User ID=;pwd=; myConnection.ConnectionString = mystr; myConnection.Open(); /=從數(shù)據(jù)庫中提取數(shù)據(jù)到DataSet中= SqlCommand myCommand = new SqlCommand(select * from 注冊, myConnection); SqlDataAdapter Adapter = new SqlDa
8、taAdapter(); Adapter.SelectCommand = myCommand; DataSet my_DataSet = new DataSet(); Adapter.Fill(my_DataSet);/通過SqlDataAdapter從數(shù)據(jù)源提取數(shù)據(jù),然后調(diào)用Fill方法將所提取的記錄存入DataSet中對應(yīng)的表內(nèi) string 昵稱 = TextBox1.Text.ToString().Trim(); string 年齡 = TextBox2.Text.ToString().Trim(); string 密碼 = TextBox4.Text.ToString().Trim(
9、); string sql1 = select count(*) from注冊 where 昵稱 = + 昵稱 + ; SqlCommand myCommand1 = new SqlCommand(sql1, myConnection); /int Num_count = (int)myCommand1.ExecuteScalar(); /if (Num_count = 0) / string sql2 = insert into 注冊(昵稱,年齡,密碼)values( + 昵稱 + , + 年齡 + , + 密碼 + ); SqlCommand myCommand2 = new SqlCom
10、mand(sql2, myConnection); myCommand2.ExecuteNonQuery(); Response.Write(alert(注冊成功!歡迎訪問!);); Server.Transfer(denglu.aspx); / / else / / Response.Write(alert(昵稱不能重復(fù)!抱歉,重來吧);); / Server.Transfer(denglu.aspx); / myConnection.Close(); 登陸界面如下:登陸界面代碼:using System;using System.Data;using System.Configuratio
11、n;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class denglu2 : System.Web.UI.Page protected void Page_Load(o
12、bject sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) Response.Redirect(zhuce.aspx); protected void Button2_Click(object sender, EventArgs e) /=連接數(shù)據(jù)庫= SqlConnection myConnection = new SqlConnection(); string mystr = Data Source=localhost;Initial Catalog=聊天室1;Integrated
13、Security=true;User ID=;pwd=; myConnection.ConnectionString = mystr; myConnection.Open(); /=從數(shù)據(jù)庫中提取數(shù)據(jù)到DataSet中= SqlCommand myCommand = new SqlCommand(select * from 注冊, myConnection); SqlDataAdapter Adapter = new SqlDataAdapter(); Adapter.SelectCommand = myCommand; DataSet my_DataSet = new DataSet();
14、Adapter.Fill(my_DataSet); /通過SqlDataAdapter從數(shù)據(jù)源提取數(shù)據(jù),然后調(diào)用Fill方法將所提取的記錄存入DataSet中對應(yīng)的表內(nèi) DataTable myTable = my_DataSet.Tables0; foreach (DataRow row in myTable.Rows ) if (row昵稱.ToString().Trim()=TextBox1.Text.Trim()&row密碼.ToString().Trim()=TextBox2.Text.Trim() ) string 昵稱 = TextBox1.Text.ToString().Tri
15、m(); string 密碼 = TextBox2.Text.ToString().Trim(); string sql2 = insert into 登錄(昵稱,密碼)values( + 昵稱 + , + 密碼 + ); SqlCommand myCommand2 = new SqlCommand(sql2, myConnection); myCommand2.ExecuteNonQuery(); Session昵稱 = TextBox1.Text.ToString().Trim(); Session密碼 = TextBox2.ToString().Trim(); myCommand2.Ex
16、ecuteNonQuery(); HttpCookie cookie = new HttpCookie(昵稱); cookie.Value = TextBox1.Text; cookie.Expires = DateTime.Now.AddDays(30); /保存30天 Response.Cookies.Add(cookie); Response.Write(alert(歡迎光臨我的聊天室!);); Response.Redirect(liaotian.aspx); /myConnection.Close(); return; Response.Write(alert(對不起,用戶不存在!)
17、;); myConnection.Close(); protected void TextBox1_TextChanged(object sender, EventArgs e) 聊天界面如下: using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebC
18、ontrols.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class liaotian2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) string name = Request.Cookies昵稱.Value; TextBox1.Text = TextB
19、ox1.Text + DateTime.Now+ +name + : + TextBox2.Text+ n; TextBox2.Text = ; /*SqlConnection myConnection = new SqlConnection(); string mystr = Data Source=localhost;Initial Catalog=聊天室1;Integrated Security=true;User ID=;pwd=; myConnection.ConnectionString = mystr; myConnection.Open(); /=從數(shù)據(jù)庫中提取數(shù)據(jù)到DataS
20、et中= */ string 昵稱 = name; /string 時間 = DateTime.Now string 內(nèi)容 = TextBox2.Text.ToString().Trim(); String sqlconn = Data Source=localhost;Initial Catalog=聊天室1;User ID=sa;pwd=;Integrated Security=True; SqlConnection myConnection = new SqlConnection(sqlconn); myConnection.Open(); string sql = insert int
21、o 聊天記錄(昵稱,時間,聊天內(nèi)容) values( + name + ,getdate(), + 內(nèi)容 + ); SqlCommand myCommand2 = new SqlCommand(sql, myConnection); myCommand2.ExecuteNonQuery(); myConnection.Close(); protected void Button2_Click(object sender, EventArgs e) protected void Button3_Click(object sender, EventArgs e) Server.Transfer(聊
22、天記錄.aspx); protected void Button4_Click(object sender, EventArgs e) Server.Transfer(改密碼.aspx); protected void TextBox2_TextChanged(object sender, EventArgs e) protected void Button5_Click(object sender, EventArgs e) Server.Transfer(修改用戶名.aspx); protected void Button6_Click(object sender, EventArgs e
23、) Response.Write(alert(安全退出!);); Server.Transfer(denglu.aspx); 查看聊天記錄:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using Syste
24、m.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class 聊天記錄 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) SqlConnection myConnection = new SqlConnection(); string mystr = Data Source=localhost;Initial Catalog=聊天室1;Integrated Security=true;User ID=;pwd=; my
25、Connection.ConnectionString = mystr; myConnection.Open(); SqlCommand myCommand = new SqlCommand(select * from 聊天記錄, myConnection); SqlDataReader myReader; / 實例化DataReader myReader = myCommand.ExecuteReader(); / SqlDataReader sqlDr = myCommand.ExecuteReader(); Response.Write(個人聊天數(shù)據(jù)); Response.Write()
26、; Response.Write(); for (int i = 0; i myReader.FieldCount; i+) Response.Write( + myReader.GetName(i) + ); Response.Write(); while (myReader.Read() Response.Write(); for (int i = 0; i myReader.FieldCount; i+) Response.Write( + myReaderi.ToString() + ); Response.Write(); Response.Write(); /關(guān)閉SqlDataRe
27、ader myReader.Close(); /關(guān)閉與數(shù)據(jù)庫的連接 myConnection.Close(); 修改昵稱修改昵稱using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.
28、UI.HtmlControls;using System.Data.SqlClient;public partial class Default2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button2_Click(object sender, EventArgs e) String sqlconn = Data Source=localhost;Initial Catalog=聊天室1;User ID=sa;pwd=;Integrated Security
29、=True; SqlConnection myConnection = new SqlConnection(sqlconn); myConnection.Open(); string sql_用戶名 = TextBox1.Text.ToString().Trim(); string new_用戶名 = TextBox2.Text.ToString().Trim(); string sql1 = select count(*) from 注冊 where 昵稱 = + sql_用戶名 + ; SqlCommand myCommand1 = new SqlCommand(sql1, myConne
30、ction); int Num_count = (int)myCommand1.ExecuteScalar(); if (Num_count = 0) Response.Write(alert(昵稱不存在,請重新輸入);); Server.Transfer(修改用戶名.aspx); else string sql3 = select count(*) from 注冊 where 昵稱 = + new_用戶名 + ; SqlCommand myCommand = new SqlCommand(sql3, myConnection); int count = (int)myCommand.Exec
31、uteScalar(); if (count = 0) string sql2 = update 注冊 set 昵稱= + new_用戶名 + ; SqlCommand myCommand2 = new SqlCommand(sql2, myConnection); myCommand2.ExecuteNonQuery(); Response.Write(alert(修改成功!);); Server.Transfer(denglu.aspx); myConnection.Close(); 修改密碼頁面:using System;using System.Data;using System.Co
32、nfiguration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class 改密碼 : System.Web.UI.Page protected void Page_
33、Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) SqlConnection myConnection = new SqlConnection(); string mystr = Data Source=localhost;Initial Catalog=聊天室1;Integrated Security=true;User ID=;pwd=; myConnection.ConnectionString = mystr; myConnection.Open(); st
34、ring 昵稱 = TextBox1.Text.ToString().Trim(); string SQL_密碼 = TextBox2.Text.ToString().Trim(); string sql1 = select count(*) from 修改密碼 where 昵稱 = + 昵稱 + ; SqlCommand myCommand1 = new SqlCommand(sql1, myConnection); int Num_count = (int)myCommand1.ExecuteScalar(); if (Num_count != 0) string sql2 = updat
35、e 修改密碼 set 密碼= + SQL_密碼+ ;+ SqlCommand myCommand2 = new SqlCommand(sql2, myConnection); myCommand2.ExecuteNonQuery(); Response.Write(alert(注冊成功!歡迎訪問!);); Server.Transfer(denglu.aspx); else Response.Write(alert(用戶名不存在!);); Server.Transfer(修改密碼.aspx); 五、總結(jié)有關(guān)于此次課程設(shè)計的心得體會,總的來說,受益匪淺。在這些天中,我們學(xué)到了很多東西,包括建表,
36、導(dǎo)入數(shù)據(jù),查詢,插入。最重要的是我們有機會用電腦自己進行實踐,沒接觸的時候總是覺得它比較深奧或是不可接近的新型語言,剛開始就是建立數(shù)據(jù)庫,兩種驗證模式,緊接著就是觸發(fā)器的使用,進而對數(shù)據(jù)庫高級的使用。從課程的學(xué)習(xí)和實驗當(dāng)中我了解到,表是數(shù)據(jù)庫數(shù)據(jù)當(dāng)中最重要的一個數(shù)據(jù)對象,表建立的好壞直接關(guān)系到數(shù)據(jù)庫的實際使用效果,表當(dāng)中的內(nèi)容越具體對表越有利,同時對數(shù)據(jù)庫的各種應(yīng)用也有著各種各樣的便利,但是表的內(nèi)容也不能過于的繁瑣,當(dāng)然,這些也只能在今后的實際使用當(dāng)中多多的應(yīng)用,才能加深和理解如何對表進行規(guī)劃才更有利于使用和查詢。在數(shù)據(jù)庫中,數(shù)據(jù)內(nèi)容的查詢可以使用查詢語句的方法查詢,也可以使用視圖操作的方法進
37、行查詢,使用視圖操作的方法不僅可以簡化數(shù)據(jù)操作,同時還可以檢索數(shù)據(jù),在查詢時還能向基表當(dāng)中添加、修改和刪除數(shù)據(jù),能有效的提高數(shù)據(jù)庫可用性和安全性。SQL Server的學(xué)習(xí)是在老師的悉心教導(dǎo)和上機實驗實踐當(dāng)中度過的,經(jīng)過短暫的學(xué)習(xí),讓我學(xué)會了很多知識,對于我今后的人生和工作有很多有用有幫助的地方,感謝老師的教導(dǎo),讓我又多掌握了一項專業(yè)的技術(shù),我會在今后更加努力的學(xué)習(xí)這方面的專業(yè)技術(shù)知識,勤于實踐、不斷提高,以適應(yīng)時代的發(fā)展,更好的把握未來。 教師見習(xí)報告總結(jié)期待已久的見習(xí)已經(jīng)結(jié)束了,在龍巖三中高中部見習(xí)聽課,雖然只是短短的兩個星期,但感觸還是蠻深的,以前作為一名學(xué)生坐在課室聽課,和現(xiàn)在作為一名
38、準(zhǔn)教師坐在課室聽課是完全不同的感受,感覺自己學(xué)到了一些在平時課堂上學(xué)不到的東西。在這里,我獲得的不僅是經(jīng)驗上的收獲,更多是教學(xué)管理,課堂教學(xué)等的理念,以及他們帶給我的種種思考。教育見習(xí)實踐過程:聽課。教育見習(xí)的主要目的是讓學(xué)生在指導(dǎo)教師的引導(dǎo)下,觀摩教師上課方法、技巧等。聽課是教育見習(xí)的主要內(nèi)容。我院規(guī)定在一周的見習(xí)中需完成至少6課的見習(xí)任務(wù)。我在教師的安排指導(dǎo)下,分別對高一、高二物理專業(yè)課型為主,其他課型齊頭的方式,積極主動的完成了聽課任務(wù),收到良好的效果。我聽的第一節(jié)課是高二(8)班,這是一個平衡班,水平不如實驗班高。在上課前。科任老師已經(jīng)跟我說了這個班的紀(jì)律是比較差的,而且成績也不是很好
39、。在我聽課期間,確實有幾個學(xué)生在課堂上說話,但是我發(fā)現(xiàn)了一個有趣的現(xiàn)象,這個現(xiàn)象我在往后的幾個班都發(fā)現(xiàn)了,就是絕大部分的學(xué)生的學(xué)習(xí)熱情都好高漲,積極舉手發(fā)言,積極參與課堂活動。我跟老師們提起這個現(xiàn)象的時候,科任老師就跟我說,一個班里不可能所有的學(xué)生都能全神貫注地聽完一節(jié)課,所以作為一名教師,應(yīng)該想辦法吸引學(xué)生的注意力,調(diào)動的積極性,比如可以以小組為單位,以搶答計分的形式調(diào)動學(xué)生的積極性,這樣課堂氣氛就會活躍起來了。在為期兩周的見習(xí)工作中,我真的有很大的感觸,我第一次感受到自己已經(jīng)從一名學(xué)生向一名教師靠近,走在校園里,每當(dāng)有學(xué)生叫我一聲老師,我在感到無比自豪的同時,還感受到了自己的責(zé)任。見習(xí)工作結(jié)束了,我要回到學(xué)校繼續(xù)我的學(xué)習(xí)了,但是我會好好記住我從*中學(xué)學(xué)到的一切,并應(yīng)用于我的專業(yè)學(xué)習(xí)中去。一、教學(xué)管理理念在龍巖三中,從領(lǐng)導(dǎo)階層到一位普通的科任老師,都秉承以學(xué)生為主體的宗旨進行學(xué)校的管理,進行教學(xué)工作的開展。作為一個課程改革的示范學(xué)校,一個教育實驗基地。這所學(xué)校鼓勵著老師做各種研究,各種改革。每個班主任都有著自己的管理經(jīng)驗與管理宗旨。有了這種思想的自由,自然這里也就充滿著探索與嘗試,從而有所創(chuàng)造與進步。在我見習(xí)的班集體中,班主任對他的學(xué)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 老年人養(yǎng)生秘訣
- 大數(shù)據(jù)應(yīng)用開發(fā)(java)1+X練習(xí)題+參考答案解析
- 9月計算機網(wǎng)絡(luò)基礎(chǔ)試題及參考答案解析
- 《初中作文輔導(dǎo)課件-機智的小狐貍》
- 船舶維修企業(yè)技術(shù)創(chuàng)新與成果轉(zhuǎn)化考核試卷
- 設(shè)計師的國際視野與跨文化交流考核試卷
- 2025年高強2號玻璃纖維布項目建議書
- 涂料市場競爭優(yōu)勢分析與提升考核試卷
- 焙烤工藝的創(chuàng)新與發(fā)展考核試卷
- 米制食品的加工工藝研究與改進考核試卷
- 《重疊問題》-徐長青
- 數(shù)據(jù)治理策略與框架
- 安全檢查表完整版本
- 加拉帕戈斯群島的生物
- 酒店客房前廳接待考核表
- 平凡世界課件
- 課件吸煙有害健康
- JCT412.1-2018 纖維水泥平板 第1部分:無石棉纖維水泥平板
- 15D501 建筑物防雷設(shè)施安裝
- 表C.1.1 工程概況表(例)
- E3X-ZD11型光纖放大器
評論
0/150
提交評論