2009-10-08 6 views
0

Essayez d'écrire une liste de commandes Oracle au format XML mais continuez à recevoir cette erreur. Ça me rend fou. Merci d'avance.Besoin d'aide Serializing System.Data.OracleClient.OracleCommand to XML?

"Une erreur est survenue lors de l'affichage du type" System.Data.OracleClient.OracleCommand "."

Friend Sub WriteDataToFile(ByVal Commands As List(Of System.Data.OracleClient.OracleCommand)) 
    Try 

     Dim PathName As String = OffloaderDataPath() & "Commands " & Now.ToLocalTime.Ticks.ToString & ".XML" 


     Dim writer As New System.Xml.Serialization.XmlSerializer(GetType(System.Data.OracleClient.OracleCommand)) 
     Dim file As New System.IO.StreamWriter(PathName) 
     writer.Serialize(file, Commands) 
     file.Close() 

     If BackgroundWorkerDatabase.DataBaseInsertsIsCancelled = True Then 
      BackgroundWorkerDatabase.Run() 
     End If 

    Catch ex As Exception 
     WriteToLog("CollectorFacility.WriteDAtaToFile: " & ex.Message) 
    End Try 


End Sub 
+0

Quelle partie de l'exception ne comprenez-vous pas? –

Répondre

0

Peut-être que vous avez besoin d'un souvenir ou quelque chose qui extrait l'état de la OracleCommand, des choses comme CommandText, CommandType, délai d'attente, et ainsi de suite.

Il peut être illogique de sérialiser la propriété Parameters.