Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > using dataset writexml to update data and losing formatting

Reply
Thread Tools

using dataset writexml to update data and losing formatting

 
 
Randall Arnold
Guest
Posts: n/a
 
      12-22-2005
I have a Microsoft Access report (built on a SQL Server 2000 query) I have
exported as xml/html. I include a stylesheet in the original export for
formatting of the report. The schema is separate. When I preview this in
my Visual web developer Express project it looks almost perfect (VBA
generated color formatting is missing, but that's no show-stopper). So it
works up to here.

For unknown reasons I cannot use the Live Data option in the Access xml
export (error says database object cannot be found when page is loaded) so I
have created an asp.net page in VWD that uses a dataset object to generate
new xml from my query on Page load. This also works. HOWEVER-- the new xml
is missing crucial stylesheet references and so all I get is a clump of data
when the html page loads.

I am including code and xml header info as follows:

Private Sub UpdateFileXML()
Dim sXMLFile As String
Dim sADPFile As String
Dim sConn As String
Dim strSQL As String
sXMLFile = MapPath("./ASOQAMetricMatrixPerformance_Report.xml")
sADPFile =
\\Alfil002\projects\QUALITY\Metrics/Databases\alsql003_vbsap_dev.adp
sConn = "Provider=SQLOLEDB;Data Source=alsql003;Initial
Catalog=VBsap;Persist Security Info=True;User ID=Dev;Password=qq"
strSQL = "Select * From ASOQAMetricMatrixPerformance_View"
Dim cnn As Data.OleDb.OleDbConnection
Dim cmd As Data.OleDb.OleDbCommand
Dim objDA As Data.OleDb.OleDbDataAdapter
Dim objDS As Data.DataSet
cnn = New Data.OleDb.OleDbConnection(sConn)
cmd = New Data.OleDb.OleDbCommand(strSQL, cnn)
cnn.Open()
' Populate our DataSet object
objDA = New Data.OleDb.OleDbDataAdapter(cmd)
objDS = New Data.DataSet("dataroot")
objDA.Fill(objDS)
' Rename table to match our XSL file
objDS.Tables(0).TableName = "ASOQAMetricMatrixPerformance_View"
' Output data as XML to our file
objDS.WriteXml(sXMLFile)
End Sub
---------------------------------
Here is the original xml header info as provided by Microsoft Access:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ASOQAMetricMatrixPe rformance_Report.xsd"
generated="2005-12-22T11:11:18">
-------------------------------------
Here is the xml header as it appears after using the dataset to update the
data:

<?xml version="1.0" standalone="yes"?>
<dataroot>
----------------------------------------------

Note the missing schema info in the updated version. If I manually restore
the missing values, the page renders properly.

My question is: how can I programmatically restore the missing values in
asp.net using vb code?

Thanks to anyone able and willing to help,

Randall Arnold


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Dataset.WriteXML Morten Snedker ASP .Net 2 08-14-2007 09:40 AM
DataSet.WriteXML Vs. SQL Server 2000 XML performance issue??? Aryan ASP .Net 0 07-28-2006 05:27 AM
WriteXml grouping data Stephen Witter ASP .Net 2 10-28-2004 02:15 AM
writeXML from session Dataset Michael Persaud ASP .Net Web Controls 0 08-12-2004 08:49 PM
dataset.writexml and loading from file Martin ASP .Net 2 05-25-2004 10:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57