Exception has been thrown by the target of an invocation
Georgeh
Posts: 4 New member
I am getting an error when trying to open a query result into Excel or script it into an Insert. This started happening after the last update or SQL Prompt. I am now running version 10.6.9.19437. These are the errors I am getting
2021-04-27 09:18:18.286 -04:00 [Error] Report error dialog UI shown
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SQLPrompt.CommonVS.ResultsGrid.OpenInExcel.OpenInExcelController.DoFailedAction(Exception exception, OpenInExcelProgressDialog progressDialog)
at RedGate.SQLPrompt.CommonVS.ResultsGrid.OpenInExcel.OpenInExcelController.<>c__DisplayClass13_0.<DoFailedAction>b__0()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at RedGate.SQLPrompt.CommonUI.Utils.UIThreadInvoker.<>c__DisplayClass6_0.<BeginInvoke>b__1()
at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)
2021-04-27 09:19:00.636 -04:00 [Error] Report error dialog UI shown
System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SqlPrompt.Core.Utils.ReflectionUtils.TryGetPropertyValue[TValue](Object instance, String property, TValue& value)
at RedGate.SQLPrompt.CommonUI.Editor.ResultsGrid.ResultsWindow.PopulateCell(ResultsGridColumn column, Int64 rowNumber, Object resultsSet)
at RedGate.SQLPrompt.CommonUI.Editor.ResultsGrid.ResultsWindow.<>c__DisplayClass5_0.<CreateResultsGridSelection>b__1(ResultsGridColumn columnNumber, Int64 rowNumber)
at RedGate.SQLPrompt.CommonUI.Editor.ResultsGrid.ResultsGridSelection.<PopulateSelectionWithData>d__21.MoveNext()
at RedGate.SQLPrompt.CommonUI.Editor.ResultsGrid.ScriptAsInsert.CreateInsertBody(ResultsGridSelection selection, StreamWriter writer)
at RedGate.SQLPrompt.CommonUI.Editor.ResultsGrid.ScriptAsInsert.ScriptResults(IEnumerable`1 selections, Stream stream)
at RedGate.SQLPrompt.CommonUI.Commands.ScriptAsInsertController.Execute()
at RedGate.SQLPrompt.CommonPackageCommands.OleCommandScriptAsInsert.Execute()
at RedGate.SQLPrompt.CommonPackageCommands.PromptOleMenuCommand.<>c__DisplayClass4_0.<Execute>b__0()
at RedGate.SQLPrompt.UsageReporting.ErrorReporting.ErrorReporterWithUI.Do(Action action)
Is there a work around or fix available? I need this functionality back asap.
Thank you
Is there a work around or fix available? I need this functionality back asap.
Thank you
Tagged:
Answers
Thank you for your post.
Just to clarify, are you ruining into this issue with SQL Prompt v10.6.9?
If so then I believe a fix was released in v10.6.10 for this issue. Here is a link to the installer:
https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.6.10.19533.exe
Could you check that you have the Redgate client service running? If you run services.msc and search the list for the client service then yu should be able to check if it is running or not. If it is running then I recommend restarting it and then try to activate the tools once more.