function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

uploading attachments in C# HELP PLEASE!!!


I am trying to a use code sample that I found here but having some compile errors that I can't past. Below is the code up until the error message line.

sForce.SforceService binding = new sForce.SforceService();
sForce.LoginResult lr = binding.login(sUsername, sPWD);
binding.SessionHeaderValue = new sForce.SessionHeader();
binding.SessionHeaderValue.sessionId = lr.sessionId;
binding.Url = lr.serverUrl;

sForce.sObject doc = new sForce.sObject();
System.IO.FileInfo fi = new System.IO.FileInfo(mydoc.Filename);
if (fi.Length > 5000000)
Response.Write ("This file is too big. The maximum document size is 5 MB.");
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
doc.Any = new System.Xml.XmlElement[4];

The error message I am getting is:
sForce.sObject does not contain a definition for 'Any'

How can I fix this?

Thanks in advance.

Rhonda Bailey
The .Any from using the partner WSDL, and you're using the enterprise WSDL.

SimonF wrote:
The .Any from using the partner WSDL, and you're using the enterprise WSDL.

Yep I discovered that shortly after I posted the question then I forgot to go back and say I figured it out.

Thanks for responding. It all works beautifully.