2

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;
    }
2
  • 1
    Your code have not error. Your config have error. Also, it looks like you're trying to revive an ancient version of ASP.NET, so please have a look at asp.net/get-started for how you can do ASP.NET these days. Commented Aug 9, 2016 at 11:25
  • remove this Unicode=True Commented Aug 9, 2016 at 11:26

1 Answer 1

7

In the connection string

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

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

So just remove it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.