Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I want to load xml file to database using script task.I got bellow code which is for script component.Can do the same thing using script task? And I want to load multiple files dynamically.In bellow code it is loading particular file.

VB
Public Overrides Sub PreExecute()

        MyBase.PreExecute()

        'Provide the path to read the XML file and load the xml document


        xDoc.Load("file path")
    End Sub

    Public Overrides Sub CreateNewOutputRows()

        For Each xNode As XmlNode In xDoc.SelectNodes("//InvoiceDetails")


            Me.Output0Buffer.AddRow()

            Me.Output0Buffer.ID = xNode.ChildNodes(0).InnerText
            Me.Output0Buffer.Qty = xNode.ChildNodes(1).InnerText
            Me.Output0Buffer.Price = xNode.ChildNodes(2).InnerText
            Me.Output0Buffer.customer = xNode.ChildNodes(3).InnerText
            Me.Output0Buffer.DateReceived = xNode.ChildNodes(4).InnerText
            Me.Output0Buffer.Tax = xNode.ChildNodes(5).InnerText
            Me.Output0Buffer.Charges = xNode.ChildNodes(6).InnerText
            Me.Output0Buffer.Measure = xNode.ChildNodes(7).InnerText
            Me.Output0Buffer.Comments = xNode.ChildNodes(8).InnerText
            Me.Output0Buffer.Desc = xNode.ChildNodes(9).InnerText


   End Sub

    Public Overrides Sub PostExecute()
        MyBase.PostExecute()

    End Sub
End Class


Can anybody help me.
Thanks
Posted

1 solution

 
Share this answer
 
Comments
xyz from Bangalore 10-Jul-13 2:26am    
Hi Syed,
I want load xml files. Link is about excel files

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900