麻烦大家看看这条语句!谢谢!
command.CommandText = "insert into StudentScore (StudentID,SubjectID,Score) select StudentID,SubjectID,Score=@Score from StudentDetail,SubjectInformation where StudentName=@StudentName and SubjectName=@SubjectName";
这样写错哪里啊谢谢! --------------------编程问答-------------------- 顶 --------------------编程问答-------------------- 是不是在執行的時候,參數錯誤了。
嘗試將 SELECT 擴起來試試 --------------------编程问答-------------------- 是参数错误,系统不认识 @Score
command.CommandText = "insert into StudentScore (StudentID,SubjectID,Score) select StudentID,SubjectID,@Score from StudentDetail,SubjectInformation where StudentName=@StudentName and SubjectName=@SubjectName";
--------------------编程问答-------------------- select StudentID,SubjectID,Score=@Score from 这个地方有点问题..Score=@Score --------------------编程问答-------------------- 只能修改成如下:
command.CommandText = "insert into StudentScore (StudentID,SubjectID,Score) select StudentID,SubjectID,@Score from StudentDetail,SubjectInformation where StudentName=@StudentName and SubjectName=@SubjectName";
或者:
command.CommandText = "insert into StudentScore (StudentID,SubjectID,Score) select StudentID,SubjectID,Score from StudentDetail,SubjectInformation where StudentName=@StudentName and SubjectName=@SubjectName";
--------------------编程问答-------------------- Score=@Score这个的问题
补充:.NET技术 , C#