Hello,
I have been haunted by this issue for a long time. I have a list of cities in a .DBF file called as "cities1.dbf". When i query the Arabic field & try to display in a drop down list, it shows some garbage values & not the actual arabic text.
Is this something to do with the encoding decoding. Earlier i tried do solve this with the .net Encoding decoding, but couldnt get success.
Please advise.
-
.aspx
-
----------
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
Cities_Arabic <asp:DropDownList ID="DropDownList1" runat="server" DataValueField ="city_lcase" DataTextField="city_a"></asp:DropDownList>
-
</div>
-
</form>
-
</body>
-
-
.aspx.vb
-
------------
-
Dim cityName As String = "_cities"
-
Dim strSql As String = "SELECT * FROM cities1"
-
DropDownList1.DataSource = generalClass.ExecuteDataTableQueryDBF(strSql, cityName)
-
DropDownList1.DataBind()
-
-
Public Shared Function ExecuteDataTableQueryDBF(ByVal SelectSTR As String, ByVal city As String) As Data.DataTable
-
Dim oCnn As New OleDbConnection
-
Dim iCount As Integer = 0
-
Dim strSql As String
-
Dim da As New OleDbDataAdapter
-
Dim dt As New DataTable
-
Try
-
oCnn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString1").ToString + city + System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString2").ToString
-
-
If oCnn.State = ConnectionState.Closed Then
-
oCnn.Open()
-
End If
-
-
strSql = SelectSTR
-
da = New OleDb.OleDbDataAdapter(strSql, oCnn)
-
da.Fill(dt)
-
-
Catch ex As Exception
-
Finally
-
If oCnn.State = ConnectionState.Open Then
-
oCnn.Close()
-
End If
-
End Try
-
Return dt
-
End Function
Here is a link to the problem screen shot which i am facing.
http://picasaweb.google.com/lh/photo...eat=directlink
Thanks & regards,