473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating XML Output from a DS

I am using VB.NET to create an output stream in XML format. When I execute
the code below, the XML header line (<?xml version = "1.0"?>) is not
included in the output file. Is there a way to include that?

================ code =================
Dim myFileStream As New System.IO.FileStream(strFN,
System.IO.FileMode.Create)

' Write to the file with the WriteXml method.

ds1.WriteXml(myFileStream)

=================================================
Nov 12 '05 #1
3 2739
What version of VB.Net are you using? I'm using Visual Studio 2003 and I'm
getting the XML header line.

I'm also specifying the actual file name rather than creating a FileStream.
My code looks more like this:
FileNameStr = "C:\MyXMLFile.xml"
ds1.WriteXML(FileNameStr)

Richard Rosenheim
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I am using VB.NET to create an output stream in XML format. When I execute
the code below, the XML header line (<?xml version = "1.0"?>) is not
included in the output file. Is there a way to include that?

================ code =================
Dim myFileStream As New System.IO.FileStream(strFN,
System.IO.FileMode.Create)

' Write to the file with the WriteXml method.

ds1.WriteXml(myFileStream)

=================================================

Nov 12 '05 #2
Richard;

That was it! When I got rid of the FileStream and used the WriteXML method
directly, the header was included.

Thanks again

Wayne

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
What version of VB.Net are you using? I'm using Visual Studio 2003 and I'm getting the XML header line.

I'm also specifying the actual file name rather than creating a FileStream. My code looks more like this:
FileNameStr = "C:\MyXMLFile.xml"
ds1.WriteXML(FileNameStr)

Richard Rosenheim
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I am using VB.NET to create an output stream in XML format. When I execute the code below, the XML header line (<?xml version = "1.0"?>) is not
included in the output file. Is there a way to include that?

================ code =================
Dim myFileStream As New System.IO.FileStream(strFN,
System.IO.FileMode.Create)

' Write to the file with the WriteXml method.

ds1.WriteXml(myFileStream)

=================================================


Nov 12 '05 #3
Glad to hear that solved your problem.

Of course, it does beg the question of why does using the FileStream results
in different output being generated. Anyone out there that knows the answer
to that one?

Richard Rosenheim
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:u1**************@TK2MSFTNGP15.phx.gbl...
Richard;

That was it! When I got rid of the FileStream and used the WriteXML method
directly, the header was included.

Thanks again

Wayne

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
What version of VB.Net are you using? I'm using Visual Studio 2003 and

I'm
getting the XML header line.

I'm also specifying the actual file name rather than creating a

FileStream.
My code looks more like this:
FileNameStr = "C:\MyXMLFile.xml"
ds1.WriteXML(FileNameStr)

Richard Rosenheim
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
I am using VB.NET to create an output stream in XML format. When I execute the code below, the XML header line (<?xml version = "1.0"?>) is not
included in the output file. Is there a way to include that?

================ code =================
Dim myFileStream As New System.IO.FileStream(strFN,
System.IO.FileMode.Create)

' Write to the file with the WriteXml method.

ds1.WriteXml(myFileStream)

=================================================



Nov 12 '05 #4

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

Similar topics

4
by: Nick | last post by:
Hi, I have a windows application, wherein the solution consists of 5 projects. When I try to create a setup and deployment project for this solution, I'm somehow unable to add anything in...
3
by: serge | last post by:
I have all the scrips to create a database. I have a few questions: 1- I am creating a batch file that it will call many lines like: db2 -td@ -f filename.sql -z output.txt The order i am using...
0
by: James Fortune | last post by:
Here is an example of Access creating a single page PDF file. The text in the textbox is scaled to fit horizontally into a grey box 100 pixels wide that is fontsize pixels high. Clicking the...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
3
by: Progalex | last post by:
Hi everybody! I'm creating a very simple VB .NET application that needs to launch the command line ml.exe compiler. At the moment I'm redirecting ML's output to a text file and then my app...
2
by: pshvarts | last post by:
(I'm new in SOAP) I get some wsdl file (from apache service ). I tried creating SOAP client with .NET - trying to add Web Reference and get error like: "Custom tool error: Unable to import...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
1
by: MichaelZ | last post by:
After all is done, I want query(s) which will give me the ability to create a report which will allow me to compare 3 apts with the parameters equaling bedroom size, and rents which are equal or...
14
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.