private void bindGrid() { string lidhja = "SERVER=localhost\\SqlExpress;Database=Projekti2;" + "Integrated Security=true;"; SqlConnection cnnDB = new SqlConnection(lidhja); string query = string.Format("SELECT a.RouteID,a.Departure,a.Price FROM ListBus a INNER JOIN Route b ON a.RouteID=b.RouteID" + "WHERE a.Departure='{0}' AND b.StartPlace='{1}' AND b.DestPlace='{2}'", DepartureDate.Text, DropDownList1.SelectedValue, DropDownList2.SelectedValue); using (SqlDataAdapter sda = new SqlDataAdapter(query, cnnDB)) { DataSet ds = new DataSet(); sda.Fill(ds, "ListBus"); GridView1.DataSource = ds.Tables["ListBus"].DefaultView; GridView1.DataBind(); } }
" WHERE a.Departure='{0}' AND b.StartPlace='{1}' AND b.DestPlace='{2}'",
"..ON a.RouteID=b.RouteIDWHERE a.Depart.."
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)