public ActionResult ViewErrorlog(int regid, int orgid) { Organisation o = new Organisation(); o = OrganisationDA.GetOrganisations(orgid); ViewBag.register = regid; ErrorlogDA.ChangeConnectionString("System.Data.SqlClient", "MCT-NIELS" + @"\DATAMANAGEMENT", Cryptography.Decrypt(o.DbName), Cryptography.Decrypt(o.DbLogin), Cryptography.Decrypt(o.DbPassword)); List <Errorlog> errorlist = new List <Errorlog>(); errorlist = ErrorlogDA.GetErrorlogs(regid); return(View(errorlist)); }