为什么不能帮定?
this.sqlCommand2.CommandText = "Select 学生 From 选课表 Where ((课程1 like @courseName) Or (课程2 like @courseName) Or (课程3 like @courseName) Or (课程4 like @courseName))";
this.sqlCommand2.Connection = this.sqlConnection1;
System.Data.SqlClient.SqlDataReader stuReader = this.sqlCommand2.ExecuteReader();
this.DataList1.DataSource = stuReader;
this.DataList1.DataBind();
这里有张选课表,但是这样datalist中并没有数据。我怀疑是sql语句中or的问题。。。但是不知道怎么改。。。
问题点数:0、回复次数:2Top
1 楼saucer(思归)回复于 2003-02-02 23:58:25 得分 0
what is in your @courseName? try a value like '%SomeCourse%'Top
2 楼Morgan_ma(单翼天使)回复于 2003-02-03 00:04:50 得分 0
谢谢,我试验过了,不是sql语句的问题。。。但是好像还是不能帮定Top




