Ejemplo n.º 1
0
        /// <summary>
        /// Executes a SQL script using the given connection string.
        /// </summary>
        /// <param name="connectionString"></param>
        /// <param name="script"></param>
        /// <param name="infoMessageHandler"></param>
        /// <returns></returns>
        public static ScriptResult ExecuteScript(string connectionString, string script, SqlInfoMessageEventHandler infoMessageHandler)
        {
            ScriptUtility utility = new ScriptUtility(connectionString, script);

            utility.ScriptInfoMessage += infoMessageHandler;
            return(utility.ExecuteScript());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Executes a SQL script using the given connection string.
        /// </summary>
        /// <param name="connectionString"></param>
        /// <param name="script"></param>
        /// <returns></returns>
        public static ScriptResult ExecuteScript(string connectionString, string script)
        {
            ScriptUtility utility = new ScriptUtility(connectionString, script);

            return(utility.ExecuteScript());
        }