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
edwinfarraredwinfarrar 

Accessing a queryresult record's data elements

I am using C#.NET 2.0. I need to access the data within a QueryResult record without casting the sObject to a SFDC Object (like User) class. I need to roll through the individual data elements of a given record in a systematic manner independent of what the underlying SFDC Object (User) actually is. I will know the names of the individual data elements because of the query's column listing.
 
For example, something like...
DataRow dr;
dr = dt.NewRow();
sObject drQR = qr.records[x];
dr[
"ID"] = drQR["ID"];
 
Edwin Farrar
SuperfellSuperfell
You can use reflection, or switch to using the partner WSDL, makes these kinds of things pretty trivial.
edwinfarraredwinfarrar
Thanks, the partner wsdl is exactly what I needed.
AcronymAcronym
Take a look at the partner samples for .NET.