Re: DataGridBoolColumn funktioniert mit Oracle nicht

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Peter Monadjemi (peterm_at__kein_spam_activetraining.de)
Date: 02/04/05


Date: Fri, 4 Feb 2005 16:58:28 +0100

Hallo Steffen,

Einen erlösenden Tipp habe ich sicher nicht, aber wie rufst Du die Daten
denn genau ab? Ich glaube, die Ursache liegt nicht bei der Frage, was ist im
DataGrid ist, sondern wie Du es dort hineingeschaufelt hast. Vermutlich über
den OracleDataAdapter, doch benutzt Du ein parametrisiertes SQL-Kommando
oder eine Stored Procedure? Was bindest Du an DataSource vom DataGrid usw.

Wenn Dir jemand helfen soll, der nicht jeden Tag gegen Oracle DBs
programmiert oder genau das Phänomen schon gehabt hat, musst Du glaube ich
ein paar Programmzeilen mehr zur Verfügung stellen.

Ich würde mir an Deiner Stelle die DataTable anschauen und welcher Typ dort
enthalten ist und dann das SQL-Kommando mit seinen Parametern. Vielleicht
hast Du Dich auch auf die Default-Konvertierung der Datentypen verlassen
(nur eine Vermutung;)

Hier ist noch ein Dokument, das ein paar allgemeine Hinweise enthält:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/adonetbest.asp

Viele Grüße,
Peter
(MVP Visual Basic.NET)

"Fricke Steffen" <fulbebamoun@freenet.de> schrieb im Newsbeitrag
news:42025fec$0$20305$9b622d9e@news.freenet.de...
> Hi.
> Während das hier
>
> boolCol1.MappingName = "na_flag"
> boolCol1.HeaderText = "Nicht auftr.bezogen"
> boolCol1.Alignment = HorizontalAlignment.Left
> boolCol1.Width = 100
> boolCol1.TrueValue = True
> boolCol1.FalseValue = False
> boolCol1.NullValue = Convert.DBNull
> tgts.GridColumnStyles.Add(boolCol1)
>
> unter MS SQL Server tadellos funktioniert, wird unter Oracle (9.x.x) ein
> DBNull-Wert in der Table erzeugt. Wenn ich die Zelle mit
>
> VarBool = CBool(DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 8))
>
> auslese, bekomme ich ein "Ungültige Konvertierung von Typ 'DBNull' in
> Typ 'Boolean'." obwohl von der Datenbank ein Wert (Integer) geliefert
> wird und das FEld definitiv NICHT DBNull ist!
>
>
> Wo liegt das Problem in Oracle? Hat jemand vielleicht einen erlösenden
> Tipp?
>
> Gruß
> Steffen
> --
> Immer auf dem aktuellen Stand mit den Newsgroups von freenet.de:
> http://newsgroups.freenet.de
>
>



Relevant Pages

  • Re: Connect a Web Part to an Oracle db
    ... Sharepoint etc. Coming from such an impoverished technical ... I've problems establishing a connection to Oracle ... DataGrid dgPersonalDetails; ... /// CreateChildControls ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: solution required
    ... I wanted to add checkbox and image in the datagrid and i had done that ... DataGrid by using an Oracle Blob type field or a record. ... Collection and bind either one of them containing the objects DataGrid. ...
    (comp.programming)
  • Re: solution required
    ... I don't think you're going to be able to do that with binding data to a DataGrid by using an Oracle Blob type field or a record. ... You're going to have to do that manually with getting the data from Oracle by using an ADO.NET Reader, reading the records, creating objects of those records, populating the objects into an ArrayList or a strong typed bindable Collection and bind the ArryList of the Collection using the IBindable interface with either the Arraylist, which is auto bindable, or a strong type Collection that is bindable with using IBindable on the Collection and bind either one of them containing the objects DataGrid. ...
    (comp.programming)
  • oracle and datagrid problem with vb.net
    ... database and displaying them in a datagrid using ... oracledataadapter and oracle dataset. ... DataGridTableStyle and the style of this boolean column i ... row by row and add it to the datagrid in a loop. ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Ergebnis eines selects in eine Datei umlenken
    ... Bei ORACLE ist das absolut simpel und funktioniert ... Vielen Dank für jeden Tipp, ... Thomas ...
    (microsoft.public.de.sqlserver)