注册 登录
编程论坛 ASP.NET技术论坛

[求助]菜鸟的问题:

都市虫子 发布于 2007-06-02 17:04, 687 次点击
菜鸟的问题:
string secno=rd["cno"].ToString();
string sqlString="select * from teacourse,course,teacher where teacourse.tno=teacher.tno and teacourse.cno=course.cno and teacourse.cno!='"+secno+"'";
其中rd是个DataReader 读出来多行数据。可SQL里面的teacourse.cno!='"+secno+"'只执行最后读出的数据。这
6 回复
#2
都市虫子2007-06-02 17:07
急。。。。
#3
skyland842007-06-02 17:09

你是什么问题 你说清楚点啊?

#4
都市虫子2007-06-02 17:20
其中rd是个DataReader 用while控制读出来多行数据。我想用string sqlString="select * from teacourse,course,teacher where teacourse.tno=teacher.tno and   and '"+secno+"'";绑定到一个datagrid中,但是'"+secno+"'只能是过滤最后一个读出来的数据。
#5
skyland842007-06-02 17:40

and teacourse.cno!='"+secno+"'";

去掉这个!

然后在while 里写 if(rd["cn"].tostring()==@secno)

#6
wangjian1232007-06-02 17:42
寻求网马开发工程师~!有的联系QQ282455851``月薪上万!!
#7
skyland842007-06-02 17:53
我还没有考那个证书呢~!
呵呵
1