Excel + npgsql + postgres。 指定的转换不是有效的exception

我正尝试使用Power Query和Npgsql连接器将我的MS Excel 2013 Pro +与PostgreSQL数据库连接起来。

一切似乎都很好,直到 – 我会尝试运行自定义查询(例如,从表中select*)。 然后 – 出现错误消息:“指定的cas无效”。 如果我将使用数据库结构浏览器 – 我可以select表或视图,并点击“加载”,但它也给我同样的错误。

有什么我做错了,或者是在连接器有一些错误?

这里是Excel的堆栈跟踪:

Feedback Type: 

皱眉(错误)

时间戳:2017-08-21T09:14:00.7435203Z

当地时间:2017-08-21T11:14:00.7435203 + 02:00

产品版本:2.48.4792.941(PQ-CY17SU07)(x86)

发布:2017年7月

Excel版本:15.0.4420.1017

Excel安装位置:C:\ Program Files \ Microsoft Office \ Office15 \ EXCEL.EXE

IE版本:11.0.9600.17843

操作系统版本:Microsoft Windows NT 6.1.7601 Service Pack 1(x86 pl-PL)

CLR版本:4.6.1或更高版本[版本号= 394271]

工作簿软件包信息:1 * – zh-CN,查询组:0,fastCombine:已禁用,runBackgroundAnalysis:True。

峰值工作集:268 MB

私人内存:231 MB

峰值虚拟内存:930 MB

错误消息:指定的转换无效。

