C# visualstudioc中的Oracle数据适配器#

C# visualstudioc中的Oracle数据适配器#,c#,sql,visual-studio-2010,visual-studio-2012,oracle11g,C#,Sql,Visual Studio 2010,Visual Studio 2012,Oracle11g,我正在连接Visual Studio 2012(c#)和Oracle 11g。我成功地执行了不需要join属性的查询。但这里有一个我想使用自然连接运行的查询: comm.CommandText = "select * from friends natural join customer where username='"+username+"' or frnd_username ='"+username+"'"; ds = new DataSet(); da =

我正在连接Visual Studio 2012(c#)和Oracle 11g。我成功地执行了不需要join属性的查询。但这里有一个我想使用自然连接运行的查询:

comm.CommandText = "select * from friends natural join customer where username='"+username+"' or frnd_username ='"+username+"'";
        ds = new DataSet();
        da = new OracleDataAdapter(comm.CommandText, conn);
        da.Fill(ds, "customer");
        dt = ds.Tables["customer"];
我的电脑出现了一个错误

 da.Fill(ds, "customer");
声明中,我认为这是因为我试图用customer表来填充数据集,而不是使用friends-natural-join-customer。 但我也试过了

da.Fill(ds, "friends natural join customer");
但我还是犯了一个错误

我得到的错误是“OracleExceptionUnhandled”。上面说

External component has thrown an exception.
我意识到,当查询在SQL中给出错误时,您会得到这个错误,但是我在SQL中执行了这个查询,它工作得很好

我尝试更改查询,结果在没有自然连接的情况下执行得很好,我非常确定错误与填充数据集的表有关

谁能建议我在括号里写些什么


提前感谢。

尝试使用内部/左侧联接更改查询,但问题仍然存在,请与DBA联系


这实际上是一个数据库问题。每次出现此错误时,我只需在sql编辑器中检查我的查询,如果它工作正常,那么我会联系DBA。

此错误可能是因为-如果任何sql都不返回行,或者任何其他架构不存在,或者任何变量变为null并用于进一步计算

了解您得到的错误是什么将是一件有趣的事情。您得到的内部异常应该会告诉您更多信息。
外部组件引发了异常。
仍然没有告诉我们任何信息。继续深入。一定有一些有用的错误信息。@gunr217,我试图找到更多关于错误的细节,但这是我能得到的最大限度。