
private void BindDgv()
{
DBHelper dbHelper = new DBHelper();
string sql = string.Format(@"select flightNo,airwaysId,leaveTime,landTime,price
from FlightInfo,AirwaysInfo
where FlightInfo.airwaysId=AirwaysInfo.id
and leaveCity={0}
and destination={1}",cboLeaveCity.SelectedValue,cboDestination.SelectedValue);
dgvTicketInfo.Rows.Clear();//清空旧数据
SqlDataAdapter adapter = new SqlDataAdapter(sql, dbHelper.Connction);
DataSet ds = new DataSet();
adapter.Fill(ds,"FlightInfo");
this.dgvTicketInfo.DataSource = ds.Tables["FlightInfo"];
}