March 10, 2004

SharePoint tip

Accessing the contents of an MS Project 2003 file using C# .NET and the MS Project OLE DB provider:

Code Snippet
OleDbConnection projConn = new OleDbConnection("Provider=Microsoft.Project.OLEDB.11.0;Project Name=D:\\test.mpp");
OleDbDataAdapter projDa = new OleDbDataAdapter("SELECT * FROM Assignments", projConn);
DataSet test = new DataSet();

You can access the contents of a MS Project files stored in a Document Library.  This has proven to be a valuable tool for some of our clients and I thought it was a real pain in the ass to find information on how to do it.  If you have MS Project 2003 installed on your machine feel free to reference this file C:\Program Files\Microsoft Office\OFFICE11\1033\PJOLEDB.HTM

Took me forever to figure out that file even existed, luckily there is barely any information to be found on Google regarding this issue, at least not using relevant search terms, in my mind anyway.

WebPart displaying project file contents


Post a Comment

<< Home