TaGi Asadullazadeh TaGi Asadullazadeh - 4 months ago 40
ASP.NET (C#) Question

'Unicode' is an invalid connection string attribute Asp.net

My code have error ---- 'Unicode' is an invalid connection string attribute

Web Config :

<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;
}

Answer

In the connection string

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

the Unicode=True is belonge to System.Data.OracleClient and not to Oracle.DataAccess.Client

So just remove it.