鹰
鹰与海豚
Unregistered / Unconfirmed
GUEST, unregistred user!
我做的这个是公交查询~~~有2张表~~一张是车次信息表chem~~还有一张是车次与站点的对应表zhanm~~~~现在我做的是站站查询,即输入站1和站2在从数据库搜索返回车次的信息,部分代码是这样的:
String zhanm1=this.txtzhan1.Text.Trim();
String zhanm2=this.txtzhan2.Text.Trim();
OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c://inetpub//wwwroot//bus//gongjiao.mdb;"
OleDbDataAdapter daa=new OleDbDataAdapter("select * from [chem] where 车名 in ( select 车名 from [zhanm] where 站名='"+zhanm1+"'and 站名='"+zhanm2+"' and chem.车名=zhanm.车名"+"",con);
DataSet dss=new DataSet();
daa.Fill(dss,"tt"
this.DataGrid1.DataSource=dss.Tables[0].DefaultView;
this.DataGrid1.DataBind();
我的那个查询语句刚开始有错~~现在没有了~~可是查询不出东西啊~~~各位好心的帮帮忙吧~~~
String zhanm1=this.txtzhan1.Text.Trim();
String zhanm2=this.txtzhan2.Text.Trim();
OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c://inetpub//wwwroot//bus//gongjiao.mdb;"
OleDbDataAdapter daa=new OleDbDataAdapter("select * from [chem] where 车名 in ( select 车名 from [zhanm] where 站名='"+zhanm1+"'and 站名='"+zhanm2+"' and chem.车名=zhanm.车名"+"",con);
DataSet dss=new DataSet();
daa.Fill(dss,"tt"
this.DataGrid1.DataSource=dss.Tables[0].DefaultView;
this.DataGrid1.DataBind();
我的那个查询语句刚开始有错~~现在没有了~~可是查询不出东西啊~~~各位好心的帮帮忙吧~~~