作者hpy790 (孟宗)
看板C_Sharp
标题[问题] 关於datagridview 显示问题
时间Sat Feb 2 00:00:49 2008
由於在资料库中的中文资料是乱码
因此在网页显上的时候
都会用以下的方法显示
SqlDataAdapter ad_cus = new SqlDataAdapter("Select cast(CustomerName as varbinary) CustN From CustomerInfo", conn);
ad_cus.Fill(ds_cus, "CustomerInfo");
byte[] notbig5 = (byte[])(ds_cus.Tables["CustomerInfo"].Rows[0]["CustN"]);
Encoding big5 = Encoding.GetEncoding("big5");
Label1.Text = big5.GetString(notbig5);
但是问题来了
在Gridview显示的时候..
下SQL之後找不到地方可以做转encoding的动作
请问哪为前辈有遇到过类似的问题
并且有什麽解决的方法吗
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.193.4.186
1F:→ ideaup:datagridview中, cell要显示时的event,在event内作encoding 02/04 20:32