堆栈跟踪:Microsoft.Mashup.Evaluator.Interface.ErrorException:指定的转换无效。 —> Microsoft.Mashup.Evaluator.Interface.ErrorException:指定的转换无效。 —> Microsoft.Mashup.Evaluator.Interface.ErrorException:指定的转换无效。 —> System.InvalidCastException:指定的转换无效。 —> System.InvalidCastException:指定的转换无效。 Microsoft.OleDb.Serialization.PageWriter.WriteSchema(DataTable schemaTable)at Microsoft.OleDb.Serialization.OleDbPageWriter..ctor(Stream stream,DataTable schemaTable)at Microsoft.Mashup.Evaluator.RemotePageReader。<> c__DisplayClass7.b__0()at Microsoft .Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace,IEngineHost engineHost,IMessageChannel channel,Action action)—内部exception堆栈跟踪结束—在Microsoft.Mashup.Evaluator.EvaluationHost。<> c__DisplayClass7.b__6()at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace跟踪,IEngineHost engineHost,IMessageChannel通道,exception例外)上Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost主机,IHostTrace跟踪,操作操作)Microsoft.Mashup.Evaluator.EvaluationHost .ReportExceptions(IHostTrace跟踪,IEngineHost engineHost,IMessageChannel通道,动作操作)在Microsoft.Mashup.Evaluator.RemotePageReader.RunStub(IEngineHost engineHost,IMessage 1 getPageReader) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass11.<OnBeginGetDataReaderSource>b__f(EvaluationResult2 1 result)at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service。<> c__DisplayClass1e 1.<OnBeginGetResult>b__1b() at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action Channel channel,Func 1 getPageReader) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass11.<OnBeginGetDataReaderSource>b__f(EvaluationResult2 1.<OnBeginGetResult>b__1b() at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action 1 1.<OnBeginGetResult>b__1b() at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action (Microsoft.Mashup.Evaluator.MessageHandlers)上的Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetDataReaderSource(IMessageChannel通道,BeginGetDataReaderSourceMessage消息)上的Microsoft.Mashup.Evaluator.MessageHandlers。<> c__DisplayClassa 1.<AddHandler>b__8(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel) at Microsoft.Mashup.Evaluator.MessageHandlers.<>c__DisplayClassa 1.<AddHandler>b__8(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel) at Microsoft.Mashup.Evaluator.MessageHandlers.<>c__DisplayClassa 1.b__8(IMessageChannel channel,Message message)at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel,Message message)at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch( IMessageChannel通道,消息消息)在Microsoft.Mashup.Evaluator.MevaluHandlers.Dispatch(IMessageChannel通道,消息消息)在Microsoft.Mashup.Evaluator.EvaluationHost.Run()在Microsoft.Mashup.Container.EvaluationContainerMain.Run(对象参数)at Microsoft.Mashup.Evaluator.SafeThread2。<> c__DisplayClass2.b__0(Object o)at Microsoft.Mash (Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String [] args)上的Microsoft.Mashup.Evaluator.SafeThread2。<> c__DisplayClass2.b__1(Object o)上的.evaluator.SafeThread2。<> c__DisplayClass15.b__14 Microsoft.Mashup.Container.EvaluationContainerMain.Main(String [] args)—在Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost,IMessageChannel通道,ExceptionMessage消息)处的内部exception堆栈跟踪结束。 Microsoft.Mashup.Evaluator.MessageHandlers上的Mashup.Evaluator.RemoteEvaluationContainerFactory.Container.OnException(IMessageChannel通道,ExceptionMessage消息)。<> c__DisplayClassa 1.<AddHandler>b__8(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel) at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunkAndCheckIfClosed() at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunk() at Microsoft.Mashup.Evaluator.ChunkedInputStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryReader.FillBuffer(Int32 numBytes) at System.IO.BinaryReader.ReadInt32() at Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.ReadITableSource(BinaryReader reader) at Microsoft.Mashup.Evaluator.RemotePageReader.CreateProxy(IEngineHost engineHost, IMessageChannel channel, ExceptionHandler exceptionHandler) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.DataReaderSourceRemoteEvaluation.GetResult(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall) --- End of inner exception stack trace --- at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation 1.<AddHandler>b__8(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel) at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunkAndCheckIfClosed() at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunk() at Microsoft.Mashup.Evaluator.ChunkedInputStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryReader.FillBuffer(Int32 numBytes) at System.IO.BinaryReader.ReadInt32() at Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.ReadITableSource(BinaryReader reader) at Microsoft.Mashup.Evaluator.RemotePageReader.CreateProxy(IEngineHost engineHost, IMessageChannel channel, ExceptionHandler exceptionHandler) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.DataReaderSourceRemoteEvaluation.GetResult(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall) --- End of inner exception stack trace --- at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation 1.<AddHandler>b__8(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message) at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel) at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunkAndCheckIfClosed() at Microsoft.Mashup.Evaluator.MessageBasedInputStream.ReadNextChunk() at Microsoft.Mashup.Evaluator.ChunkedInputStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryReader.FillBuffer(Int32 numBytes) at System.IO.BinaryReader.ReadInt32() at Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.ReadITableSource(BinaryReader reader) at Microsoft.Mashup.Evaluator.RemotePageReader.CreateProxy(IEngineHost engineHost, IMessageChannel channel, ExceptionHandler exceptionHandler) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.DataReaderSourceRemoteEvaluation.GetResult(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall) --- End of inner exception stack trace --- at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation 1.TryCompleteWithException(exception例外)在Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate (对象状态)Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)at Microsoft.Mashup.Evaluator.GlobalizedEvaluatorThreadPool。<> c__DisplayClass4.b__3(Object s)at Microsoft.Mashup.Evaluator.EvaluatorThreadPool.EvaluatorThread(Object state) Microsoft.Mashup.Evaluator.SafeThread2。<> c__DisplayClass2.b__0(Object o)at Microsoft.Mashup.Evaluator.SafeThread2。<> c__DisplayClass15.b__14(Object o)at Microsoft.Mashup.Evaluator.SafeThread2。<> c__DisplayClass2.b__1 (Object o)在System.Threading.ThreadHelper.ThreadStart_Context(对象状态)在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallbackcallback,对象s 在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallbackcallback,对象状态,布尔preserveSyncCtx)在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallbackcallback,对象状态)System.Threading.ThreadHelper .ThreadStart(Object obj)—内部exception堆栈跟踪结束—

服务器堆栈跟踪:

