• Ryuu Hakukin
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

When I run the following code i got error like 

 

"controllercls2 Compile Error: Illegal assignment from LIST<Account> to LIST<Account> at line 9 column5" 

 

And

 

When i insert out side of constructor " lst=[select id,name,phone from Account]; "

I got Error lik this

 

 

"Error: controllercls2 Compile Error: unexpected token: '=' at line 11 column 3 "

 

 

<apex:page controller="controllercls2" id="page">
<apex:form id="form">

<apex:outputlabel >Enter Text to search</apex:outputlabel>
<apex:inputtext />
<apex:commandButton value="Search" />
<apex:pageblock id="pb">
<apex:pageblocktable value="{!lst}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone}"/>
</apex:pageblocktable>


</apex:pageblock>
</apex:form>
</apex:page>

 

------------------------------------------

 

public with sharing class controllercls2 {

public List<Account> lst { get; set; }


public controllercls2()
{

lst=[select id,name,phone from Account];
}


}