need some more help

sidewayz
03-30-2004, 08:00 AM
ok what im trying to do is use a soft code i made to use a template for an xml file that will be taken from the database.. here is the code for the template:

Dim fileName As String = "test.xml"
Dim xWriter As New Xml.XmlTextWriter(fileName, System.Text.Encoding.UTF8)

Dim template As DocTemplate = sessClient.GetTemplate(Me.TemplateDocID)
' xWriter.WriteStartDocument()
xWriter.WriteStartElement(template.TemplateCD)

For Each DocItem As InterfacePackage.InterfacePackageItem In InterfacePackage.InterfacePackageItems

xWriter.WriteStartElement("Item")

For Each column As DocTemplateCol In template.Columns
xWriter.WriteStartElement(column.TemplateColumnCD)

Dim data As Object = DocItem.DataRow_.Data(column.Index)
If Not data Is Nothing Then
xWriter.WriteString(data.ToString)
End If

xWriter.WriteEndElement()
Next

xWriter.WriteEndElement()

Next

xWriter.WriteEndElement()

'xWriter.WriteEndDocument()
xWriter.Close()


and here is what i have so far now:


Dim conn As SqlClient.SqlConnection = getopenconnection
Dim cmdString As String = "SELECT * FROM wpbBearing"

Dim fileName As String = "test.xml"
Dim xWriter As New Xml.XmlTextWriter(fileName, System.Text.Encoding.UTF8)

Dim da As New SqlClient.SqlDataAdapter
Dim ds As New DataSet
da.SelectCommand = New SqlClient.SqlCommand(cmdString, conn)
da.Fill(ds)

ds.WriteXml("\\strfddevapp\Projects\Tim")

Dim interfacePackage As DocManCore.InterfacePackage = DirectCast(ActionParams, DocManCore.InterfacePackage)
For Each DocItem As DocManCore.InterfacePackage.InterfacePackageItem In interfacePackage.InterfacePackageItems

For Each column As DocManCore.DocTemplateCol In docTemplate.Columns
xWriter.WriteStartElement(column.TemplateColumnCD)

Dim data As Object = DocItem.DataRow_.Data(column.Index)
If Not data Is Nothing Then
xWriter.WriteString(data.ToString)
End If

xWriter.WriteEndElement()
Next
xWriter.WriteEndElement()

Next

Machaira
04-01-2004, 07:18 AM
So what's the problem?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum