views:

88

answers:

1

Trying to write a list of oracle commands to XML but keep getting this error. This is driving me crazy. Thanks in advance.

"There was an error reflecting 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
A: 

Maybe you need a memento or something that would extract the state from the OracleCommand, things like CommandText, CommandType, Timeout, and so on.

It may not make sense to serialize the Parameters property.

Cheeso