求帮助C#公交查询换乘,求补充完整

.Net技术 码拜 8年前 (2016-03-03) 854次浏览
求帮助C#公交查询换乘,求补充完整实在是写不出来了,求高手补充成C# 可运行的
数据库:
distance[startStop(varchar 50),endStop(varchar 50),Distance(float)]
line[line_id(int),line_name(varchar 50),start_end(varchar 50),Setime(varchar 50),Price(varchar 50),Snum(int)]
linestops[line_id(int),stop_id(varchar 5),seq(int)]
stop[stop_id(varchar 5),stop_name(varchar 50)]

                string CommStr1 = "select stop_id from linestops where line_id in(select line_id from linestops where stop_id=(select stop_id from stop where stop_name = "" + 出发站 + ""))";
                string CommStr2 = "select stop_id from linestops where line_id in(select line_id from linestops where stop_id=(select stop_id from stop where stop_name = "" + 到达站 + ""))";
                int a = ds.Tables["A"].Rows.Count;
                int b = ds.Tables["B"].Rows.Count;
                ArrayList al = new ArrayList();
                int c = al.Count;
                string CommStr3 = "select line_name as 乘此线路出发 from line where line_id in (select line_id from linestops where stop_id =" + al[m] + "" + "and line_id in(select line_id from linestops where stop_id = (select stop_id from stop where stop_name = "" + textBox1.Text.Trim() + ""))";
                string CommStr4 = "select stop_name from stop where stop_id =" + al[m] + "";
                string CommStr5 = "select line_name from line where line_id in(select line_id from linestops where stop_id=" + al[m] + "and line_id in (select line_id from linestops where stop_id = (select stop_id from stop where stop_name="" + textBox2.Text.Trim() + "")))";
解决方案

100

这个问题你想的太简单了,这其实是个挺复杂的话题,本人记得邹老大曾经写个关于的这个帖子,于是帮你搜了一把,你可以参考下
http://bbs.csdn.net/topics/330267483,你也可以直接去邹老大的blog去查查,帖子里有地址

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明求帮助C#公交查询换乘,求补充完整
喜欢 (0)
[1034331897@qq.com]
分享 (0)