專題 ASP.NET + DB
|
|
- 君 汪
- 6 years ago
- Views:
Transcription
1 ASP.NET + 資料庫 建國科技大學資管系饒瑞佶 2015/9 V1 2016/3 V2
2 幾件一定要會的事 資料庫架構 SQL 指令.NET 資料庫存取架構
3 資料庫種類 檔案式 vs. Server 式 階層式 網狀式 關聯式 NOSQL
4 資料庫系統 資料庫 資料庫管理者 應用程式
5 資料庫 內容 SQL Server (server 式 ) 使用北風 (Northwind) 或 POS 範例資料庫 ASP.NET 資料庫設計模式 資料庫安全 SQL Injection 大小寫驗證 密碼強度等
6 匯入範例資料庫到 SQL Server
7 SQL Server 最新版 SQL Server 2014 有 Express 版本可以使用 管理工具為 SQL Server Management Studio
8 連結 SQL Server 管理方式 透過 SQL Server 管理工具 Management Studio 帳號 + 密碼 (SQL Server 驗證 ) Windows 驗證 透過 VS.Net Client 端連結工具 伺服器總管
9 SQL Server Management Studio
10 2 種驗證模式 SQL Server 驗證 需要帳號密碼 支援遠端連線 Windows 驗證 需要 Windows 管理者權限 忘記帳密時使用 伺服器名稱 : IP 或電腦名稱 \SQLEXPRESS 先試試 Windows 驗證, 確定 SQL Server 活著
11 SQL Server 驗證 IP 驗證方式 帳號 密碼
12 操作技巧答案在左邊, 答案在右鍵
13 SQL Server 附加 / 卸離資料庫 mdf 與 ldf 檔案需要成對
14 附加時若有錯誤 一般是權限問題 請將 mdf 與 ldf 檔案的權限開給 users, 並設定成完全控制即可
15 關閉 SQL Server
16 關閉 SQL Server
17 轉移或備份 SQL Server 資料庫 需要同時搬移或備份 mdf 與 ldf 兩個檔案 可能的位置 ( 要看當初安裝時設定的目錄 ) C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA 搬移或備份時應先關閉 SQL Server
18 加入留言板資料庫與資料表 留言主表 (Guestbook) 與副表 (Reply) 設定關聯
19 設定關聯
20 設定資料庫權限
21 SQL Server 權限 帳號決定可以使用的權限 : 未來就用這組帳號密碼登入與使用資料庫 存取權限 : 只能查詢資料 可以修改資料 可以修改結構 各資料庫可以設定各自的帳號 密碼與權限
22 SQL Server 權限 新增帳號 目前大家使用這組帳號
23 SQL Server 權限 帳號請自行設定 密碼請自行設定 是否可以使用權限 設定帳號原則
24 SQL Server 權限 設定帳號可以使用的資料庫 ( 可複選 ) 存取權限 資料 : db_datareader db_datawriter 結構 : db_owner
25 .NET 連結資料庫基本觀念
26 資料庫程式設計的基本概念 有人幫忙連接資料庫 ( 資料庫連接物件 ) 有人幫忙執行 SQL 指令 有人幫忙顯示 ( 介面設計與顯示物件 ) 但問題是 : 資料庫那麼多, 怎麼處理? 有沒有簡易的方法?
27 ASP.NET 資料庫設計模式 DB ADO.NET CommandBuilder 物件 Connection 物件 Command 物件 DataAdapter 物件 DataReader 物件 ExecteNonQuery 可異動資料 DataReader 物件 ExecuteReader 唯讀 DataSet 物件 On-line 線上作業模式 Off-line 離線作業模式
28 設計方式 建構在 ADO.NET 架構上 使用工具箱中既有物件 ( 拖拉放 + 設定模式 ) 自己寫程式處理所有細節
29 先來個簡單的拖拉放 資料庫 << SQL Server 有人幫忙連接 ( 資料庫連接物件 ) 與執行 SQL 指令 SqlDataSource 物件 有人幫忙顯示 ( 介面設計與顯示物件 ) GridView 物件
30 兩個物件就搞定
31 設定連線資料庫 連線字串
32 資料庫連線設定 這裡選擇剛建立的留言板資料庫
33 這裡最好要勾 Yes, 將資料存在 web.config 內以後統一使用, 維護也比較方便
34 注意 連線字串只要一個, 存放在 web.config 內就好, 以後才好維護 有兩種取用方式 透過物件 透過程式
35 連線字串 連線字串的格式要根據不同資料庫而定 那裡可以找到連線字串的說明?
36 怎麼用 we.config 內的連線呢? 當初存入 we.config 內的名稱 String connstr = System.Web.Configuration.WebConfigurationManager.Connecti onstrings["connectionstringctumenu"].connectionstring.tos tring(); SqlConnection dbconn = new SqlConnection(connstr);
37 SQL 指令 新增刪除修改查詢都在這裡
38 設定顯示物件 GridView
39 先執行看看 沒有刪除與修改?
40 結果
41 加上新 / 刪 / 修 / 查 方法 1: 可以不用會 SQL 指令
42 刪除與修改出現了 勾起來後執行看看
43 結果 刪除加入確認詢問? 欄位轉成 TemplateField 設定 onclientclick 屬性 =return confirm( 確定要刪除? );
44 加上新 / 刪 / 修 / 查 方法 2: 自己寫 SQL 指令
45 一個 SQL 指令範例
46 透過 DetailsView 物件做新增
47 首先 GridView 開啟 Selection
48 設定 SqlDataSource2 直接選剛存的那個連線字串這樣大家就都共用同一個連線方式
49
50 DetailsView 連接到 SqlDataSource2
51 問題 如果到此都設定好了 那新 / 刪 / 修 / 查都有了 透過 DetailsView 新增 / 刪除後, 並沒有重整 GridView 畫面
52 重整畫面 選事件 重新讓 GridView 連結 SqlDataSource 就可以
53 欄位加入檢查條件
54 欄位加入檢查條件
55 DetailsView 加入控制項 以 Calendar 為例 protected void Calendar1_SelectionChanged(object sender, EventArgs e) { TextBox tt = (TextBox)DetailsView1.FindControl("Add_Day"); Calendar cc=(calendar)detailsview1.findcontrol("calendar1"); tt.text = cc.selecteddate.toshortdatestring() + " " + System.DateTime.Now.ToShortTimeString();
56 GridView 加入控制項 以 Calendar 為例 protected void Calendar2_SelectionChanged(object sender, EventArgs e) { TextBox tt = (TextBox)GridView1.Rows[rowIndex].FindControl("TextBox3"); Calendar cc = (Calendar)GridView1.Rows[rowIndex].FindControl("Calendar2"); tt.text = cc.selecteddate.toshortdatestring() + " " + System.DateTime.Now.ToShortTimeString(); static int rowindex; // 取得目前要修改的編號 protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { rowindex = e.neweditindex;
57 自己設計對應的新增版面 放在 Panel 中
58 自己設計對應的新增版面, 再對應到 InsertQuery 指令 Sqldatasource InsertQuery
59 日期另外處理 設定參數對應的物件
60 新增程式 protected void Button3_Click(object sender, EventArgs e) { SqlDataSource1.Insert(); Panel1.Visible = false;
61 處理留言空白與 enter( 新增 ) 首先修改新增參數 原來的參數設定要取消 protected void SqlDataSource1_Inserting(object sender, SqlDataSourceCommandEventArgs e) 處理新增 { e.command.parameters["@usercontent"].value = TextBox3.Text.Replace(" "," ").Replace("\n","<br>"); e.command.parameters["@contentday"].value = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
62 處理留言空白與 enter( 顯示 ) 將 usercontent 欄位轉成 template
63 處理留言空白與 enter( 顯示 ) protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.row.rowtype == DataControlRowType.DataRow) { var lbldi = e.row.findcontrol("label1") as Label; // 內容 if (lbldi!= null) { lbldi.text = lbldi.text.tostring().replace("\n", "<br />"); 如果存入資料庫時沒有處理 \n
64 結果
65 加入查詢 需要版面 需要動態 SQL 指令 要想辦法把命令轉給 SqlDataSource 物件
66 程式只要一行 改變 sql 指令就可以 protected void Button1_Click(object sender, EventArgs e) { SqlDataSource1.SelectCommand = "select * from Guestbook where title like '%" + TextBox1.Text + "%'"; 所以已經很方便了, 但 SQL 指令還是不能省
67 GridView 物件其他操作
68 依條件改變狀態 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { // 設定列的寬度 if (e.row.rowtype == DataControlRowType.Header) { e.row.cells[0].width = 400; // 維護欄位 e.row.cells[0].backcolor = System.Drawing.Color.CornflowerBlue; e.row.cells[1].width = 200; // 編號 e.row.cells[2].width = 300; // 姓名 e.row.cells[3].width = 300; // 帳號 e.row.cells[4].width = 300; // 密碼 e.row.cells[5].width = 300; // 年齡 // 依據狀態設定列的顏色 if (e.row.rowtype!= DataControlRowType.DataRow) return; if (e.row.cells[11].text == " 有效 ") { e.row.backcolor = System.Drawing.Color.GreenYellow; else { e.row.backcolor = System.Drawing.Color.Pink; // 停權
69 圖片 放入其他物件
70 按鈕物件 放入其他物件
71 GridView 加入 Button 取得主鍵 PK protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.commandname == "abc") { int rowindex = int.parse(e.commandargument.tostring()); string val = this.gridview1.datakeys[rowindex].value.tostring(); Response.Write(val);
72 顯示照片 照片放在資料庫外 照片放在資料庫內
73 照片在資料庫外 先加入 ImageField 轉換成 TemplateField 設定連結照片所在外部的位置
74 透過 Generic Handler 照片在資料庫內
75 ImageHandler.ashx 照片在資料庫內 public class ImageHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { string imageid = context.request.querystring["imid"]; SqlConnection con = new SqlConnection("Data Source= ;Initial Catalog=POS;Persist Security Info=True;User ID=sa;Password=1234"); con.open(); SqlCommand cmd = new SqlCommand("select picin from product where p_id=" + imageid, con); SqlDataReader dr = cmd.executereader(); dr.read(); context.response.binarywrite((byte[])dr[0]); con.close(); context.response.end(); public bool IsReusable { get { return false;
76 照片在資料庫內 先加入 TemplateField 加入 Image 物件 設定 DataBindings
77 將圖片存入資料庫 使用 FileUpload 物件
78 將圖片存入資料庫 // Save files to Folder and files path in database protected void btnupload_click(object sender, EventArgs e) { //Condition to check if the file uploaded or not if (fileupload1.hasfile) { int length = fileupload1.postedfile.contentlength; byte[] imgbyte = new byte[length]; HttpPostedFile img = fileupload1.postedfile; //set the binary data img.inputstream.read(imgbyte, 0, length); string filename = Path.GetFileName(fileUpload1.PostedFile.FileName); using (SqlConnection con = new SqlConnection(strCon)) { using (SqlCommand cmd = new SqlCommand()) { cmd.commandtext = "insert into MyImage (imagename,imagedata) values(@name,@data)"; cmd.parameters.addwithvalue("@name", filename); cmd.parameters.addwithvalue("@data", imgbyte); cmd.connection = con; con.open(); cmd.executenonquery(); con.close(); BindGridviewData();
79 檔案上傳 FileUpload 物件 ( 單一檔案 ) // 檔案上傳 Boolean fileok = false; String path = Server.MapPath("~/images/" + Session["modifyStoreID"] + "/"); if (FileUpload1.HasFile) { String fileextension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower(); String[] allowedextensions = { ".gif", ".png", ".jpeg", ".jpg" ; for (int i = 0; i < allowedextensions.length; i++) { if (fileextension == allowedextensions[i]) { fileok = true; 接下頁
80 檔案上傳 if (fileok) { try { FileUpload1.PostedFile.SaveAs(path + FileUpload1.FileName); Label6.Text = " 檔案上傳完成!"; listimages(); catch (Exception ex) { Label6.Text = " 檔案無法上傳!"; else { Label6.Text = " 檔案格式錯誤!";
81 多檔案一次上傳 一定要.net framework 4.5 以上
82 // 檔案上傳 Boolean fileok = false; String path = Server.MapPath("~/images/" + Session["modifyStoreID"] + "/"); HttpFileCollection uploadedfiles = Request.Files; Label6.Text = string.empty; for (int i = 0; i < uploadedfiles.count; i++) { HttpPostedFile userpostedfile = uploadedfiles[i]; try { if (userpostedfile.contentlength > 0) { // 限制檔案大小, 限制為 2MB int filesize = userpostedfile.contentlength; if (filesize > ) { Label6.Text = " 檔案大小上限為 2MB, 目前上傳的檔案 [" + userpostedfile.filename + "] 超過大小, 無法上傳 "; return; userpostedfile.saveas(path + "\\" + Path.GetFileName(userPostedFile.FileName)); fileok = true; catch (Exception Ex) { Label6.Text += "Error: <br>" + Ex.Message; fileok = false; 接下頁
83 if (fileok) { try { FileUpload1.PostedFile.SaveAs(path + FileUpload1.FileName); Label6.Text = " 檔案上傳完成!"; listimages(); catch (Exception ex) { Label6.Text = " 檔案無法上傳!"; else { Label6.Text = " 檔案格式錯誤!";
84 改用 ListView 顯示
85 ListView 連結 DB 透過 SqlDataSource 物件 ( 直接設定連結就可以 ) 設定後並不會出現資料, 還需要設定 ListView 顯示資料
86 設定 ListView 顯示資料 Configure ListView
87 每列顯示筆數如果改變, 要記得同時設定 ItemTemplate 與 AlternatingItemTemplate 設定 ListView
88 設定 ListView 顯示資料 預覽 顯示樣式 外觀 啟用功能
89 result 自動就會有新增 / 刪除 / 修改功能
90 加入搜尋功能 protected void Button1_Click(object sender, EventArgs e) { SqlDataSource1.SelectCommand = "select * from customer where c_name like '%" + TextBox1.Text + "%'";
91 修改介面 例如修改預設按鈕文字 要設定 ItemTemplate 與 AlternatingTemplate
92 Image 可以直接設定 Binding 加入其他物件 Table 1x2 做排版 Button
93 Bind Image 資料庫內儲存照片檔名 ( 位置在 server 內固定位置, 例如 images)
94 透過 ListView 新增圖片 (I) 在 InsertTemplate 中加入 fileupload 控制項
95 透過 ListView 新增圖片 (II) 將要顯示圖片名稱欄位的輸入框 (id=xyz) 之 ClientIDMode 屬性設定為 Static 透過 JavaScript 將 Fileupload 選擇的圖片名稱顯示到輸入框內 <asp:fileupload ID="FileUpload1" runat="server" OnDataBinding="FileUpload1_DataBinding" onchange="getfilename(this.value);" /> <script> function getfilename(file) { // 檔案名稱 var filename = file.replace(/^.*[\\\/]/, '') document.getelementbyid('xyz').value = filename; </script>
96 透過 ListView 新增圖片 (II) Code in Insert button
97 protected void InsertButton_Click(object sender, EventArgs e) { FileUpload fu = (FileUpload)ListView1.InsertItem.FindControl("FileUpload1"); Boolean fileok = false; String path = Server.MapPath("~/images/"); if (fu.hasfile) { String fileextension = System.IO.Path.GetExtension(fu.FileName).ToLower(); String[] allowedextensions = { ".gif", ".png", ".jpeg", ".jpg" ; for (int i = 0; i < allowedextensions.length; i++) { if (fileextension == allowedextensions[i]) { fileok = true; if (fileok) { try { fu.postedfile.saveas(path + fu.filename); catch (Exception ex) { else { Code in Insert button
98 Bind Button 要抓到 ListView 內繫結的物件 ( 如 Button) 事件, 要設定 Button 的 CommandArgument 設定按下後要取得的值
99 撰寫 Button 事件 要取得上一頁的 p_id, 要用的是 Button_Command 事件, 而不是 Button_Click 事件
100 ListView + Session 購物車
101 Session 購物車 確定已經設定按鈕的 CommandArgument DataTable Cart = new DataTable(); // 存放購物車 DataRow objdr; // 每筆購物項目 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["ShoppingCart"] = ""; Response.Write("<script>alert(' 請選擇您要購買的物品 ');</script>");
102 如果要加入數量選擇或輸入到 ListView 將購買按鈕的事件改為 ListView1_ItemCommand 找到 TextBox2 var txt = ListView1.Items[e.Item.DataItemIndex].FindControl("TextBox2") as TextBox; 選擇的項目 index
103 購物按鈕 (I) protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e) { var txt = ListView1.Items[e.Item.DataItemIndex].FindControl("TextBox2") as TextBox; if (Session["ShoppingCart"]=="") { // 購物車為空, 需要建立 DataTable 的結構 // 產品編號 Cart.Columns.Add(new DataColumn("ItemID",typeof(int))); // 數量 Cart.Columns.Add(new DataColumn("Quantity", typeof(int))); objdr = Cart.NewRow(); // 產生新列 objdr["itemid"] = e.commandargument; // 產品編號 objdr["quantity"] = txt.text; // 數量 Cart.Rows.Add(objDR); else
104 購物按鈕 (II) else { // 取出目前購物車內容, 判斷是否已經加入? Cart = (DataTable)Session["ShoppingCart"]; Boolean blnmatch = false; // 紀錄是否已經加入購物車 foreach(datarow objdr in Cart.Rows){ if (objdr["itemid"].tostring()==e.commandargument.tostring()) { int newnum = Convert.ToInt16(objDR["Quantity"]) + Convert.ToInt16(txt.Text); objdr["quantity"] = newnum; // 數量 blnmatch = true; break; if (!blnmatch) // 沒有買過 { objdr = Cart.NewRow(); // 產生新列 objdr["itemid"] = e.commandargument; // 產品編號 objdr["quantity"] = txt.text; // 數量 Cart.Rows.Add(objDR); Session["ShoppingCart"] = Cart; Response.Write(e.CommandArgument + " 已經加入購物車 ");
105 檢視購物車 protected void Button4_Click(object sender, EventArgs e) { // 檢視購物車 if (Session["ShoppingCart"]!= "") { Cart = (DataTable)Session["ShoppingCart"]; foreach (DataRow objdr in Cart.Rows) { Response.Write(" 編號 =" + objdr["itemid"] + "/ 數量 =" + objdr["quantity"] + "</br>"); else{ Response.Write(" 目前購物車是空的!"); 可以自己定義版面
106 寫程式連資料庫
107 再看回 ASP.NET 資料庫設計模式 DB ADO.NET CommandBuilder 物件 Connection 物件 Command 物件 DataAdapter 物件 DataReader 物件 ExecteNonQuery 可異動資料 DataReader 物件 ExecuteReader 唯讀 DataSet 物件 On-line 線上作業模式 Off-line 離線作業模式
108 上圖的物件是大架構 表示跟資料庫種類無關 可是現實是, 資料庫種類不完全相同 那要怎麼處理呢? 微軟把個別資料庫連結方式做分類, 放在名稱空間內 (namespace) 需要時再叫進來就可以 依據不同資料庫, 會在物件前面加上適當的冠詞
109 ADO.NET ADO.NET 是用來存取資料庫的物件集合 核心命名空間 : 一般 : System.Data, System.Data.Common SQL Server: System.Data.SqlClient Oracle: System.Data.OracleClient OleDB: System.Data.OleDb (Access) ODBC: System.Data.Odbc 利用 Using 指令參考 ADO.NET 物件
110 以 ON-LINE MODE 讀取資料為例
111 DB On-line mode CommandBuilder 物件 Connection 物件 Command 物件 DataAdapter 物件 DataReader 物件 ExecteNonQuery 可異動資料 DataReader 物件 ExecuteReader 唯讀 DataSet 物件 On-line 線上作業模式 Off-line 離線作業模式
112 DataReader 透過 DataReader 物件可以逐一讀取資料 DataReader = 只能下一筆 唯讀的讀取 根據要求將記錄以串流的方式傳回用戶端 佔用資料庫連線, 使用伺服端資源直到連線關閉 用戶端 DataReader 記錄 record record 資料庫引擎
113 資料庫存取五步驟 ADO.NET 存取資料時, 使用以下五大步驟 : 1. Using ADO.NET 物件 ( 依資料庫種類而定 ) 2. 開啟資料庫連線 DBMS+DB 層 (CONNECTION 物件 ) 3. 進行資料庫操作 ( 讀取 / 寫入 ) TABLE 層 (COMMAND+DATAREADER 物件 ) 4. 顯示資料 5. 關閉資料庫連線
114 DataReader 資料存取示意圖 DBMS DB TABLE CONNECTION 物件負責連結 DBMS 與 DB COMMAND 物件負責 SQL 指令 SQL SERVER 1. SERVER 位置 2. 帳號 3. 密碼 4. DATABASE Access 1. DATABASE DataReader 物件負責取出 DATA 連線字串
115 對應 (I) 1. Using ADO.NET 物件 ( 依資料庫種類而定 ) 2. 開啟資料庫連線 DBMS+DB 層 程式需要的是這個連線字串
116 對應 (II) 1. 進行資料庫操作 ( 讀取 / 寫入 ) TABLE 層 (COMMAND+DATAREADER 物件 ) 程式需要的是 SQL 指令
117 自己透過 Panel 顯示結果 // 連結資料庫 SqlConnection dbconn = new SqlConnection( 連線字串 "); dbconn.open(); // 開啟資料庫 SqlCommand dbcmd = new SqlCommand( SQL 指令 ", dbconn); SqlDataReader dbreader = dbcmd.executereader(); String result = "<table width='100%' border=1><tr>"; // 建立表格 // 顯示表頭 for (int col = 0; col < dbreader.fieldcount; col++) { result += "<td>" + dbreader.getname(col).tostring() + "</td>"; result += "</tr>"; // 顯示資料 while (dbreader.read()) { result += "<tr>"; for (int col = 0; col < dbreader.fieldcount; col++) { result += "<td>" + dbreader[dbreader.getordinal(dbreader.getname(col).tostring())].tostring() + "</td>"; result += "</tr>"; result += "</table>"; dbconn.close(); // 關閉資料庫 Panel1.Controls.Add(new LiteralControl(result));
118 改成用 Class 方式運作?
119 需要繼承 MyPage.cs 使用 DBOperation.cs 與 MyPage.cs // 設定起始事件, 設定 DB 連線字串 protected void Page_Init(object sender, EventArgs e) { // 設定連線字串 constr = 連線字串 "; // 設定要操作的 table name tablename = "product"; // 設定主 key pk = "p_id"; // 設定搜尋欄位 schfield = "p_name";
120 表單中需要加入 利用其與 javascript 溝通 <div> <input type="hidden" name=" EVENTTARGET" id=" EVENTTARGET" value="" /> <input type="hidden" name=" EVENTARGUMENT" id=" EVENTARGUMENT" value="" /> <script type="text/javascript"> //<![CDATA[ var theform = document.forms['form1']; if (!theform) { theform = document.form1; function dopostback(eventtarget, eventargument) { if (!theform.onsubmit (theform.onsubmit()!= false)) { theform. EVENTTARGET.value = eventtarget; theform. EVENTARGUMENT.value = eventargument; theform.submit(); //]]> </script> </div>
121 離線模式 protected void Page_Load(object sender, EventArgs e) { binddata("select * from customer"); private void binddata(string sql) { SqlConnection dbconn = new SqlConnection( 連線字串 "); dbconn.open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(sql, dbconn); da.fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); dbconn.close();
122 ON-LINE MODE 異動資料
123 ExecuteNonQuery 透過以下三種 SQL 語法來修改資料庫資料 新增 :INSERT 修改 :UPDATE 刪除 :DELETE 透過 ExecuteNonQuery() 方法 回傳修改的資料筆數 用戶端 Command 資料庫引擎
124 異動資料程式結構 與查詢的程式結構一樣要使用 ExecuteNonQuery 方法 SqlCommand dbcmd = new SqlCommand( SQL 指令 ", dbconn); dbcmd.executenonquery(); 需要依照新 / 刪 / 修寫的 SQL 指令
125 動態 SQL 指令 1. 用假資料先寫出正確的 SQL 指令 2. 用程式取代假資料 3. 用雙引號將程式與原 SQL 指令切開 4. 用加號將切開位置串起來 把最後完成的結果貼回程式內的 Command 物件
126 動態 SQL 指令 1. 用假資料先寫出正確的 SQL 指令 Select * from customer where c_name like % 小 % 2. 用程式取代假資料 Select * from customer where c_name like %TextBox1.Text% 3. 用雙引號將程式與原 SQL 指令切開 Select * from customer where c_name like % TextBox1.Text % 4. 用加號將切開位置串起來 Select * from customer where c_name like % + TextBox1.Text + %
127 小練習 來將登入登出改成實際可用的 使用線上模式寫程式來達成! 讓欄位區分大小寫檢查 COLLATE Chinese_Taiwan_Stroke_CS_AI Select * from Users where u_account COLLATE Chinese_Taiwan_Stroke_CS_AI=@id and u_pwd COLLATE Chinese_Taiwan_Stroke_CS_AI=@pwd
128 改寫登入 String connstr = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["POSConne ctionstring"].connectionstring.tostring(); SqlConnection dbconn = new SqlConnection(connstr); dbconn.open(); SqlCommand dbcmd = new SqlCommand("select * from customer where c_account=@c_account and c_pwd=@c_pwd", dbconn); dbcmd.parameters.addwithvalue("@c_account", TextBox1.Text); dbcmd.parameters.addwithvalue("@c_pwd", TextBox2.Text); SqlDataReader dbreader = dbcmd.executereader(); // 判斷帳號密碼 if(dbreader.read()){ // 改變 / 設定 session Session["iflogin"] = "1"; Session["loginuserid"] = dbreader[dbreader.getordinal("c_id")]; // 跳到設定畫面 Response.Redirect("NewBuycart.aspx"); dbconn.close(); else { Response.Write("<script>alert(' 帳號密碼錯誤 ');</script>"); dbconn.close();
129 SQL Injection 資料隱碼攻擊 SQL 指令的漏洞 or 1=1 or 1=1 or 1= ' or ''=' 取代有問題的字元 - / 等
130 避免 SQL Injection private string fixsql(string sql) { sql = sql.replace("'", ""); sql = sql.replace("\\", "//"); sql = sql.replace("-", "_"); sql = sql.replace("*", "_"); sql = sql.replace("+", "_"); return sql; 制輸入的長度降低 sql server 使用者權限至少不幸被入侵, 只是修改或刪除記錄而不會整個 database 被刪除
131 避免 SQL Injection 改用 ASP.NET 參數方式帶入 String UID = TextBox1.Text; String UPWD = TextBox2.Text; 參數 dbcmd.parameters.add("@id", SqlDbType.NVarChar).Value = fixsql(uid); dbcmd.parameters.add("@pwd", SqlDbType.NVarChar).Value = fixsql(upwd); SqlCommand dbcmd = new SqlCommand("Select * from Users where u_account COLLATE Chinese_Taiwan_Stroke_CS_AI=@id and u_pwd COLLATE Chinese_Taiwan_Stroke_CS_AI=@pwd and u_active=1", dbconn); 表示要區分大小寫
132 購物車結帳 // 產生單號 string news_id = System.DateTime.Now.ToString("yyyyMMddHHmmss"); String connstr = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["POSConnectionString "].ConnectionString.ToString(); SqlConnection dbconn = new SqlConnection(connstr); dbconn.open(); // 建立主單 SqlCommand dbcmd = new SqlCommand("insert into sales (s_id,c_id,s_day,s_memo) values (@s_id,@c_id,@s_day,@s_memo)", dbconn); dbcmd.parameters.addwithvalue("@s_id", news_id); dbcmd.parameters.addwithvalue("@c_id", Session["loginuserid"].ToString()); dbcmd.parameters.addwithvalue("@s_day", System.DateTime.Now); dbcmd.parameters.addwithvalue("@s_memo", ""); dbcmd.executenonquery(); // 寫入明細 Cart = (DataTable)Session["ShoppingCart"]; foreach (DataRow objdr in Cart.Rows) { dbcmd = new SqlCommand("insert into sales_detail (s_id,p_id,amount,price) values (@s_id,@p_id,@amount,@price)", dbconn); dbcmd.parameters.addwithvalue("@s_id", news_id); dbcmd.parameters.addwithvalue("@p_id", objdr["itemid"]); dbcmd.parameters.addwithvalue("@amount", objdr["quantity"]); dbcmd.parameters.addwithvalue("@price", "123"); dbcmd.executenonquery(); dbconn.close(); Session["ShoppingCart"] = ""; Cart.Clear();
133 練習 1 製作一個註冊的表單 加入 Validation 檢查 必要輸入 帳號密碼不可以一樣 輸入長度檢查 ^[\s\s]{6,10$ 密碼強度 ( 大小寫至少 1, 混合數字, 長度 6~10) ^(?=.*\d)(?=.*[a-z])(?=.*[a-z]).{6,10$ 格式等
untitled
12-1 -2 VC# Web Blog 12-1 -1-1 12-1.1-1 C:\ ChartModuleSample_CSharp\Application\2001\ Files\ 4096 KB 120 Web.Config httpruntime maxrequestlength executiontimeout 12-2
More informationuntitled
Data Source 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 8-1 Data Source 8-2 Data Source 8-3 Data Source 8-4 Data Source 8-5 DataSourceID 8-6 DataSourceMode 8-7 DataSource 8-8 8-9 Parameter Direction
More information投影片 1
資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection
More informationuntitled
1 Access 料 (1) 立 料 [] [] [ 料 ] 立 料 Access 料 (2) 料 [ 立 料 ] Access 料 (3) 料 料 料 料 料 料 欄 ADO.NET ADO.NET.NET Framework 類 來 料 料 料 料 料 Ex MSSQL Access Excel XML ADO.NET 連 .NET 料.NET 料 料來 類.NET Data Provider
More information導讀 ASP.NET HTML ASP 第一篇 基礎篇第 1 章 認識 ASP.NET ASP.NET ASP.NET ASP.NET ASP.NET 第 2 章 認識 Visual Studio 20 開發環境 Visual Studio 20 Visual Studio 20 第二篇 C# 程式
導讀 ASP.NET HTML ASP 第一篇 基礎篇第 1 章 認識 ASP.NET ASP.NET ASP.NET ASP.NET ASP.NET 第 2 章 認識 Visual Studio 20 開發環境 Visual Studio 20 Visual Studio 20 第二篇 C# 程式語言篇第 3 章 C# 程式語言基礎 C# C# 3.0 var 第 4 章 基本資料處理 C# x
More informationuntitled
1 .NET 料.NET 料 料來 類.NET Data Provider SQL.NET Data Provider System.Data.SqlClient 料 MS-SQL OLE DB.NET Data Provider System.Data.OleDb 料 Dbase FoxPro Excel Access Oracle Access ODBC.NET Data Provider 料
More informationuntitled
1 Access 料 (1) 立 料 [] [] [ 料 ] 立 料 Access 料 (2) 料 [ 立 料 ] Access 料 (3) 料 料 料 料 料 料 欄 ADO.NET ADO.NET.NET Framework 類 來 料 料 料 料 料 Ex MSSQL Access Excel XML ADO.NET 連 .NET 料.NET 料 料來 類.NET Data Provider
More information2 ADO.NET Internet 1.2
C H A P T E R 1 ADO.NET XML ADO.NET ADO.NET.NET Framework.NET XML ADO.NET.NET Microsoft Visual Studio 200 ADO.NET ADO.NET 2 ADO.NET 1 1.1 1.1 1.1 1.2 Internet 1.2 1.1 Internet 2 1.2 (Internet) Web 1. ADO.NET
More information教案模板4-2
传 智 播 客 ASP.NET 就 业 实 例 教 程 教 学 设 计 课 程 名 称 :ASP.NET 就 业 实 例 教 程 授 课 年 级 : 2015 年 级 授 课 学 期 : 2015 学 年 第 二 学 期 教 师 姓 名 : 某 某 老 师 2015 年 02 月 02 日 课 题 名 称 第 2 章 ADO.NET 计 划 学 时 6 课 时 内 容 分 析 教 学 目 标 及 基
More informationADO.NET 資料庫存取架構
資料庫離線存取模式 建國科技大學資管系饒瑞佶 ADO.NET 資料庫存取架構 DataSet DataSet 是一個放在記憶體中的資料結構 將資料庫的結構與資料複製到記憶體中, 用表格的方式來儲存 減少資料庫負擔與增加存取效率 容易進行取得 傳遞與顯示裡面的資料 需要額外的同步機制 記憶體 DataAdapter Command Connection DB Product Price Quantity
More information第一章 章标题-F2 上空24,下空24
Web 9 XML.NET Web Web Service Web Service Web Service Web Service Web Service ASP.NET Session Application SOAP Web Service 9.1 Web Web.NET Web Service Web SOAP Simple Object Access Protocol 9.1.1 Web Web
More informationuntitled
1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart
More information主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new
ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,
More informationuntitled
1 LinkButton LinkButton 連 Button Text Visible Click HyperLink HyperLink 來 立 連 Text ImageUrl ( ) NavigateUrl 連 Target 連 _blank _parent frameset _search _self 連 _top 例 sample2-a1 易 連 private void Page_Load(object
More information目錄
資 訊 素 養 線 上 教 材 單 元 五 資 料 庫 概 論 及 Access 5.1 資 料 庫 概 論 5.1.1 為 什 麼 需 要 資 料 庫? 日 常 生 活 裡 我 們 常 常 需 要 記 錄 一 些 事 物, 以 便 有 朝 一 日 所 記 錄 的 事 物 能 夠 派 得 上 用 場 我 們 能 藉 由 記 錄 每 天 的 生 活 開 銷, 就 可 以 在 每 個 月 的 月 底 知
More information6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM
CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986
More information一 個 SQL Injection 實 例 的 啟 示 頁 2 / 6 因 此, 在 知 名 網 站 上 看 到 SQL Injection, 讓 人 驚 心, 卻 不 意 外 網 站 專 案 外 包 是 目 前 業 界 的 常 態, 而 在 價 格 取 勝 的 制 度 下, 低 價 得 標 的 S
一 個 SQL Injection 實 例 的 啟 示 頁 1 / 6 你 的 網 站 在 裸 奔 嗎? 一 個 SQL Injection 實 例 的 啟 示 作 者 : 李 明 儒 SQL Injection( 資 料 隱 碼 攻 擊 ) 問 題 早 就 不 是 什 麼 新 聞, 但 前 陣 子 在 一 個 頗 具 知 名 度 的 活 動 網 站 上, 赫 然 發 現 它 大 刺 刺 地 現 身!
More information第 一 章 資料庫概念
授課老師 : 洪瑞展 2015/11/5 1 1. 讓讀者瞭解 ADO.NET 的架構及運作原理 2. 讓讀者瞭解 ADO.NET 與資料庫的連接方式 存取方法 2015/11/5 2 18-1 ADO.NET 的簡介 18-2 命名空間的引用 18-3 使用 DataReader 物件讀取資料庫的資料 18-4 使用 DataSet 物件來讀取資料 18-5 DataSet 物件的資料庫操作 2015/11/5
More information2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF
Chapter 2 WF 2.1 WF 2.2 2. XAML 2. 2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF WF WF WF WF EDI API WF Visual Studio Designer 1 2.1 WF Windows Workflow Foundation 2 WF 1 WF Domain-Specific
More informationMicrosoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
More information<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>
packages 3-31 PART 3-31 03-03 ASP.NET ASP.N MVC ASP.NET ASP.N MVC 4 ASP.NET ASP.NE MVC Entity Entity Framework Code First 2 TIPS Visual Studio 20NuGetEntity NuGetEntity Framework5.0 CHAPTER 03 59 3-3-1
More information1-1 database columnrow record field 不 DBMS Access Paradox SQL Server Linux MySQL Oracle IBM Informix IBM DB2 Sybase 1-2
CHAPTER 1 Understanding Core Database Concepts 1-1 database columnrow record field 不 DBMS Access Paradox SQL Server Linux MySQL Oracle IBM Informix IBM DB2 Sybase 1-2 1 Understanding Core Database Concepts
More informationASP.NET实现下拉框二级联动组件
ASP.NET 实现下拉框二级联动组件 namespace WebApplicationDlh using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Db; / / Area 的摘要说明 /
More information<463A5CC2A4B6ABD1A7D4BA5CBDCCD1A7D6B8C4CFD7DC5CA1B656697375616C20432320B3CCD0F2C9E8BCC6A1B7BFCEB3CCD6B8C4CF2E646F63>
目 录 Visual C# 程 序 设 计 课 程 指 南 计 算 机 科 导 论 课 程 指 南 8 计 算 机 网 络 基 础 课 程 指 南 4 网 络 工 程 课 程 设 计 课 程 指 南 0 网 络 应 用 与 实 践 课 程 指 南 4 ADO.net 课 程 指 南 7 C 程 序 设 计 课 程 指 南 数 字 信 号 处 理 DSP 课 程 指 南 9 电 子 电 路 EDA 技
More informationRUN_PC連載_12_.doc
PowerBuilder 8 (12) PowerBuilder 8.0 PowerBuilder PowerBuilder 8 PowerBuilder 8 / IDE PowerBuilder PowerBuilder 8.0 PowerBuilder PowerBuilder PowerBuilder PowerBuilder 8.0 PowerBuilder 6 PowerBuilder 7
More information(Microsoft PowerPoint -
Windows 程式設計 ADO.NET 資料存取 ( 一 ) 講師 : 林賢達 Peter.lin@imestech.com 課程大綱 安裝 SQL Server 2005 Express Edition RDBMS 基礎概念 測試資料庫簡介 ADO.NET 概述 Connection 物件與 Command 物件 Parameters 集合物件 DataReader 物件 資料繫結 RDBMS
More informationMicrosoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f
Web Chapter 22 SharePoint Web Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web 21 22-1 SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f Views.asmx View SharePoint
More informationuntitled
1 .NET sln csproj dll cs aspx 說 料 料 利 來 料 ( 來 ) 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Click 滑 料 Response 列 料 Response HttpResponse 類 Write 料 Redirect URL Response.Write("!!
More informationRUN_PC連載_8_.doc
PowerBuilder 8 (8) Web DataWindow ( ) DataWindow Web DataWindow Web DataWindow Web DataWindow PowerDynamo Web DataWindow / Web DataWindow Web DataWindow Wizard Web DataWindow Web DataWindow DataWindow
More informationuntitled
1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form
More informationuntitled
Inside ASP.NET 2.0- ASP.NET 1.1 2. 理念 讀 了 了 度 讀 了 理 類 來 來說 流 了 來 來 來 來 理 來 不 讀 不 不 力 來參 流 讀 了 異 行 來了 錄 行 不 了 來 了 來 行 論說 了 更 不 例 來了 力 行 樂 不 說 兩 例 利 來 了 來 樂 了 了 令 讀 來 不 不 來 了 不 旅行 令 錄 錄 來 了 例 來 利 來 ManagerProvide
More information概述
OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3
More information使用手冊
使用手冊 版權所有 2013 年 Microtek International, Inc. 保留所有權利 商標 Microtek MII MiiNDT ScanWizard Microtek International, Inc. Windows Microsoft Corporation 重要須知 Microtek Microtek Windows Microsoft Windows I49-004528
More information<4D6963726F736F667420576F7264202D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F303632352E646F63>
上 海 市 高 等 学 校 计 算 机 等 级 考 试 ( 三 级 ) 考 试 大 纲 -- 建 议 稿 -- 2007-6-25 25 目 录 上 海 市 高 等 学 校 计 算 机 等 级 考 试 三 级 总 体 说 明 -----------------1 三 级 ( 计 算 机 系 统 与 网 络 技 术 ) 考 试 大 纲 ---------------------2 三 级 ( 管 理
More informationuntitled
1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立
More information投稿類別:資訊類
投稿類別 : 資訊類 篇名 : 打造一個簡易的留言板 使用 ASP.NET 作者 : 吳宗儒 高雄市立高級工業職業學校 資訊科二年級 指導老師 : 陳彥良老師 壹 前言 一 研究動機 在網路上, 我們可以看到許多的網站上都設有一個留言版, 而這個留言版設置的用意就是為了能了解使用者的想法, 若我們要自己製作出一個留言版, 應該要如何製作與設計? 在這邊我們採用了 ASP.NET 搭配 Visual
More information建立Android新專案
經濟部工業局 Android 智慧型手機程式設計實務應用班 Android WebService 建國科技大學資管系 饒瑞佶 2012/4 WebService 需要 ksoap2-android-assembly-2.5.2-jar-withdependencies.jar 或 ksoap2-android-assembly-2.5.2-jar-withdependencies_timeout1.jar
More information1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->
目录 1 大概思路... 1 2 创建 WebAPI... 1 3 创建 CrossMainController 并编写... 1 4 Nuget 安装 microsoft.aspnet.webapi.cors... 4 5 跨域设置路由... 4 6 编写 Jquery EasyUI 界面... 5 7 运行效果... 7 8 总结... 7 1 1 大概思路 创建 WebAPI 创建 CrossMainController
More information多媒體應用 13 新增專案並完成版面配置 <ExMusic01> <activity_main.xml> ImageView ID imgplay ImageView ID imgstop ImageView ID imgfront TextView ID txtsong TextView ID t
設定存取 SD 卡的權限 SD SD 13.1.4
More information投影片 1
1 ASP.NET 互動式網頁程式設計 ( 使用 C#) CSIE NTU 實例探討 sample3-a1 (1) 2 程式功能 建立與資料庫間的連線 程式內容 protected void Page_Load(object sender, EventArgs e) { Response.Write(" 尚未連線.."); Response.Write(" 進行連線.."); AccessDataSource
More informationMicrosoft Word - PHP7Ch01.docx
PHP 01 1-6 PHP PHP HTML HTML PHP CSSJavaScript PHP PHP 1-6-1 PHP HTML PHP HTML 1. Notepad++ \ch01\hello.php 01: 02: 03: 04: 05: PHP 06:
More informationuntitled
JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE
More informationuntitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
More informationuntitled
ADF Web ArcGIS Server ADF GeocodeConnection control 4-2 Web ArcGIS Server Application Developer Framework (ADF).NET interop semblies.net Web ADF GIS Server 4-3 .NET ADF Web Represent the views in ArcMap
More information投影片 1
計算機程式及實習 期末報告 題目 : 六宿炒翻天 班級 : 奈米一乙姓名 : 陳洋翼學號 :4A514050 老師 : 謝慶存 程式說明 設計結帳系統, 選擇數量後, 在按下計算, 將會顯示總金額 若是老人或小孩, 將可享 8 折或 9 折的優惠 程式畫面 填選數量 在火腿蛋炒飯的數量選擇 1, 並按下計算, 可得總金額 50 元 程式畫面 打折 填選完後, 若客人是小孩或老人, 選擇欲打折項目,
More information目錄 C ontents Chapter MTA Chapter Chapter
目錄 C ontents Chapter 01 1-1 MTA...1-2 1-2...1-3 1-3...1-5 1-4...1-10 Chapter 02 2-1...2-2 2-2...2-3 2-3...2-7 2-4...2-11...2-16 Chapter 03 3-1...3-2 3-2...3-8 3-3 views...3-16 3-4...3-24...3-33 Chapter
More informationRunPC2_.doc
PowerBuilder 8 (5) PowerBuilder Client/Server Jaguar Server Jaguar Server Connection Cache Thin Client Internet Connection Pooling EAServer Connection Cache Connection Cache Connection Cache Connection
More information《大话设计模式》第一章
第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜
More informationFileMaker 15 ODBC 和 JDBC 指南
FileMaker 15 ODBC JDBC 2004-2016 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. / FileMaker WebDirect FileMaker, Inc. FileMaker
More informationAL-M200 Series
NPD4754-00 TC ( ) Windows 7 1. [Start ( )] [Control Panel ()] [Network and Internet ( )] 2. [Network and Sharing Center ( )] 3. [Change adapter settings ( )] 4. 3 Windows XP 1. [Start ( )] [Control Panel
More informationOracle高级复制配置手册_业务广告_.doc
Oracle 高 级 复 制 配 置 手 册 作 者 : 铁 钉 Q Q: 5979404 MSN: nail.cn@msn.com Mail: nail.cn@msn.com Blog: http://nails.blog.51cto.com Materialized View Replication 复 制 模 式 实 现 了 单 主 机 对 多 个 复 制 站 点 的 数 据 同 步. 在 主
More informationRUN_PC連載_10_.doc
PowerBuilder 8 (10) Jaguar CTS ASP Jaguar CTS PowerDynamo Jaguar CTS Microsoft ASP (Active Server Pages) ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar Server ASP
More informationMicrosoft PowerPoint - VB14.ppt
VB 列表盒 LISTBOX 應用 資科系 林偉川 執行畫面 1 2 1 重要屬性 LISTBOX 物件 (VB6) 新增至 LISTBOX 物件中 ADDITEM 自 LISTBOX 物件中刪除選取物件 REMOVEITEM 自 LISTBOX 物件中取出選取物件 ListIndex 顯示 LISTBOX 物件中紀錄個數 Listcount 3 LISTBOX 物件 (VB.NET) 重要屬性 新增至
More information第七章
6-1 ADO.NET 簡介 ADO.NET 是微軟.NET 平台所提供的新世代資料存取技術,ADO.NET 的原文是 ActiveX Data Objects for the.net Framework (ADO.NET); 而 ADO.NET 是包含在.NET Framework 之中, 可以透過 ADO.NET 的資料存取技術來存取包括資料庫 XML 和應用程式的資料 所以本章將會利用到 SQL
More informationFileMaker 16 ODBC 和 JDBC 指南
FileMaker 16 ODBC JDBC 2004-2017 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. FileMaker WebDirect FileMaker Cloud FileMaker,
More informationMicrosoft Word - ch04三校.doc
4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear
More information目錄... ivv...vii Chapter DETECT
... ivv...vii Chapter 1 1.1... 5 1.2... 6 1.3 DETECT... 11 1.3.1... 12 1.3.1.1...12 1.3.1.2...13 1.3.1.3...14 1.3.1.4...15 1.3.1.5...15 1.3.1.6...16 1.3.2 DETECT... 17 1.3.3... 19 1.3.4... 20... 22 Chapter
More informationuntitled
Database System Principle Database System Principle 1 SQL 3.1 SQL 3.2-3.3 3.4 3.5 3.6 Database System Principle 2 3.1 SQL SQL Structured Query Language SQL Database System Principle 3 SQL 3.1.1 SQL 3.1.2
More information學 科 100% ( 為 單 複 選 題, 每 題 2.5 分, 共 100 分 ) 1. 請 參 閱 附 圖 作 答 : (A) 選 項 A (B) 選 項 B (C) 選 項 C (D) 選 項 D Ans:D 2. 下 列 對 於 資 料 庫 正 規 化 (Normalization) 的 敘
ITE 資 訊 專 業 人 員 鑑 定 資 料 庫 系 統 開 發 與 設 計 實 務 試 卷 編 號 :IDS101 注 意 事 項 一 本 測 驗 為 單 面 印 刷 試 題, 共 計 十 三 頁 第 二 至 十 三 頁 為 四 十 道 學 科 試 題, 測 驗 時 間 90 分 鐘 : 每 題 2.5 分, 總 測 驗 時 間 為 90 分 鐘 二 執 行 CSF 測 驗 系 統 -Client
More informationChapter 00 導論
Chapter 導論 2.NETADO.NET.NET3.5LINQ ADO.NET ADO.NETMCTSExam 70-561: TS: Microsoft.NET Framework 3.5: ADO.NET ADO.NET MCTSMCPD Step-By-Step ADO.NET?.NETADO.NET WindowsASP.NET ADO.NET ADO.NET ADO.NET1ADO.NET
More information13 根 据 各 种 网 络 商 务 信 息 对 不 同 用 户 所 产 生 的 使 用 效 用, 网 络 商 务 信 息 大 致 可 分 为 四 级, 其 中 占 比 重 最 大 的 是 ( A ) A 第 一 级 免 费 信 息 B 第 二 级 低 收 费 信 息 C 第 三 级 标 准 收 费
助 理 电 子 商 务 考 试 真 题 试 题 第 一 部 分 : 理 论 部 分 一 单 项 选 择 题 1 ( B ) 是 信 息 系 统 的 核 心 组 成 部 分 A 逻 辑 模 型 B 数 据 库 C 概 念 模 型 D 以 上 全 部 2 ping www.163.com -t 中 参 数 t 的 作 用 是 :( A ) A 进 行 连 续 测 试 B 在 新 窗 口 中 显 示 C
More information上海市教育考试院关于印发新修订的
沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,
More information中華民國九十三年 月 日
德 明 財 經 科 技 大 學 104 學 年 度 第 2 學 期 轉 學 考 試 招 生 簡 章 招 生 學 制 : 四 技 -- 日 間 部 進 修 部 二 技 -- 日 間 部 進 修 部 進 修 學 院 簡 章 104 年 11 月 18 日 ( 星 期 三 ) 公 告, 本 次 招 生 無 販 售 紙 本 簡 章, 請 自 網 路 下 載 報 名 方 式 : 一 律 網 路 登 錄 報 名,
More informationuntitled
ArcGIS Server Web services Web services Application Web services Web Catalog ArcGIS Server Web services 6-2 Web services? Internet (SOAP) :, : Credit card authentication, shopping carts GIS:, locator services,
More informationPPBSalesDB.doc
Pocket PowerBuilder SalesDB Pocket PowerBuilder PDA Pocket PowerBuilder Mobile Solution Pocket PowerBuilder Pocket PowerBuilder C:\Program Files\Sybase\Pocket PowerBuilder 1.0 %PPB% ASA 8.0.2 ASA 9 ASA
More information基于ECO的UML模型驱动的数据库应用开发1.doc
ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip
More informationuntitled
http://idc.hust.edu.cn/~rxli/ 1.1 1.2 1.3 1.4 1.5 1.6 2 1.1 1.1.1 1.1.2 1.1.3 3 1.1.1 Data (0005794, 601,, 1, 1948.03.26, 01) (,,,,,) 4 1.1.1 Database DB 5 1.1.1 (DBMS) DDL ( Create, Drop, Alter) DML(
More information大綱 資料庫系統 Database System 1. 資料庫及 SQL 導論 2. 網頁資料庫 3. 雲端建站 結合資料庫及雲端的網頁設計 1 資料庫簡介 甚麼是資料庫? 資料庫 (Database) 為相關資料的集合 關聯式資料庫 (Relational Database) 為以關聯表格 (Re
大綱 資料庫系統 Database System 1. 資料庫及 SQL 導論 2. 網頁資料庫 3. 雲端建站 結合資料庫及雲端的網頁設計 1 資料庫簡介 甚麼是資料庫? 資料庫 (Database) 為相關資料的集合 關聯式資料庫 (Relational Database) 為以關聯表格 (Relation) 集合的資料庫 資料庫管理系統 (Database Management System,DBMS)
More information1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F
1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o
More informationf2.eps
前 言, 目 录 产 品 概 况 1 SICAM PAS SICAM 电 力 自 动 化 系 统 配 置 和 使 用 说 明 配 置 2 操 作 3 实 时 数 据 4 人 机 界 面 5 SINAUT LSA 转 换 器 6 状 态 与 控 制 信 息 A 版 本 号 : 08.03.05 附 录, 索 引 安 全 标 识 由 于 对 设 备 的 特 殊 操 作 往 往 需 要 一 些 特 殊 的
More informationMicrosoft Word - InoTouch Editor编程软件手册2012.2.10.doc
目 录 第 一 章 关 于 InoTouch Editor 编 程 软 件 的 安 装... - 6-1.1 InoTouch 系 列 HMI 和 InoTouch Editor 软 件 的 简 介... - 6-1.2 安 装 InoTouch Editor 编 程 软 件... - 10-1.3 系 统 连 接 图... - 12-1.4 InoTouch 系 列 人 机 界 面 的 系 统 设
More informationEJB-Programming-4-cn.doc
EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session
More information7 DataSet DataSet TableColumnDataSet DataSet NOTE DataSet DataAdapterDataSetDataAdapter DataSet DataSetDataSetDataSet NorthwindDataSet DataSet Dim Nor
1DataSet 1 DataSet DataSetSystem.Data DataSet DataTableDataRelation DataTable DataSet DataSetTyped DataSet DataSet DataSetDataTable DataSetDataTable DataTable 45 DataSet DataSet DataSetTypedUntyped DataSetsDataSet
More informationMicrosoft Word - RFID資料庫系統設計.doc
RFID 資料庫系統設計 建國科技大學資管系 RFID 技術實驗室饒瑞佶副教授 http://rfid.ctu.edu.tw rcjao@ctu.edu.tw 大部分的資訊系統後端都牽涉到有資料庫,RFID 系統也不例外, 例如門禁系統的身份辨認 物流系統的進出紀錄 悠遊卡的乘車資訊等等, 都與資料庫脫離不了關係, 本章就使用 VS.NET 2005 為開發工具, 介紹如何連結 ACCESS SQL
More information四川省普通高等学校
四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9
More information幻灯片 1
沈 阳 工 业 大 学 2014 年 6 月 第 7 章 数 据 库 技 术 基 础 主 要 内 容 : 7.1 数 据 库 概 述 数 据 库 基 本 概 念 数 据 模 型 逻 辑 数 据 模 型 数 据 库 系 统 的 产 生 和 发 展 常 用 的 数 据 库 管 理 系 统 7.2 Access 2010 数 据 库 创 建 及 维 护 创 建 Access 2010 数 据 库 创 建
More information用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應
專題進度 老師 : 趙啟時老師 學生 : 陳建廷 2013/10/13 用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 程式碼 : package com.example.phone; import java.util.arraylist;
More informationR D B M S O R D B M S R D B M S / O R D B M S R D B M S O R D B M S 4 O R D B M S R D B M 3. ORACLE Server O R A C L E U N I X Windows NT w w
1 1.1 D B M S To w e r C D 1. 1 968 I B M I M S 2 0 70 Cullinet Software I D M S I M S C O D A S Y L 1971 I D M S containing hierarchy I M S I D M S I M S I B M I M S I D M S 2 2. 18 R D B M S O R D B
More information(HMI) IO A
6.5 6.5 (HMI) IO 6.52 6.52 6.5 2007 113 A 602 100086 010 82616619 010 62638166 www.kingview.com 4 7 25 38 43 52 63 68 86 SQL 95 99 WEB 105 Web Web Web I/O Microsoft Windows XP/NT/2000 I/O PLC PLC PLC PLC
More informationMicrosoft Word - 苹果脚本跟我学.doc
AppleScript for Absolute Starters 2 2 3 0 5 1 6 2 10 3 I 13 4 15 5 17 6 list 20 7 record 27 8 II 32 9 34 10 36 11 44 12 46 13 51 14 handler 57 15 62 63 3 AppleScript AppleScript AppleScript AppleScript
More informationThe golden pins of the PCI card can be oxidized after months or years
Q. 如何在 LabWindows/CVI 編譯 DAQ Card 程式? A: 請參考至下列步驟 : 步驟 1: 安裝驅動程式 1. 安裝 UniDAQ 驅動程式 UniDAQ 驅動程式下載位置 : CD:\NAPDOS\PCI\UniDAQ\DLL\Driver\ ftp://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/unidaq/dll/driver/
More informationuntitled
PowerBuilder Tips 利 PB11 Web Service 年度 2 PB Tips PB9 EAServer 5 web service PB9 EAServer 5 了 便 web service 來說 PB9 web service 力 9 PB11 release PB11 web service 力更 令.NET web service PB NVO 論 不 PB 來說 說
More informationSpyder Anaconda Spyder Python Spyder Python Spyder Spyder Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Sp
01 1.6 Spyder Anaconda Spyder Python Spyder Python Spyder Spyder 1.6.1 Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Spyder Python File
More information致理技術學院資訊管理學系專題企劃書格式建議書
致 技 術 學 院 資 訊 管 系 專 題 期 末 報 告 致 技 術 學 院 資 訊 管 系 專 題 期 末 報 告 鋼 鐵 業 進 銷 貨 管 系 統 指 導 老 師 : 蕭 勝 華 老 師 鋼 鐵 業 進 銷 貨 管 系 統 蘇 啟 鴻 老 師 學 生 : 張 志 宏 (69810203) 江 智 達 (69810209) 陳 宏 鎧 (69810210) 徐 偉 嘉 (69810211) 彭
More informationAndroid Service
Android Service- 播放音樂 建國科技大學資管系 饒瑞佶 2013/7 V1 Android Service Service 是跟 Activity 並行 一個音樂播放程式若沒使用 Service, 即使按 home 鍵畫面離開之後, 音樂還是照播 如果再執行一次程式, 新撥放的音樂會跟先前撥放的一起撥, 最後程式就會出錯 執行中的程式完全看不到! 但是, 寫成 Service 就不同了
More information星星排列 _for loop Protected Sub Page_Load(ByVal sender As Object, ByVal e As Dim h As Integer = 7 'h 為變數 ' Dim i, j As Integer For i = 1 To h
資訊系統與實習 製作 : 林郁君 一 2009.09.28 9X9 'button 被按下後 ' Dim i, j As Integer For i = 1 To 9 'i 從 1 到 9' For j = 1 To 9 'j 從 1 到 9' If j * i < 10 Then ' 如果 j 乘上 i 是為個位數 ' Response.Write(i & "*" & j & " =" & i *
More information1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:
Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed
More informationuntitled
21 Visual FoxPro Visual FoxPro 6.0 11 Visual FoxPro Visual FoxPro CIP Visual FoxPro 2004 21 ISBN 7-03-014834-7 V Visual FoxPro TP311.138 CIP 2004 143035 16 100717 http://www.sciencep.com * 2004 12 7871092
More informationChapter 16 集合
Chapter 16 集合 20 ArrayList StringCollection 16 本章學習目標 : ArrayList ArrayList Array StringCollection 16-1 21 10-3-8 System.Array Clear Clear 16-1 Clear System.Array Microsoft System.Collection IList 542
More informationMicrosoft Word - ASP2DB1002.doc
主 題 : 以 ASP.Net 撰 寫 連 結 資 料 庫 的 程 式 所 有 的 程 式 撰 寫 中, 只 要 牽 涉 到 較 大 量 的 資 料, 都 很 難 避 免 與 資 料 庫 的 連 線. 例 如 : - 人 事 系 統 中 必 須 與 人 事 資 料 庫 連 線 以 取 得 相 關 資 訊 - tip 系 統 中 必 須 與 學 籍 資 料 庫 連 線, 以 取 得 相 關 學 生 資
More information附件3:
目 录 第 一 部 分 主 体 部 分... 1 一 专 业 建 设 发 展 情 况... 1 二 专 业 培 养 目 标... 4 三 就 业 面 向... 7 四 毕 业 要 求... 10 五 课 程 体 系 与 核 心 课 程... 10 六 实 践 教 学 基 本 要 求... 16 七 教 学 及 课 程 安 排... 21 八 继 续 专 业 学 习 深 造 建 议... 25 九 其
More informationx MapReduce A Italic URL Constant width Constant width bold Constant width italic 這個圖示代表提示或建議 這個圖示代表一般註解
Java R Python Java Java Java x MapReduce A Italic URL Constant width Constant width bold Constant width italic 這個圖示代表提示或建議 這個圖示代表一般註解 第一章 I/O double[][] int[] String[] List 2 Map JavaScript Object Notation
More information<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 考 试 2009 年 上 半 年 软 件 设 计 师 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答
More information封面-12
第十二章 701Client TECHNOLOGY CO.,LTD. 701Client 701Server 701Client "701Client", 12-1 :supervisor :supervisor : 1. : 00~99 100 2. : 00~63 ( 63 / / ) 3. : 18 9 4. : 18 9 5. 12-2 TECHNOLOGY CO.,LTD. 701Client
More information新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
More information( )... 5 ( ) ( )
2016 大學校院招收大陸地區學生聯合招生委員會 71005 臺南市永康區南臺街 1 號 E-mail:rusen@stust.edu.tw WEB:http://rusen.stust.edu.tw TEL:+886-6-2435163 FAX:+886-6-2435165 2 0 1 6 0 1 1 9 2016... 2... 3... 5 ( )... 5 ( )... 5 1... 6 2...
More information全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
More informationFlexsim: (Open DataBase Connectivity, ODBC)
Flexsim: 資料庫系統連結 (Open DataBase Connectivity, ODBC) W. M. Song 桑慧敏 Tsing Hua Univ. 清華大學 2015.12.09 W. M. Song 桑慧敏 Tsing Hua Univ. 清華大學 Flexsim: 資料庫系統連結 (Open DataBase Connectivity, ODBC) 2015.12.09 1 /
More informationIsPostBack 2
5 IsPostBack 2 TextBox 3 TextBox TextBox 4 TextBox TextBox 1 2 5 TextBox Columns MaxLength ReadOnly Rows Text TextMode TextMode MultiLine TextMode MultiLine True False TextMode MultiLine Password MulitLine
More informationebook39-5
5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o
More information