How can we help you today? How can we help you today?

Exception has been thrown by the target of an invocation

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
Georgeh
0

Comments

5 comments

  • Ben_P
    Hi George, 

    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
    Ben_P
    0
  • EricLamontagne
    I downloaded the latest version of the toolbelt, but none of the tools can be successfully installed, RedGate Client service is not able to start. In the logs, I get the same error as reported by George
    EricLamontagne
    0
  • Ben_P
    Hi Eric,

    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.
    Ben_P
    0
  • Georgeh
    I wound up reinstalling sql prompt and that fixed it
    Georgeh
    0
  • Ben_P
    I'm glad to hear that you were able fix it. Did you install the latest version then?
    Ben_P
    0

Add comment

Please sign in to leave a comment.