Public Shared Function GetSimpleThai() As String
Dim SQLCommandStr As String = "SELECT CONVERT(NVARCHAR(10),'งง');"
Dim MyConn As SqlConnection = New SqlConnection(SQlConnectionString)
Dim MyCommand = New SqlCommand(SQLCommandStr, MyConn)
Dim retStr As String
Dim UniCodeEncode As Encoding = Encoding.Unicode
Dim MyEncode As Encoding = Encoding.Default
Try
MyConn.Open()
Dim acceptByes As Byte() = UniCodeEncode.GetBytes(MyCommand.ExecuteScalar().ToString())
retStr = Convert.ToBase64String(acceptByes)
'retStr = MyCommand.ExecuteScalar().ToString()
Catch ex As Exception
retStr = "Error"
Throw New Exception(ex.Message)
Finally
If Not (MyConn Is Nothing) Then MyConn.Close()
End Try
Return retStr
End Function