Hi use this to dispaly the student records in gridview....
Design code
<asp:gridview id="GridView1" runat="server" xmlns:asp="#unknown">
</asp:gridview>
Code behind code
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection String name as in web Config file"].ConnectionString);
if (!Page.IsPostBack)
{
con.Open();
SqlCommand cmd = new SqlCommand("Your sql query here", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
}