简体   繁体   English

如何通过C#中的代码更改SSIS包中的平面文件源文件?

[英]How to change file of Flat File Source in a SSIS Package by code in C#?

I can't seem to figure out how to do this. 我似乎无法弄清楚如何做到这一点。 I can't find something recently made that helps me do this. 我找不到最近制作的东西可以帮助我做到这一点。 I know its not a good question but maybe a short answer in the right direction? 我知道这不是一个好问题,但可能是正确方向的简短回答? What to look at to accomplish this? 怎么看才能实现这个目标?

Take a look at this link which should help you get your project off the ground too. 看看这个链接,它可以帮助您实现项目。

MSDN LInk MSDN LInk

this link also provides a step by step solution 此链接还提供了一步一步的解决方案

Step by Step Guide 分步指南

hopefully this will be enough to get you started 希望这足以让你开始

You need to look at configurations. 您需要查看配置。 Basically, what you do is set the connection string for the file connection to a variable. 基本上,您要做的是将文件连接的连接字符串设置为变量。 Then you use the configuration to determine the file location at runtime. 然后使用配置在运行时确定文件位置。 The C# code could update the configuration with the new value just before running the SSIS package. 在运行SSIS包之前,C#代码可以使用新值更新配置。 There are multiple ways to do configuration and they cary by version of SSIS that you are using, so I can't go further into how to set up the configuration, you need to read through the manual for that. 有多种方法可以进行配置,并且它们对您正在使用的SSIS版本感到烦恼,因此我无法进一步了解如何设置配置,您需要仔细阅读本手册。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM