I've finally achieved Logging into my Salesforce Sandbox using the C# program i wrote in VS2013. Now im tweaking some things and i'm still new at this.

Basically my question is, How do i Pull already created users from the sandbox to my program and put each user in my List box?

the code i have currently doesnt do a whole lot and i cant find any other tutorials or code i can use.

        SforceService Sfdcbinding = null; 
        Lead updateLead = new Lead();

        updateLead.Id = Id;
        string newEmailAddress = txtEmail.Text;
        string newLastName = txtLastName.Text;
        updateLead.Email = newEmailAddress;
        updateLead.LastName = newLastName;

        SaveResult[] saveResults = Sfdcbinding.update(new sObject[] { updateLead });
  • I downvoted your question as there's a lot guides out there about accessing data with salesforce APIs in c# (SOAP in your case as I can see). All you have to do is perform query on User object and maybe cast the result from sObject to User type. Feb 24, 2015 at 21:38
  • No idea how to do that. I havn't programmed in over a year.. (use it or lose it type thing) Got any examples?
    – Jonathan
    Feb 24, 2015 at 21:55

1 Answer 1


I cannot specifically give detailed instructions in C# but here is you would do that in general.

  1. You will first need to login to Salesforce using user's credentials (You can use Partner Soap API login operation to do that).

  2. Construct a SOQL query to get the list of users of your liking (you can query the data using Partner API or Salesforce REST API).

  3. Parse the response, extract the user fields you looking for and populate the List box in the UI.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .