How to assign value from controller

I want to assign a particular value to a table column or attribute
from controller
how can I do it plz help with a simple code