我使用oracle express 10g2與.net連接器(oracle.dataaccess.dll)。Oracle上的ExecuteReader與連接
我的問題是我有2個表可連接A和B;
中的SQLDeveloper我稱之爲:
select * from A; //no problem
select * from B; // no problem
select * from A inner join B on B.id = A.bId; // no problem + joining
我的C#類(LocalOracleDataProvider.cs);
var cm1 = connection.CreateCommand();
cm1.CommandText = "select * from A;";
var cm2 = connection.CreateCommand();
cm2.CommandText = "select * from B;";
var cm3 = connection.CreateCommand();
cm3.CommandText = "select * from A inner join B on B.id = A.bId;";
...
var dt1 = cm1.ExecuteReader(); // ok
var dt2 = cm2.ExecuteReader(); // ok
var dt3 = cm3.ExecuteReader(); // crash oracle error ORA-00911 : invalid character
我不明白的問題... 是錯誤請求我的我沒有看到的? 或者是否有任何問題(沒有發現 - 我是一個人嗎?)? 我必須創建一個sqlview封裝加入請求? 或其他旁路?
在此先感謝你們!
拿出第一個; 「select * from a inner join B on B.id = A.bId」; – Paparazzi