如何解决由INNER JOIN引起的OleDbException?

时间:2017-03-09 22:29:13

标签: c# join inner-join oledb

查询:

com.CommandText = "SELECT questions.qid1, questions.que, ans.1,ans.2,ans.3,ans.4 FROM questions INNER JOIN ans ON questions.qid1 = ans.qid";

如何在MS Access数据库中修复此INNER JOIN

Error Message

1 个答案:

答案 0 :(得分:0)

此查询应修复它:

  com.CommandText = " SELECT  k"'.'"qid1, k"'.'"que, k"'.'"1,k"'.'"2,k"'.'"3,k"'.'"4 FROM
    "'('"SELECT * FROM questions INNER JOIN ans ON questions"'.'"qid1 = ans"'.'"qid"')'" k"