Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / September 2005

Tip: Looking for answers? Try searching our database.

Database Project = vsProjectKindUnmodeled

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred - 13 Sep 2005 16:02 GMT
I have seen this question asked at least twice but no answer.

I do I get the path of a DatabaseProject inside my Addin?

I understand that Database projects are of 'kind' vsProjectKindUnmodeled,
but that does not tell me how to get the path to the dbp file.

There must be some sort of com interface define somewhere?

Signature

Fred

Dmitry Shaporenkov - 19 Sep 2005 14:22 GMT
Hello Fred,

your best bet is to use VSIP interfaces. Take a look at IVsHierarchy and
IVsProject.
IVsProject.GetMkDocument(VSITEMID_ROOT, out pbstrMkDocument) will likely
return what
you need.

'Unmodeled' (as I understand it) means that there are no Extensibility interfaces
implemented by
that project, so you can't get from it anything using Extensibility.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

> I have seen this question asked at least twice but no answer.
>
[quoted text clipped - 5 lines]
>
> There must be some sort of com interface define somewhere?
Fred - 21 Sep 2005 09:28 GMT
Thanks fior the reply.
Does unmodelled mean there is no com object that can be used behind the scene?
I've never touch extensibility before.

All I'm doing is writting an add for VS2003.

Not sure what IVsHierarchy, is that a VS2005 feature?I'm using VS2003

Here's the code I ended up with to add a sql file to the database project of
the solution.

Ideally I would haver like to test if the a given folder existed, create it
if not and then and add the new file in that folder.

string fileName = System.Environment.GetEnvironmentVariable("TMP") + "\\" +
storedProcName + ".sql";
                           
//Save the code to file
if(SaveCodeToFile(fileName,SQLComand)){
    //Should hopefully give us the name of the solution
    string slnName =
System.IO.Path.GetFileNameWithoutExtension(applicationObject.Solution.FullName);
    string item = slnName + "\\" + dbProjectName; // + "\\Queries";    //location
where the new file is to be added
                                   
    //Handle on Solution Explorer window
    EnvDTE.Window slnExplorer =
applicationObject.Windows.Item(Constants.vsWindowKindSolutionExplorer);
                        slnExplorer.Activate();

    //get the Database project so we can add a folder to it.
                        //EnvDTE.UIHierarchyItem dbProj =
((EnvDTE.UIHierarchy)applicationObject.Application.ActiveWindow.Object).GetItem(item);
    //dbProj.Select(vsUISelectionType.vsUISelectionTypeSelect);
                                //Select the folder into which we want to add the new stored
procedure.
                        EnvDTE.UIHierarchyItem X = ((EnvDTE.UIHierarchy)
applicationObject.Application.ActiveWindow.Object).GetItem(item);
    X.Select(vsUISelectionType.vsUISelectionTypeSelect);

    EnvDTE.Window newStoredProc =
(EnvDTE.Window)applicationObject.ItemOperations.AddExistingItem(fileName);
    X.Select(vsUISelectionType.vsUISelectionTypeSelect);

    //Clear up;
    if(System.IO.File.Exists(fileName)){
        System.IO.File.Delete(fileName);
    }
}
Signature

Fred

> Hello Fred,
>
[quoted text clipped - 23 lines]
> >
> > There must be some sort of com interface define somewhere?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.