2

I am Using This Code To Read data from Oracle Database .That Data stored In Oracle is Navarchar2 data type but when It it display in gridview it looks like this.

نصرت منوکÛ

HEre is the code I am using to read data Update

    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=ramzan; provider=OraOLEDB.Oracle")
        con.open()
        Dim cmd As New OleDbCommand("Select * 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 Name")
grower = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(grower))
            Label1.Text = grower
        Next I
        con.close()
    End Sub

Please anyone tell me How can i display data in actual arabic form which i have stored in DB.

Update

Here is My View Query and now my data is in this form ?& ? ?????? ??? ?R

select ZONE_NO "Zone No",to_char(GROWER_NAME_U) "Grower Name",to_char(FATHER_NAME_U) "Father Name" from CMS_GROWER
where rownum<11
and grower_name_u is not null
user1103342
  • 113
  • 1
  • 3
  • 8
  • when you change the encoding in your browser, does it help ? – A.B.Cade Feb 17 '12 at 06:37
  • @user1103342 - What is the national character set of your database? What language is the data stored in the `V_GROM` table? Your code appears to be attempting to convert the data into ASCII before displaying it-- are you certain that it is possible to correctly convert the underlying data to ASCII? – Justin Cave Feb 17 '12 at 08:28
  • My database character set is WE8MSWIN1252 and I am storing My date In Arabic Form In Nvarchar2 data type – user1103342 Feb 17 '12 at 09:12
  • before you encoded it to ascii, when you still got "نصرت Ù…Ù†ÙˆÚ©Û " what was your encoding in the browser ? what's your IIS version ? – A.B.Cade Feb 19 '12 at 07:56
  • I am Using Google Chrome And IIS Built-in of Windows Server 2003 and the Browser language is English charset – user1103342 Feb 20 '12 at 04:32

0 Answers0