看板 C_Sharp 關於我們 聯絡資訊
由於在資料庫中的中文資料是亂碼 因此在網頁顯上的時候 都會用以下的方法顯示 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
ideaup:datagridview中, cell要顯示時的event,在event內作encoding 02/04 20:32