2 answers
Hii Yash Try Below Code
Please Mark It As Best Answer If It Helpspublic class searchBox {
public list <Account> acc {get;set;}
public String searchKey {get;set;}
public searchBox( ) {}
public void search(){
string searchquery='select Name,id from account where name like '+searchKey+'%' ;
acc.add(Database.query(searchquery));
}
}
Thank You!