尝试将一个oracle命令列表写入XML,但不断收到此错误。这真让我抓狂。提前谢谢。
“反映类型'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 :(得分:0)
也许你需要一个纪念品或一些可以从OracleCommand中提取状态的东西,比如CommandText,CommandType,Timeout等等。
序列化Parameters属性可能没有意义。