Kindly help me on identifying the cause of this error
Incorrect syntax near the keyword 'JOIN'
Here is the code:
Label name = (Label)GuitarBrandsGridView.Rows[e.RowIndex].FindControl("lblName");
string queryGuitarItems = "DELETE FROM stringInstrumentItem JOIN brand ON stringInstrumentItem.brandId = brand.brandId WHERE stringInstrumentItem.brandId IN(SELECT brand.brandId FROM brand WHERE name = @brand)";
using (SqlConnection connectionGuitarItems = new SqlConnection(ConfigurationManager.ConnectionStrings["musicStoreConnection"].ToString()))
{
using (SqlCommand commandGuitarItems = new SqlCommand(queryGuitarItems, connectionGuitarItems))
{
connectionGuitarItems.Open();
commandGuitarItems.Connection = connectionGuitarItems;
commandGuitarItems.Parameters.Add(new SqlParameter("@brand", name.Text));
commandGuitarItems.ExecuteNonQuery();
connectionGuitarItems.Close();
commandGuitarItems.Parameters.Clear();
}
}