Filling a DataTable
<p>In my asp page users can search students from TextBox and a search button. Every time they made a search a student object returns. I just want to be able to fill a gridview with student object but every time page loads, the page doesn't remember the former searches. What I mean by this, my gridview turns out empty. How can I fill a gridview?</p>

<pre><code>List&lt;Student&gt; oList;
protected void Page_Load(object sender, EventArgs e)
{
    if (IsPostBack)
    {
        oList = new List&lt;Student&gt;();
    }
}

protected void AddLinkButton_Click(object sender, EventArgs e)
{
    Student oStudent = new Search().WithId(StudentIdTextBox.Text);
    // Student object is recevied
    oList.Add(oStudent);
    StudentGridView.DataSource = oList;
    StudentGridView.DataBind();

}

class Student { // Just a simple student class
    int id;
    string name;
    string sname;
}
</code></pre>

<p>Every time search method is called, I want to be able to put the student data to DataTable so that I can bind it to GridView. I just dont know how to achieve this.</p>
