作者aming73 (aming)
看板C_Sharp
标题[问题] dropDownList写入dataBase
时间Sat Jan 7 00:34:48 2006
上次问了,如何从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)