private string GetFormScriptContent(string categoryName, string formName) { string content = "An error occurred while reading the form script."; string fileName = Path.GetTempFileName(); try { if (!_db.CheckOutFormScript(categoryName, formName, fileName)) { return(content); } using (StreamReader sr = new StreamReader(fileName, Encoding.Default)) { content = sr.ReadToEnd(); } File.Delete(fileName); } catch (CommenceCOMException) { } return(content); }