开发者

VB.NET: How to programatically create a text file in SSIS!

I would like to create a text 开发者_运维知识库file with some data i am manipulating in a script component and write it to a text file. i know how to write it to an existing text file, but what i would like to do is create the text file programmatically so i can name it textfile(TodaysDate).txt

How can i do this??


You can call File.CreateText(someString).

This method returns a StreamWriter which can be used to write to the file.
Remember to close the StreamWriter usinga using statement.


If you start with a sample of the text file that you want stored somewhere, you can use a file system task to copy the sample file to the correct name (make sure you copy so that it's still there for tomorrow). Then use an expression to set the file location in the file connection manager.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