“安排课程任课教师”的算法求解
--------------------编程问答--------------------mysql1 = "SELECT tname FROM teacher WHERE tno='" + DropDownList2.SelectedValue + "'";
返回的不是字符串,
--------------------编程问答-------------------- 这样获取mysql1的值:
SqlDataReader reader = DBHelper.ExecuteReader("SELECT tname FROM teacher WHERE tno='" + DropDownList2.SelectedValue + "");
if (reader.Read())
{
mysql1= reader["tname "].toString();
}
reader.Close();
.
.
.
后面不变 --------------------编程问答-------------------- DBHelper是什么? --------------------编程问答-------------------- UPDATE course SET tno='" + DropDownList1.SelectedValue + "',tname=(SELECT tname FROM teacher WHERE tno='" + DropDownList2.SelectedValue + "') WHERE cno='" + DropDownList1.SelectedValue + "'
补充:.NET技术 , ASP.NET