+ Start a Discussion
hfeisthfeist 

string puzzle

This I find very strange.

I am doing a simple query for all Cases by SuppliedEmail. If I hard-code a known email address into the query string results are returned successfully, like this:

string queryStr="Select Description, ContactId, Id From Case Where SuppliedEmail = 'hf@feistworks.com'";
salesForce.sforce.QueryResult qr = binding.query(queryStr);

but if I use a variable in the query like this the query returns no results at all:

string queryStr="Select Description, ContactId, Id From Case Where SuppliedEmail = '" + email + "'";

Both strings look the same when I verify the email variable by Response.Write("queryStr="+queryStr);

I am baffled!

DevAngelDevAngel

Hi hfeist,

Hmm....  Must be the value in the email variable.  Might there be a trailing space or something like that?  Maybe try email.Trim().