EnterpriseResourceGet() question

N

Nach

Hello:

I am using Project 2003. I am writing a C# code and a part of it tried to
add resources from the enterprise using the following code:

appObject.EnterpriseResourceGet(euid,ActiveProject.Resources.count);
[This works sometimes and sometimes gets back with the error -- argument
value is invalid]

if I use this code which works fine in VBA but not in C#
appObject.EnterpriseResourceGet(euid);
[This gives a compilation error-- No overload for method
EnterpriseResourceGet takes '1' arguments].

I'm not sure how to get a unique resource Id for the activeproject as it
always throws some kind of an error. Enterprise Resource ID is easy to
get...but not the ResourceID for the particular project.

Any help will be appreciated.

Thanks
Nachal.
 
S

Stephen Sanderlin

You should be able to get this information from the MSP_RESOURCES table.



As for the overload error, the interop assemblies aren't exactly CLS
compliant, so they support things like optional parameters, which C#
does not. Try sending System.Type.Missing (or
System.Reflection.Missing.Value - they're both the same thing) as the
second parameter for EnterpriseResourceGet.

--

Stephen Sanderlin

Principal Consultant

MSProjectExperts



For Project Server Consulting: http://www.msprojectexperts.com

For Project Server Training: http://www.projectservertraining.com



Read my blog at: http://www.projectserverhelp.com/

Join the community at: http://forums.epmfaq.com
 
N

Nach

Hi Stephen:

Yes you are right. I realised that right after posting this question.
Thankfully this method has only one optional parameter. Thanks a lot!

Nachal.

Stephen Sanderlin said:
You should be able to get this information from the MSP_RESOURCES table.



As for the overload error, the interop assemblies aren't exactly CLS
compliant, so they support things like optional parameters, which C#
does not. Try sending System.Type.Missing (or
System.Reflection.Missing.Value - they're both the same thing) as the
second parameter for EnterpriseResourceGet.

--

Stephen Sanderlin

Principal Consultant

MSProjectExperts



For Project Server Consulting: http://www.msprojectexperts.com

For Project Server Training: http://www.projectservertraining.com



Read my blog at: http://www.projectserverhelp.com/

Join the community at: http://forums.epmfaq.com





Hello:

I am using Project 2003. I am writing a C# code and a part of it tried to
add resources from the enterprise using the following code:

appObject.EnterpriseResourceGet(euid,ActiveProject.Resources.count);
[This works sometimes and sometimes gets back with the error -- argument
value is invalid]

if I use this code which works fine in VBA but not in C#
appObject.EnterpriseResourceGet(euid);
[This gives a compilation error-- No overload for method
EnterpriseResourceGet takes '1' arguments].

I'm not sure how to get a unique resource Id for the activeproject as it
always throws some kind of an error. Enterprise Resource ID is easy to
get...but not the ResourceID for the particular project.

Any help will be appreciated.

Thanks
Nachal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top