Re: Invalid Characters (\0s) Returned by OracleDataReader

From: Nick Malik [Microsoft] (nickmalik_at_hotmail.nospam.com)
Date: 01/10/05


Date: Mon, 10 Jan 2005 06:47:23 -0800

four nearly identical posts in twenty minutes. That has to be some kind of
record.

Can you post a short but complete code segment that illustrates the problem?
The code you have looks fine.
The fact that the dataadapter returns the same things is concerning, because
very little of your code would have been involved.
that would point to either a defect or a configuration problem in either
your Oracle driver or the way the application is using .Net.

I'm still hoping we can find it in the code... that's why I've asked for
something a little more complete. Note: I don't have Oracle to test
against, so I'm hoping to help you spot it in the code.

-- 
--- Nick Malik [Microsoft]
    MCSD, CFPS, Certified Scrummaster
    http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
   I do not answer questions on behalf of my employer.  I'm just a
programmer helping programmers.
--
"RobertoP" <RobertoP@discussions.microsoft.com> wrote in message
news:667E1A67-64E0-4EDD-B8B3-9120C4E622A2@microsoft.com...
> Hello all,
>
> I am trying to create an simple application that communicates with an
Oracle
> DB, but the data returned by the OracleDataReader object contains random
> invalid characters.
>
> To be more Specific, it replaces some characters with a '\0'
>
> Example: Where it should be NIC it returns sometimes N\0\0
>
> This is what I am using in my code:
>
> //////
>
>      this.DWConnection.Open();
>
>      OracleCommand oraCMD = new OracleCommand("Select * from myTable where
> (wname = 'F18104854')", this.DWConnection);
>
>      OracleDataReader myResultsReader = oraCMD.ExecuteReader();
>
>      while(myResultsReader.Read())
>      {
>          myResultsReader.GetValues(values);
>       }
>
>       this.DWConnection.Close();
>
> //////
>
> Some things I tried:
>
> *I checked the variable "values" above, and many rows, not always the same
> column, has \0 instead of characters. What is interesting is that it has
the
> same number of \0s as the actual characters in Oracle. Also, it is always
in
> the end of the string, and the first characters are read correctly.
> Ex.: N\0\0 instead of NIC, 18852\0\0\0\0\0 instead of 188524C-01
>
> *Seems not to have any pattern to when it replaces the characters with \0s
> sometimes it is every other 2 rows, or every other 3, and so on.
>
> *I tried the same code using OracleAdapter, and same results
>
> *Using the server explorer, or the query builder tool, and the option to
> view data at development time works just fine.
>
> Any Ideas?
>
> Thanks,
>
> RobertoP


Relevant Pages

  • Re: Storing Queries in Tables
    ... Before I start I am not a Oracle DBA and my knowledge of Oracle is ... Reports are stored as SQL in tables in our main application schema. ... characters like tabs and spaces. ...
    (comp.databases.oracle.misc)
  • RE: difficulties with utf-8 characters using DBD::Oracle, where works using DBD::Pg (PostgreSQL) -
    ... DBD::Oracle 1.16, which explained the weird behavior of Oracle with plain ... > and read the documentation about unicode carefully. ... >> special characters. ... >> EOF ...
    (perl.dbi.users)
  • Re: Unicode Character Allocation
    ... I have a quick question regarding how Oracle allocates storage space ... Does Oracle, in UTF-8 mode, actually allocate 4 bytes per every byte ... Characters from the European scripts are represented in either 1 or 2 bytes. ...
    (comp.databases.oracle.server)
  • Strange unicode problem with oracle 10g
    ... we have a strange problem with unicode characters and oracle 10g. ... The error occurs only with delphi components, with ado type library i have ...
    (borland.public.delphi.database.ado)