[問題] 關於datagridview 顯示問題
由於在資料庫中的中文資料是亂碼
因此在網頁顯上的時候
都會用以下的方法顯示
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
→
02/04 20:32, , 1F
02/04 20:32, 1F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章