Hello,
I am using the standard .NET OdbcConnection to connect to an AS/400 iSeries database. I am able to query this database. Unfortunately, there are some fields that appear to be encoded. How do I decode these values in C#? I have tried the following:
string text = string.Empty;
if (bytes.Length > 0)
{
ASCIIEncoding encoder = new ASCIIEncoding();
text = encoder.GetString(bytes);
}
return text;
The bytes variable represents the data that needs to be decoded. Unfortunately, I am not having any luck. I have been told that the data will return correctly if I setup an ODBC data source on my Windows machine and check the "Convert binary data (CCSID65535) to text" checkbox in the translation tab. However, I want to use pure C#. Any ideas? Am I way off?
Thanks!