DataReader.GetOracleValue

Richard Crist

Well-known member
Joined
Dec 10, 2004
Messages
97
Location
near Nashville, TN
Anyone ever worked with Oracle DBs in .NET?

In particular the DataReader.GetOracleValue() method?

Im trying to take the binary data returned by GetOracleValue and turn it into a normal string. That is, convert each byte of binary data into a char array or string so that I can display it in a text box.

We have text data stored in an Oracle db in columns of ORACLE RAW format to more efficiently use the db. The raw data is basically ASCII data. Im using GetOracleValue because GetOracleString and other methods dont address RAW data. I just need to get the data out of the RAW format and into a .NET string representation for display in a text box. So far I have been able to turn each byte into a string representation (byte value 123 into "123").

If there is a way to easily convert the RAW data from GetOracleValue into strings please let me know. Thank you! :cool:
 
This worked

Richard Crist said:
Im trying to take the binary data returned by GetOracleValue and turn it into a normal string. That is, convert each byte of binary data into a char array or string so that I can display it in a text box.

We finally figured out how. A coworker and me worked on it and the solution basically amounts to:

1) Create a byte array and put the GetOracleValue result into the byte array
2) Create a char array and copy the byte array into the char array (currently we are doing it one byte at a time in a "for each byte" loop)
3) Create a string and call ToString(char array) to convert the char array to a string value
4) Use string value in text box

Now....Im sure there may be a easier and/or better way, so feel free to contribute. :)
 
Back
Top