关于连接oracle数据库中OleDbConnection和OracleConnection的问题

当前碰到一个问题,数据库中字段的类型是nvarchar2
程序用OleDbConnection方式连接后用传参方式更新字段内容
using (OleDbConnection conn = new OleDbConnection())
{
conn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=sima;User ID=vas;Password=vas;min pool size=1;max pool size=100";
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE ROA_CFG_SMS SET CONTENT = :content WHERE ID = 10";
cmd.Parameters.Add(":content", OleDbType.VarChar);
cmd.Parameters[0].Value = ”àâçéèêëîïôœùûÀÂÇÉÈÊËÎÏÔŒÙÛn°€…“;
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();

            object name;
            cmd.CommandText = "SELECT CONTENT FROM ROA_CFG_SMS WHERE ID = 10";
            name = cmd.ExecuteScalar();
            textBox2.Text = name.ToString();
        }

程序用OracleConnection方式连接后用传参方式更新字段内容
using (OracleConnection conn = new OracleConnection())
{
conn.ConnectionString = "Data source=sima;User ID=vas;Pwd=vas";
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE ROA_CFG_SMS SET CONTENT = :content WHERE ID = 10";
cmd.Parameters.Add(":content", OracleType.NVarChar);
cmd.Parameters[0].Value = "àâçéèêëîïôœùûÀÂÇÉÈÊËÎÏÔŒÙÛn°€…";
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();

            object name;
            cmd.CommandText = "SELECT CONTENT FROM ROA_CFG_SMS WHERE ID = 10";
            name = cmd.ExecuteScalar();
            textBox2.Text = name.ToString();
        }

用OleDbConnection方式更新会出现乱码,用OracleConnection方式则正常,当前需要用OleDbConnection方式连接,请问应该怎么解决这个乱码问题呢?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问