Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: .net OracleClient and character sets
HaukiDog wrote:
> I have developed some code on an oracle server set to the US7ASCII
> character set. I just found out that my production system is set to
> UTF8. Changing character sets on the production server is not an
> option. There is a string in my member table, which contains some
> wacky characters and is not converting properly.
>
> Is there any way to:
> 1. do a conversion in the select statement, or in an SP?
> 2. is there anyway to chnage the character set in the OracleClient
> code?
>
> I am using an OracleDataReader, the code looks like this:
> ------------------------------------------------------------------
> const string _selectText = "SELECT passwordkey FROM member WHERE
> memberid=:pMemberId";
> OracleCommand myCommand = new OracleCommand();
> myCommand .Connection = _Connection;
> myCommand .CommandType = CommandType.Text;
> myCommand .CommandText = _selectText;
> OracleDataReader myReader =
> myCommand.ExecuteReader(CommandBehavior.SingleRow);
>
> if (!myReader.Read())
> {
> throw new UserUnknownException(UserId);
> }
>
> int passwordkeyOrdinal = myReader.GetOrdinal("passwordkey");
> string PasswordKey = myReader.GetString(passwordkeyOrdinal );
> -----------------------------------------------------------------
>
> Thanks!
Why is your code character set dependent? Which can be stated to: Why do you think it is?
-- Daniel Morgan http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Fri May 02 2003 - 20:35:09 CDT
![]() |
![]() |