'Unicode'是无效的连接字符串属性Asp.net

时间:2016-08-09 11:22:46

标签: asp.net oracle unicode connection-string

我的代码有错误----'Unicode'是无效的连接字符串属性

Web配置:

<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=XE;Persist Security Info=True;User ID=****;Password=****;Unicode=True"
  providerName="System.Data.OracleClient" /> </connectionStrings>

Asp.net:

 public DataTable Bankomat(DataTable dt)
    {

        using (con = new OracleConnection())
        {
            using (cmd = new OracleCommand())
            {
                con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connectionString"].ToString();

                cmd.Connection = con;
                cmd.CommandText = "select * from bankomat";
                con.Open();
                dt.Load(cmd.ExecuteReader());
                con.Close();
            }

        }
        return dt;
    }

1 个答案:

答案 0 :(得分:5)

在连接字符串

connectionString="Data Source=XE;Persist Security Info=True;User ID=****;Password=****;Unicode=True"

Unicode=True属于 System.Data.OracleClient而不属于 Oracle.DataAccess.Client

所以只需删除它。