When i create an object from QueryByAttribute class or QueryExpression
class and make attribute ColumnSet = new AllColumns(); or ColumnSet =
my_custom_cols; to my object
I take an error from mscrm:
"There is an error in XML document (1, 662). --->
System.FormatException: Input string was not in a correct format"

Re: CRM 3.0 problem with QueryByAttribute and QueryExpression by Arne

Arne
Fri Oct 21 09:38:11 CDT 2005

Hi Gaploid!

Gaploid wrote:
> When i create an object from QueryByAttribute class or QueryExpression
> class and make attribute ColumnSet = new AllColumns(); or ColumnSet =
> my_custom_cols; to my object
> I take an error from mscrm:
> "There is an error in XML document (1, 662). --->
> System.FormatException: Input string was not in a correct format"

Until the public v3 beta, please refer questions to the private beta
newsgroup.

Anyway, you can check if the following code works and if so, what you are
doing different.

// Standard CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the Query Object
QueryByAttribute query = new QueryByAttribute();
query.ColumnSet = new AllColumns();
query.EntityName = EntityName.account.ToString();

// Query will retrieve all account's whose address1_city is Heidelberg
query.Attributes = new string [] {"address1_city"};
query.Values = new string [] {"Heidelberg"};

// Execute the Retrieval
BusinessEntityCollection retrieved = service.RetrieveMultiple(query);

Cheers

Arne Janning



Re: CRM 3.0 problem with QueryByAttribute and QueryExpression by Gaploid

Gaploid
Thu Oct 27 04:55:36 CDT 2005

It`s very strange but it does not work with only one entity - sales
order, i`ve tested this code with acoount and contact - everything was
cool.

"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There is an error in XML document (1, 1112)."

And i use a http/soap sniffer to catch a response, and I recieve it!!
and then get such error.