![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I'm a SSIS newbie and I'm attempting to set up a simple Script task.In the Edit Script Task, I have the VB code shown below. However, I keep getting this error that states "Name 'Dts' not declared". Any pointers on how I can resolve this would be greatly appreciated. Thanks. Public Sub Main() ' ' Add your code here ' Dim XMLString As String = " " XMLString = Dts.Variables("XMLVariable").Value.ToString.Replac e("<ROOT>", "").Replace("</ROOT>", "") XMLString = "<?xml version=""1.0"" ?>" + XMLString GenerateXmlFile("C:\\MusicCollection.xml", XMLString) End Sub Public Sub GenerateXmlFile(ByVal filePath As String, ByVal fileContents As String) Dim objStreamWriter As IO.StreamWriter Try objStreamWriter = New IO.StreamWriter(filePath) objStreamWriter.Write(fileContents) objStreamWriter.Close() Catch Excep As Exception MsgBox(Excep.Message) End Try Dts.TaskResult = Dts.Results.Success End Sub EggHeadCafe - Software Developer Portal of Choice MDI Inter-Form Communication with Events http://www.eggheadcafe.com/tutorials...ommunicat.aspx . |
![]() |
| Thread Tools | |
| Display Modes | |
| |