Please can anyone tell me why im gettin this error : Incorrect syntax near 'ListBus' .
Its refering to sda.Fill(ds,"ListBus")
in the code belowprivate 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(); } }