+ Start a Discussion
Rajesh SFDCRajesh SFDC 

how to get files from salesforce using c# ?

here my requirments.. i want to get a files form attachments object from salesforce
                       using c# code.plz help me .
Best Answer chosen by Rajesh SFDC
Sonam_SFDCSonam_SFDC
Hi Rajesh,

The following thread gives a couple of link where there is sample code available to fetch attachments form Salesforce using C#, please have alook:
http://salesforce.stackexchange.com/questions/1877/how-to-get-update-an-existing-attachment-using-c

Hope they are of use to you..

All Answers

Sonam_SFDCSonam_SFDC
Hi Rajesh,

The following thread gives a couple of link where there is sample code available to fetch attachments form Salesforce using C#, please have alook:
http://salesforce.stackexchange.com/questions/1877/how-to-get-update-an-existing-attachment-using-c

Hope they are of use to you..
This was selected as the best answer
Rajesh SFDCRajesh SFDC
here i want to fetch the case object for corresponding all attachments
using casenumber

public void getFilesfromSalesforce(string strCaseno)
{
        try
        {
            binding = new SforceService();
            lr = binding.login(strUserName, strpassword);
            loginResult = lr;
            //SforceService salesforce = new SforceService();
            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = loginResult.sessionId;
            binding.Url = loginResult.serverUrl;
           
            QueryResult qResult = null;
            //Enterprise.Attachment at = new Enterprise.Attachment();
            //at.
         
         String soqlquery2 = "SELECT Id, CaseNumber,Status FROM Case  where CaseNumber =:"+ strCaseno;
         String soqlQuery = "Select Id, ParentId From Attachment where ParentId = " + soqlquery2.CaseNumber; here i am getting an error malformed query

            qResult = binding.query(soqlQuery);

           
        }
        catch (Exception ex)
        {

          
        }