[Mono-list] Odbc.DataReader.GetValue returns wrong data on CHAR columns

Daniel Freund lunkwill at gmx.net
Tue May 17 04:33:44 EDT 2005


> --- Ursprüngliche Nachricht ---
> Von: "Michael J. Ryan" <tracker1_lists at theroughnecks.com>
> An: lunkwill at gmx.net
> Betreff: Re: [Mono-list] Odbc.DataReader.GetValue returns wrong data on
> CHAR columns
> Datum: Thu, 28 Apr 2005 03:54:15 -0700
> 
> In the interum, can you simply .ToString().Trim() your CHAR values?
> 
> lunkwill at gmx.net wrote:
> > Mono Hackers!
> > 
> > I've come over a problem with System.Data.Odbc. I know: why the hack use
> > ODBC?
> > My production system is Informix. And I found no (affordable) Informix
> > driver so far. If anybody has a hint in this direction, let me know!
> > 
> > My problem is, that GetValue() always returns the length 255 for CHAR
> fields
> > when using ODBC. 
> > This is because a NULL-character is returned at the end of the string
> (which
> > in my opinion is the actual bug). This leads to the wrong string size
> and to
> > a complete mess when I try to display a database result in a ASP.NET
> > DataGrid.
> > 
> > If I remove the NULL manually, everything is OK.
> > I tested this with Mono 1.1.6 (on Windows and SLES9/unixODBC); MS .NET
> > behaves OK - no NULL characters and string length is correct.
> > 
> > This is no Informix specific behaviour. It appears everytime on every
> CHAR
> > column when using ODBC. VARCHARS work OK.
> > I have created a test case for the Firebird database in Bugzilla
> > (http://bugzilla.ximian.com/show_bug.cgi?id=74758) for easier
> reproduction.
> 
> -- 
> Michael J. Ryan - tracker1(at)theroughnecks(dot)com -
> www.theroughnecks.net
> icq: 4935386  -  AIM/AOL: azTracker1  -  Y!: azTracker1  -  MSN/Win:
> (email)
> 

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++


More information about the Mono-list mailing list