我的代码有错误----'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;
}
答案 0 :(得分:5)
在连接字符串
中connectionString="Data Source=XE;Persist Security Info=True;User ID=****;Password=****;Unicode=True"
Unicode=True
属于 System.Data.OracleClient而不属于 Oracle.DataAccess.Client
所以只需删除它。