Sharepoint - Building CAML query with AND and Order by Clause

Try this:

<OrderBy>
<FieldRef Name="ID" Ascending="TRUE"/>
</OrderBy>
<Where>
 <And>
  <Eq>
   <FieldRef Name="HomeType"/><Value Type="Choice">Condo</Value>
  </Eq>
  <Eq>
   <FieldRef Name="LastName"/><Value Type="Text">Doe</Value>
  </Eq>
 </And>
</Where>

I think that this code:

<Eq>
 <FieldRef Name = "HomeType"><Value Type="Choice">Condo</FieldRef>
</Eq>

must be like that:

<Eq>
   <FieldRef Name = "HomeType" /><Value Type="Choice">Condo</Value>
</Eq>

Tags:

Caml