[問題] 關於datagridview 顯示問題

看板C_Sharp (C#)作者 (孟宗)時間18年前 (2008/02/02 00:00), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
由於在資料庫中的中文資料是亂碼 因此在網頁顯上的時候 都會用以下的方法顯示 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
datagridview中, cell要顯示時的event,在event內作encoding
02/04 20:32, 1F
文章代碼(AID): #17eq8oXJ (C_Sharp)
文章代碼(AID): #17eq8oXJ (C_Sharp)