浏览 2208 次
锁定老帖子 主题:html表格显示数据库中多对多关系的思考
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-08-05
select * from v_coll_port where collid in (select collid from v_coll_port where pollid=@pollID group by collid having count(collid) > 1) select * from V_coll_port where portid in( select portid from v_coll_port where pollid=@pollID group by portid having count(portID)>1) select * from v_coll_port where pollid=@pollID and collid in ( select collid from v_coll_port group by collid having count(collid) = 1 ) and portID in ( select portID from v_coll_port group by portID having count(portID) = 1 )
DataTable dt12N = ds.Tables[0]; DataTable dtn21 = ds.Tables[1]; DataTable dt121 = ds.Tables[2]; GridNotStyle g = new GridNotStyle(2,"black","white","white"); for(int i=0;i<dt12N.Rows.Count;i++) { DataRow r = dt12N.Rows[i]; if(i==0) { g.SetHead(r["collName"].ToString()+"<br>编号:"+r["collID"].ToString()+"^r^"+dt12N.Rows.Count, this.getPortName(r["portID"].ToString())+"<br>编号:"+r["portID"].ToString()); } else { g.SetHead(this.getPortName(r["portID"].ToString())+"<br>编号:"+r["portID"].ToString()); } } for(int i=0;i<dtn21.Rows.Count;i++) { DataRow r = dtn21.Rows[i]; if(i==0) { g.SetHead(r["collName"].ToString()+"<br>编号:"+r["collID"].ToString(), this.getPortName(r["portID"].ToString())+"<br>编号:"+r["portID"].ToString()+"^r^"+dtn21.Rows.Count); } else { g.SetHead(r["collName"].ToString()+"<br>编号:"+r["collID"].ToString()); } } foreach(DataRow r in dt121.Rows) { g.SetHead(r["collName"].ToString()+"<br>编号:"+r["collID"].ToString(), this.getPortName(r["portID"].ToString())+"<br>编号:"+r["portID"].ToString()); }
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |