Home Database Mysql Tutorial VS2005运行ssis包(vs2008,sql2008)

VS2005运行ssis包(vs2008,sql2008)

Jun 07, 2016 pm 03:09 PM
sql2008 vs2008 run

首先, 引用 10.0.0 .0 版本 dll ,如下: add assembly="Microsoft.SqlServer.Dts.Design, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/ add assembly="Microsoft.SqlServer.DTSPipelineWrap, Version=10.0.0.0, Culture=neutral

首先,引用10.0.0.0版本dll,如下:


 

using Microsoft.SqlServer.Dts.Runtime.Wrapper;

 

代码如下:

public int ExecuteSSASDts()
    {
        string filepath = urlconvertorlocal("Package.dtsx");
        if (!System.IO.File.Exists(filepath))
        {
            return 2;
        }
        // Call SSIS package from SQL Server.
        Application application = new ApplicationClass();       
        IDTSPackage100 package = application.LoadPackage(filepath,false,null);

        DTSExecResult result = package.Execute();
        if (result.Equals(DTSExecResult.DTSER_SUCCESS))
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
//相对路径转换成服务器本地物理路径
private string urlconvertorlocal(string imagesurl1)
    {
        string tmpRootDir = Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//获取程序根目录
        string imagesurl2 = tmpRootDir + "//Dashboard//" + imagesurl1.Replace(@"/", @"/"); //转换成绝对路径
         return imagesurl2;
     }


这个问题困扰了我好久,现发出来与大家共享,希望能给一些想我一样的菜鸟一些帮助

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to execute .sh file in Linux system? How to execute .sh file in Linux system? Mar 14, 2024 pm 06:42 PM

How to execute .sh file in Linux system? In Linux systems, a .sh file is a file called a Shell script, which is used to execute a series of commands. Executing .sh files is a very common operation. This article will introduce how to execute .sh files in Linux systems and provide specific code examples. Method 1: Use an absolute path to execute a .sh file. To execute a .sh file in a Linux system, you can use an absolute path to specify the location of the file. The following are the specific steps: Open the terminal

PyCharm usage tutorial: guide you in detail to run the operation PyCharm usage tutorial: guide you in detail to run the operation Feb 26, 2024 pm 05:51 PM

PyCharm is a very popular Python integrated development environment (IDE). It provides a wealth of functions and tools to make Python development more efficient and convenient. This article will introduce you to the basic operation methods of PyCharm and provide specific code examples to help readers quickly get started and become proficient in operating the tool. 1. Download and install PyCharm First, we need to go to the PyCharm official website (https://www.jetbrains.com/pyc

How to run Javascript from Python? How to run Javascript from Python? Sep 07, 2023 pm 11:33 PM

In Python, we can use the PyExecJS library or Python’s js2py library to run Javascript code. The PyExecJs library provides a consistent API to run JavaScript code from Python using a variety of JavaScript engines, including Node.js, JavaScriptCore, and Google's V8 engine. The js2py library allows you to execute JavaScript code in Python by parsing the JavaScript code and interpreting it in Python. This article will teach us how to run javasc from Python using the PyExecJS library

Reasons why exe files cannot be run on Windows 7 Reasons why exe files cannot be run on Windows 7 Feb 18, 2024 pm 08:32 PM

Why can't win7 run exe files? When using the Windows7 operating system, many users may encounter a common problem, that is, they cannot run exe files. exe files are common executable files in Windows operating systems. They are usually used to install and run various applications. However, some users may find that when they try to run the exe file, the system does not respond or gives an error message. There are many reasons for this problem. Below are some common causes and corresponding solutions:

Why can't I execute bat file on Windows 7? Why can't I execute bat file on Windows 7? Feb 19, 2024 pm 03:19 PM

Why can't win7 run bat files? Recently, many users using the Windows7 operating system have reported that they cannot run .bat files. This sparked widespread discussion and confusion. Why can't a well-functioning operating system run a simple .bat file? First, we need to understand the background of the .bat file. A .bat file, also known as a batch file, is a plain text file that contains a series of commands that can be used by the Windows command interpreter (cmd.ex

How to run m-file in matlab - Tutorial on running m-file in matlab How to run m-file in matlab - Tutorial on running m-file in matlab Mar 04, 2024 pm 02:13 PM

Do you know how to run m files in matlab? Below, the editor will bring you a tutorial on how to run m files in matlab. I hope it will be helpful to you. Let’s learn with the editor! 1. First open the matlab software and select the upper left "Open" the corner, as shown in the picture below. 2. Then select the m file to be run and open it, as shown in the figure below. 3. Press F5 in the window to run the program, as shown in the figure below. 4. We can view the running results in the command line window and workspace, as shown in the figure below. 5. You can also run the file by clicking "Run" directly, as shown in the figure below. 6. Finally, you can view the running results of the m file in the command line window and workspace, as shown in the figure below. The above is the matlab method that the editor brought to you

How to install sql2008-sql2008 installation tutorial How to install sql2008-sql2008 installation tutorial Mar 04, 2024 pm 04:50 PM

Do you know how to install sql2008? Below, the editor will bring you the installation tutorial of sql2008. I hope it will be helpful to you. Let’s follow the editor to learn it! 1. Unzip the installation package, select setup to run the installation program, as shown below shown. 2. Select "Install" on the left side of the SQL Server Installation Center interface, as shown in the figure below. 3. Select "New installation or add features to existing installation" on the right, as shown in the figure below. 4. Select "OK" in the interface, as shown in the figure below. 5. Select "Install" as shown in the figure below. 6. Wait patiently, as shown in the picture below. 7. Select "Next" as shown in the figure below. 8. Check Enter product key and select "Next" as shown in the image below. 9. Check "

Which win10 version runs the fastest? Which win10 version runs the fastest? Jan 05, 2024 pm 05:29 PM

Regarding Microsoft's new system Windows 10, friends want to know which version of the Windows 10 operating system runs the fastest and smoothest. Version updates are actually updates to system content and functions and repairs to defects. Which version of win10 runs the fastest? 1. The difference between each version of win10 is mainly in their respective functions. 2. Except for different functions, other aspects are the same. 3. There is no big difference between the various versions of win10 in terms of running speed. The main difference is Look at the configuration of your own computer ~ win10 Home Edition: 1. Win10 Home Edition is equivalent to the core version of win8.1, an entry-level system version. 2. The country-specific version of win10 home version is equivalent to the OEM Chinese version of win8.1.

See all articles