我正在使用此代碼從Oracle數據庫讀取數據。存儲在Oracle中的數據是Navarchar2數據類型,但是當它在gridview中顯示時,它看起來像這樣。 ? &? ?????? ??? ?我的數據庫Charaacter集是WE8MSWIN1252如何在Asp.net中讀取阿拉伯字符集數據
這裏是我從Oracle數據庫讀取的mY代碼。
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim con = New OleDbConnection("Data Source=cms; User ID=cms20112012; Password=??????; provider=OraOLEDB.Oracle")
con.open()
Dim cmd As New OleDbCommand("Select to_char(grower_Name) grower from V_GROW", con)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
Dim I As Long
da.Fill(ds, "V_GROW")
GridView1.DataSource = ds
GridView1.DataBind()
For I = 0 To ds.Tables("V_GROW").Rows.Count - 1
Dim grower As String = ds.Tables("V_GROW").Rows(I).Item("grower")
grower = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(grower))
Label1.Text = grower
Next I
con.close()
End Sub
請人幫我走出這個問題
是的,我將數據存儲在NVARCHAR2數據類型和我的數據庫NLS_CHARACTERSET是WE8MSWIN1252和NLS_NCHAR_CHARACTERSET是AL16UTF16並通過您的方法我的數據已經改變成這種形式的典型值= 1長度= 30 CHARACTERSET = AL16UTF16:0,d8,0,A7 ,0,d9,20,1e,0,d9,20,1e,0,分貝,0,81,0,20,0,d8,0,a8,0,d8,0,AE,0,d8,0 ,b4 – 2012-02-24 08:55:38
那麼我現在該做什麼 – 2012-02-24 08:58:57
Sir R u there請幫我在這裏 – 2012-02-24 10:53:11