c# - ORA-00911 : invalid character

标签 c# system.data.oracleclient

我在我的 oracle (11g) 数据库中创建了两个表,如下所示:

    create table "test" ("id" int);
    create table test ("id" int);

然后在我的 C# 程序中出现了一个问题:

    OracleConnection conn = new OracleConnection(-myConnectionString-);
    conn.Open();
    OracleCommand command = new OracleCommand("select * from test;", conn);
    var v = command.ExecuteReader(); 
    OracleCommand command = new OracleCommand("select * from \"test\";", conn);
    var v = command.ExecuteReader(); 

对于 command.ExecuteReader() 我有一个“ORA-00911:无效字符”错误。

最佳答案

删除; (分号)从 SQL 字符串的末尾开始

关于c# - ORA-00911 : invalid character,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12262145/

相关文章:

c# - 从协方差返回 Action<T> 的方法

java - 使用 java 客户端使用 WCF restful webservice?

oracle - 如何使用 Windows 身份验证将 System.Data.OracleClient 连接到 oracle db?

c# - 找不到类型或命名空间名称 'OracleConnection'

windows-7 - 如何告诉 System.Data.OracleClient 使用 64 位 Oracle 驱动程序

c# - OracleClient 说我的连接已关闭

c# - 配置 log4net 以允许存储每个 dll 的日志

c# - 如何通过逗号分隔将mysql中的记录从另一种形式加载到一种形式C#

c# - 处理谷歌地图的纬度/经度坐标

c# - 使用 Oracle 命令参数的问题