脚本任务的 SSIS 2008 错误
这是我在脚本任务中编写的代码,但出现错误,名称“DTS”未声明
1)知道如何解决吗?
2)另一个问题是,而不是 "MsgBox("文件找到)") ",我想发送一封电子邮件作为错误,我应该写什么?
多谢
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Public Class ScriptMain
Public Sub Main()
If Directory.GetFiles("C:\456").Length = 0 Then
MsgBox(" files found)")
Else
MsgBox("not found)")
End If
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Here is the code I write in my script task but I get the error , Name 'DTS' is not declared
1)Any idea, how to resolve it?
2)Another question, would be , instead of having
"MsgBox(" files found)") " , I would like to send an email as an error , what should I write?
Thanks a lot
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Public Class ScriptMain
Public Sub Main()
If Directory.GetFiles("C:\456").Length = 0 Then
MsgBox(" files found)")
Else
MsgBox("not found)")
End If
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1)尝试简单地返回0(它代表成功)
2)将MsgBox(“文件找到”)更改为类似的东西
在这种情况下,不要忘记导入名称空间
我不确定发送是否有效,但你可以尝试它
1) Try to return simply 0 (it stands for Success)
2) Change MsgBox(" files found") to something like that
In this case do not forget to import the namespace
I'm not sure sending will work, but you can try it