Thank you for the response. However, what I was looking for was a way
to, from a vs addin, open a sql file in vs 2010. You need to get an
instance of the DTE2 object for the running instance of vs. The
solution I found was this...

//get DTE2 object for running instance
DTE2 app =
(DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.
10.0");

 // open the SQL file in the editor window
Application.ItemOperations.OpenFile("e:\sql\sqlfile1.sql",
Constants.vsViewKindAny);

Thanks again!

rbr

On Dec 5, 9:55 pm, Raghupathi K <[email protected]> wrote:
> VS2010 comes with basic SQL editor and ability to "Execute SQL"
>
> On Dec 6, 5:59 am, rbr <[email protected]> wrote:
>
>
>
> > I am creating a custom add-in for VS 2010 that manages database
> > stored
> > procedures and other sql code. One of the features is going to be the
> > ability to edit the code files from VS. I am, however, having
> > difficulty understanding how to open the sql file in the IDE. I see
> > all the posts about the ItemOperations.OpenFile command which looks
> > like what I need but, I seem to be missing something in translation.
> > It looks like I need a DTE2 object but I am not sure how to get that?
> > I'm sure I am missing something too obvious. I would greatly
> > appreciate any help that could get me moving forward on this.
>
> > Best regards.
>
> > rbr- Hide quoted text -
>
> - Show quoted text -

Reply via email to