473,503 Members | 10,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using dataset writexml to update data and losing formatting

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 xmlns:od="urn:schemas-microsoft-com:officedata"
xmlns:xsi="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
Dec 22 '05 #1
0 1384

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9552
by: Tom Vukovich | last post by:
and returning the xml to the requesting web page, how do you insert the XML declaration? ds.EnforceConstraints = False Response.ContentType = "text/xml" ds.WriteXml(Response.OutputStream,...
1
2606
by: Hari Shankar | last post by:
Dear all I have to develop a database independent application in c# 2003. It means the underlying database should be anything like ACCESS, Oracle or SQL and my application should not get affected...
1
2665
by: pas07920 | last post by:
How can I update a dataset loaded with data from an xml file? The structure of the xml: <Poll> <Choice>First Choice</Choice>
8
1569
by: John | last post by:
Hi I need to be able to call a web service method, receive the dataset that web method returns and store it in an access table. My problem is that I don't know how to "receive" a complex type...
9
1536
by: Kevin Hodgson | last post by:
I'm experiencing a strange Dataset Update problem with my application. I have a dataset which has a table holding a set of customer information records. (address, contact, info, etc.) I have a...
0
1171
by: Randall Arnold | last post by:
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...
4
1665
by: Bill Nguyen | last post by:
I wonder if I can write to an XML file using column structure (and column names) of an SQLserver table. for example: Table A: column1 int column2 char(30) column3 date XML output:
3
4419
by: Eric | last post by:
Help! I created a XML schema with a Visual Studio tools. I'm filling a dataset with a DataAdapter. Before I use the "WriteXml" method to write the data to a xml file, I want to map the XSD file I...
2
3821
by: rrflore2 | last post by:
Ok. I'm writing and deleting to an xml file using a dataset. I have a function in my codebehind page that binds a listbox to the dataset that performs the writes/deletes. Everything seems to be...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.