protected void Page_Load(object sender, EventArgs e)

{

String connectionString;

connectionString = conn.ConnectionString() = ConfigurationManager.ConnectionStrings["ExForSysConnectionString"].ConnectionString;

SqlConnection myConnection = new SqlConnection(connectionString);

SqlDataAdapter myCommand = new SqlDataAdapter("SELECT " + " StudentId, StudentName, StudentAge, CourseId" + " FROM StudentMaster", myConnection);

DataSet ds = new DataSet();

myCommand.Fill(ds);

DataView source = new DataView(ds.Tables[0]);

GridView1.DataSource = source;

Session["Source"] = source;

if (Session["sortorder"] == "")

Session["sortorder"] = "Ascending";

GridView1.DataBind();

    }