Ads

Tuesday 9 July 2013

"SYSTEM.QUERYEXCEPTION: LIST HAS NO ROWS FOR ASSIGNMENT TO SOBJECT"

So I was quering Account a = [Select name from account where id=: strld];
and an exception was thrown: System.QueryExceptoin: List has no rows for assignment to SObject.

Here is the mistake I made and how to fix it:

List<Account>lst = [Select name from account where id=: strld];



1 comment: