dhamenha
08-03-2010, 02:31 PM
I have a problem when displaying Arabic data on my website. (ÍÈíÈ Úáí ÍÈíÈ ÇáÖÇãä )
http://www.arbpost.com/sandooq/display_memname.aspx
The problem only occurs when the data is retrieved from the database (MS Access 2000 database).
I have configured the web.config file to use globalization like this:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
I have also added the meta tag in the master page as follows:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Sample of the function that retrieve and display the data:
Public Sub disp_MemName()
Dim db As New DhamenDb
Dim SQL As String = "SELECT CustName FROM Customers WHERE CustNbr = 1"
Dim _MemName As String = ""
_MemName = db.getSingleValue(SQL)
If Not String.IsNullOrEmpty(_MemName) Then
lbl_memName.Text = _MemName
Else
lbl_memName.Text = "الأسم غير موجود"
End If
End Sub
Public Function getSingleValue(ByVal SQL As String) As String
Dim retVal As Object = Nothing
Using conn As New OleDbConnection(getConnectionString())
Using cmd As New OleDbCommand(SQL, conn)
conn.Open()
retVal = cmd.ExecuteScalar()
End Using
End Using
If retVal Is Nothing Then
retVal = String.Empty
End If
Return retVal.ToString()
End Function
Connection String is:
Private _XConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|xyz.mdb;"
I have also spent 2 weeks searching the net to resolve this issue with no luck, I have searched the discountasp.net forum and no luck as well,
Any help to resolve this problem will be appreciated.
Dhamenha.
http://www.arbpost.com/sandooq/display_memname.aspx
The problem only occurs when the data is retrieved from the database (MS Access 2000 database).
I have configured the web.config file to use globalization like this:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
I have also added the meta tag in the master page as follows:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Sample of the function that retrieve and display the data:
Public Sub disp_MemName()
Dim db As New DhamenDb
Dim SQL As String = "SELECT CustName FROM Customers WHERE CustNbr = 1"
Dim _MemName As String = ""
_MemName = db.getSingleValue(SQL)
If Not String.IsNullOrEmpty(_MemName) Then
lbl_memName.Text = _MemName
Else
lbl_memName.Text = "الأسم غير موجود"
End If
End Sub
Public Function getSingleValue(ByVal SQL As String) As String
Dim retVal As Object = Nothing
Using conn As New OleDbConnection(getConnectionString())
Using cmd As New OleDbCommand(SQL, conn)
conn.Open()
retVal = cmd.ExecuteScalar()
End Using
End Using
If retVal Is Nothing Then
retVal = String.Empty
End If
Return retVal.ToString()
End Function
Connection String is:
Private _XConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|xyz.mdb;"
I have also spent 2 weeks searching the net to resolve this issue with no luck, I have searched the discountasp.net forum and no luck as well,
Any help to resolve this problem will be appreciated.
Dhamenha.