string queryStr = "SELECT id, Name FROM Account Where Name = '" + name + "'";
QueryResult qResult = _service.query(queryStr);
bool done = false;
if (qResult.size > 0)
{
while(!done)
{
sObject[] records = qResult.records;
for(int i = 0; i < records.Length; i ++)
{
sObject acc = records[i];
accountId = acc.id; // record id is null here
}
if (qResult.done)
{
done = true;
}
else
{
qResult = _service.queryMore(qResult.queryLocator);
}
}
}