我正在做一个标准练习,在 gridview 中显示三个表的字段,但是在我的内部联接语句中存在语法错误。
任何关于语法错误所在位置的建议。
try
{
conn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;
Data Source =" + Server.MapPath("App_Data\\Shopping List.mdb"));
conn.Open();
DataSet ds = new DataSet();
OleDbDataAdapter dba = new OleDbDataAdapter(@"SELECT Ingredient.IngerdientId, Ingredient.IngredientName, Area.AreaName, Recipe.RecipeName, Ingredient.Quantity
FROM Ingredient
INNER JOIN Area ON Ingredient.AreaId = Area.AreaId
INNER JOIN Recipe ON Ingredient.RecipeId = Recipe.RecipeId", conn);
dba.Fill(ds);
gridIngredients.DataSource = ds;
gridIngredients.DataBind();
}
catch (Exception exe)
{
labMessage.Text = exe.Message;
}