[問題] dropDownList寫入dataBase

看板C_Sharp (C#)作者 (aming)時間19年前 (2006/01/07 00:25), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
上次問了,如何從dataBase讀入dropDownList 也試出來了,,謝謝上次那位diamondking大大 可是我想從dropDownList的選項寫回dataBase 可是不管怎麼選都是 "第一個" 選項寫回去dataBase,dropDownList好像放假的一樣 string strSQL="insert into StudentScores( name, studentNo, class)"+ "values('" + TextBox1.text + "','" + TextBox2.Text + "','" + DropDownList1.Items[DropDownList1.SelectedIndex].Value + "')"; 上面的DropDownList1已成功從dataBase讀出資料了 請問大大,要如何用DropDownList把讀出來的資料,寫回dataBase 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.24.254.143 ※ 編輯: aming73 來自: 163.24.254.143 (01/07 00:35)
文章代碼(AID): #13lfe1ZF (C_Sharp)
文章代碼(AID): #13lfe1ZF (C_Sharp)