嗨,我有一个下拉列表,我想在下拉列表中选择它时更新一个项目,我编写了这段代码,但它只更新第一个项目:
DBMethod db = new DBMethod();
DataTable dt = new DataTable();
string sqlcmd = "select * from dbo.Web_Personnel ";
dt = db.ReturnTableWithData(sqlcmd);
dt.Rows[0]["Job"] = txtjobE.Text;
dt.Rows[0]["ChildNo"] = txtchildnoe.Text;
dt.Rows[0]["Salary"] = txtsalary.Text;
db.UpdateDatatable(dt, "dbo.Web_Personnel");