You need to sign in to do that
Don't have an account?

uploading attachments in C# HELP PLEASE!!!
Hi,
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.");
}
else
{
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
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.");
}
else
{
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
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.
Rhonda