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
micwamicwa 

QueryResult

Im new to .Net...

Isn't it possible to cast the QueryResult to an SObject where I can access the properties with dot notation instead of using case?

What  I did
Code:
apex.QueryResult all = binding.query("Select a.Id, a.Name from Account");
foreach (var item in all.records)
{
  foreach (XmlElement col in item.Any){
     switch (col.LocalName.ToLower())
     {
         case "id":
            //to something
     }
  }
}

 Is that the only possibility? I would like to have something like:
String accountName = item.Name;

Thanks for your help.

SuperfellSuperfell
You can do that if you use the enterprise WSDL instead of the partner WSDL.