数据库:
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去查查,帖子里有地址
http://bbs.csdn.net/topics/330267483,你也可以直接去邹老大的blog去查查,帖子里有地址