I guess you don't need to execute this
code, when the event gets fired.
So, better to put it inside
, so that it will be fired once while loading the
and it will not get executed on the
button click events.
protected void Page_Load(...)
var students = from std in database.students
foreach (student std in students)