locked
Accessing SSMS 2008 R2 results pane via extensibility add-in RRS feed

  • Question

  • Hi

    I'm trying to write an add-in into SSMS 2008 R2 using Visual Studio 2010 extensibility project.
    What I am wanting to do, is allow the user to right click on a cell in the results showing in the query results pane, pop-up a context menu and from these menu items execute further queries based on the value in the cell selected.
    So far I have successfully created an empty add-in that does load into SSMS - I say empty, as I know it loads, but has no other functionality.
    Can someone point me in the right direction as far as what SQL libraries to look in  to gain access to the results pane?

    Thanks
    Rod

    Wednesday, November 24, 2010 2:40 AM

Answers

All replies

  • Hi Rodj,

     

    Welcome to MSDN forums! Thank you for your question.

    We’re doing research on this issue. It might take some time before we get back to you.

     

    Best Regards,

    Ziwei Chen

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Wednesday, November 24, 2010 9:34 AM
  • Hi Rod,

    Building/running addins for SSMS isn't a supported scenario. While it's possible to run addins in the SSMS environment (due to the fact that SSMS is based on the Visual Studio shell, this is a scenario that is undocumented and untested. Consequently, most of the deveopers that have done this, have done a lot of snooping with tools like Reflector.

    I was able to dig up the following links. But your running into uncharted waters building/running addins in the SSMS environment.

       SSMS Addins
       SQL Server 2008 Extended Events SSMS Addin
       SSMS 2008 Addin - Data Scripter
       Internals Viewer for SQL Server
       Fulltext Management for SQL Server (Express)

    Last but not least (because it's still fresh in my memory)

       COM Error in VS2010 Plug-in (aka how to get the DTE interface with SSMS 2008)

    Sincerely,


    Ed Dore
    Friday, December 3, 2010 5:37 PM
  • I would love to know if you ever got a solution to this problem.

    I can add an item to the context menu easily enough - but dont know how to access the grid of results underneath.

     

    Microsoft.VisualStudio.CommandBars.CommandBar sqlQueryGridPane = ((CommandBars)_applicationObject.CommandBars)["SQL Results Grid Tab Context"];
    
    CommandBarControl cmdBarControl2 = sqlQueryGridPane.Controls.Add(MsoControlType.msoControlButton, Missing.Value, Missing.Value, Missing.Value, true);
    
    myButton = (CommandBarButton)cmdBarControl2;
    
    myButton.Visible = true;
    
    myButton.Enabled = true;
    
    myButton.Caption = "XXX SQL";
    
    myButton.FaceId = 224;
    
    myButton.Style = MsoButtonStyle.msoButtonIconAndCaption;
    
    myButton.Click += new _CommandBarButtonEvents_ClickEventHandler(btnMEssageBoxxResults_Click);
    
    


     

     

     

     

    Saturday, January 1, 2011 2:02 PM
  • @Dickster1977 thank You!
    Wednesday, November 21, 2018 6:11 PM