SqlCommand cmd = new SqlCommand("update Student set Sname='" + updateName + "' where Sno='"+Sno+"'", con);
SqlCommand cmd2 = new SqlCommand("update Student set Ssex='" + updateSex + "' where Sno='" + Sno + "'", con);
本来是这样写的,但是,只执行了第一条语句,并未执行第二局,求解!
SqlCommand cmd = new SqlCommand("update Student set Sname='" + updateName + "'Ssex='" + updateSex + "' where Sno='" + Sno + "'", con);
修改成如上语句,错误提示,Ssex附近有语法错误,继续求解!
请教了一下老师,
2个方法:一是使用数据库的视图功能,二是构造复杂的SQL语句.
第一个方法是在sql中实现的,不予考虑,研究第二种方法。
老师给出的大致语句是:select * from student,kc,score where student.sno=score.sno and kc.Kno=score.Kno and ... order by...
这个有点无解,修改应该是updata语句,这里确是select,继续求解!