Exemplo n.º 1
0
        /// <summary>
        /// Get the sql script stored in the application resources
        /// </summary>
        /// <param name="script"></param>
        /// <returns></returns>
        public string GetScript(Scripts.Scripts script)
        {
            Assembly a = Assembly.GetExecutingAssembly();

            using (Stream resFilestream = a.GetManifestResourceStream("DataLib.Scripts." + script.DescriptionAttr()))
            {
                if (resFilestream != null)
                {
                    StreamReader br = new StreamReader(resFilestream);
                    return(br.ReadToEnd());
                }
            }
            return(string.Empty);
        }