读db2数据库表出现乱码

[ 1858 查看 / 2 回复 ]

张老师您好,最近在做练习程序,用oledb连接linux操作系统下db2,读表中数据,但如果表中数据是中文,读出的就是乱码.

不知道这是什么原因,怎么样修改呢?

我想把读出的该含中文内容的字段值作为label的text显示的win form上

连接串如下
this._conn = new OleDbConnection(String.Format("Provider={0};Hostname={1};Port={2};Protocol={3};Database={4};UID={5};PWD={6};CurrentSchema={7}", this._provider, this._hostNm, this._port, this._protocol, this._database, this._usrId, this._passwd, this._currSchema));
sql语句为 select * from tbl

adapter.fill(tbl1)

label_1.text = tbl1.rows[0].columns[1].tostring();
TOP

你好,看看你的数据库配置的区域,可调整为其他的再试试
TOP