在Microsoft.OleDb.AsyncResult上的Microsoft.OleDb.AsyncResult 1.get_Value() at Microsoft.Mashup.OleDbProvider.DataHost.BufferingMashupEvaluator.BufferingMashupEvaluation.GetBufferedReaderSource(AsyncResult 1结果)上1.get_Value() at Microsoft.Mashup.OleDbProvider.DataHost.BufferingMashupEvaluator.BufferingMashupEvaluation.GetBufferedReaderSource(AsyncResultexception。 OnEvaluationComplete(AsyncResult`1结果)

在Microsoft.Mashup.Client.Excel.Fill.PollingFillDownloadWorker上Microsoft.Mashup.Client.Excel.Fill.PollingFillDownloadWorker.b__1()上的Microsoft.Mashup.Host.ProviderShared.MashupResource.GetStatus()处重新生成exception。 InvokeWorker(Func`1动作)

调用堆栈跟踪:Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo上的Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace,String invocationStackTrace)上的Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace() 1 errorCode, String requestId, Exception exception) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e) at Microsoft.Mashup.Client.Excel.Fill.FillSession.HandleDownloaderException(IWorkbook workbook, Exception e) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.FillDownloadResult(IWorkbook workbook, Boolean onTimer) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.<>c__DisplayClass4.<ResumeFill>b__0() at Microsoft.Mashup.Client.Excel.Fill.IUndoServicesExtensions.<>c__DisplayClass2.<InvokeWithConditionalDiscardedUndoScope>b__0(IUndoScope undoScope) at Microsoft.Mashup.Client.Excel.Shim.AddInUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action ctor(String message,Nullable 1 errorCode, String requestId, Exception exception) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e) at Microsoft.Mashup.Client.Excel.Fill.FillSession.HandleDownloaderException(IWorkbook workbook, Exception e) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.FillDownloadResult(IWorkbook workbook, Boolean onTimer) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.<>c__DisplayClass4.<ResumeFill>b__0() at Microsoft.Mashup.Client.Excel.Fill.IUndoServicesExtensions.<>c__DisplayClass2.<InvokeWithConditionalDiscardedUndoScope>b__0(IUndoScope undoScope) at Microsoft.Mashup.Client.Excel.Shim.AddInUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action 1 errorCode, String requestId, Exception exception) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e) at Microsoft.Mashup.Client.Excel.Fill.FillSession.HandleDownloaderException(IWorkbook workbook, Exception e) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.FillDownloadResult(IWorkbook workbook, Boolean onTimer) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.<>c__DisplayClass4.<ResumeFill>b__0() at Microsoft.Mashup.Client.Excel.Fill.IUndoServicesExtensions.<>c__DisplayClass2.<InvokeWithConditionalDiscardedUndoScope>b__0(IUndoScope undoScope) at Microsoft.Mashup.Client.Excel.Shim.AddInUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action Microsoft.Mashup.Client.Excel.Fill.IUndoServicesExtensions.InvokeWithConditionalDiscardedUndoScope(IUndoServices undoServices,布尔条件,IWorkbook工作簿,UndoableActionType操作types,操作操作)上的1 errorCode, String requestId, Exception exception) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback) at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e) at Microsoft.Mashup.Client.Excel.Fill.FillSession.HandleDownloaderException(IWorkbook workbook, Exception e) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.FillDownloadResult(IWorkbook workbook, Boolean onTimer) at Microsoft.Mashup.Client.Excel.Fill.PollingInitialFillSession.<>c__DisplayClass4.<ResumeFill>b__0() at Microsoft.Mashup.Client.Excel.Fill.IUndoServicesExtensions.<>c__DisplayClass2.<InvokeWithConditionalDiscardedUndoScope>b__0(IUndoScope undoScope) at Microsoft.Mashup.Client.Excel.Shim.AddInUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action 1操作)Microsoft.Mashup.Client.Excel .Fill.PollingInitialFillSession.ResumeFill(Boolean onTimer)at Microsoft.Mashup.Client.Excel.PollingFillManager.b__7(IFillSession fillSession)at Microsoft.Mashup.Client.ClientShared.Model.QueriesUtilities.ForEachWithChangeScope [T](IEnumerable 1 items, Func 2 getQueries,动作1 action) at Microsoft.Mashup.Client.Excel.Fill.FillManager.ForEachFillSessionByWorkbook(Action 1动作)在Microsoft.Mashup.Client .Excel.PollingFillManager.UpdateQueries()在Microsoft.Mashup.Client.Excel.PollingFillManager.b__6()上的Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler,Action操作)在Microsoft.Mashup.Client.Excel。 PollingFillManager.OnFillUpdateTimerTick(对象发件人,EventArgs eventArgs)在System.Windows.Forms.Timer.OnTick(EventArgs e)在System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&m)在System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)

用户ID:f1b43d3f-ed65-4886-993e-0d6507a0de3f

支持高级内容:True

遥测启用:是

DPI比例:100%

公式:

第1节;

共享#“DataRecords Campaign_000008”= DataRecords_Campaign_000008; DataRecords_Campaign_000008; DataRecords_Campaign_000008 =“DataRecords_Campaign_000008”=“DataRecords”,Item =“Campaign_000008”

共享#“DataRecords_Campaign_000008_ChangeLog”= DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog; DataRecords_Campaign_000008_ChangeLog;

答案是:在npgsql 3.2.5中的错误 – 在安装3.1.9之后 – 一切正常gr8;)