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

Returning SQL recordset returns more than SELECT'd fields
Why does a simple SQL SELECT of 3 fields return a complete table recordset? Appears to return SELECT * FROM table regardless of the selected columns.
For example, this code queries Contact table and displays results into a ASP.NET data grid.
List<Contact> contacts = new List<Contact>();
//get a list of contacts so the user can select one
QueryResult qr = SforceApi90.query("SELECT Id, Email, Name FROM Contact ORDER BY Email");
if (qr != null)
{
for (int i = 0; i < qr.records.Length; i++)
{
Contact contact = (Contact)qr.records[i];
if (contact.Email != null && contact.Email != String.Empty)
contacts.Add(contact);
}
// dgContacts.Columns.
dgContacts.DataSource = contacts;
dgContacts.DataBind();
}
Chris
Thank you, Simon, that's helpful.
What are the differences between using the partner.wsdl versus the enterprise.wsdl? When should I, as a developer, use one of the other? Can you direct me to some documentation that discussed this in more detail?
Thanks!
Chris