ExecuteFile() public method

Executes a SQL file, from the file path
public ExecuteFile ( string filePath, string basePath = null ) : bool
filePath string The SQL file to execute
basePath string /// The base path to use to qualify relative path of any included files that are to be executed. /// If not supplied this will default to the directory path containing ///
return bool
示例#1
0
        /// <summary>
        /// Executes a SQL file on the given connection
        /// </summary>
        /// <param name="conn">Connection to execute the file on</param>
        /// <param name="file">The SQL file being executed</param>
        public static void ExecuteFile(
            SqlConnection conn,
            string filePath)
        {
            var sqlCmd = new SqlCmd(conn);

            sqlCmd.ExecuteFile(filePath);
        }
示例#2
0
		/// <summary>
		/// Executes a SQL file on the given connection
		/// </summary>
		/// <param name="conn">Connection to execute the file on</param>
		/// <param name="file">The SQL file being executed</param>
		public static void ExecuteFile (
			SqlConnection conn,
			string filePath) {
			var sqlCmd = new SqlCmd (conn);
			sqlCmd.ExecuteFile (filePath);
		}