protected void btnWriteToCsv_Click(object sender, EventArgs e) { Student studentObject = new Student(); string connectionString = ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString; studentObject.writeToCsv(connectionString); }