下面我有我测试过的 SQL 查询工作正常
Select
data_info.user_id, data_info.type_id, data_info.specific_title,
data_info.content, life_area.type_id, life_area.type_id
From
data_info
Left Join
life_area On data_info.type_id = life_area.id
Where
data_info.user_id = '0001'
现在我试图将工作 SQL 转换为 asp.net MySqlCommand,但它无法工作并显示语法错误
MySqlCommand cmd = new MySqlCommand(
"Select data_info.user_id,data_info.type_id,data_info.specific_title,data_info.content,"+
"life_area.type_id,life_area.type_id" +
"FROM data_info LEFT JOIN life_area ON data_info.type_id = life_area.id" +
"Where data_info.user_id='0001'" , conn);
相关分类