Writing XML

R

Roy

Hi All,
I am using a typed dataset to write XML to a document.
I have two issues that need resolving.

1. The command : ds.name = "root" results in
<root xmlns="http://www.tempuri.org/dsAPPAR.xsd">
Is there any way to have it write <root> without the = etc?

2 I am populating the dataset using a datarow. The data is coming from a
text file. I populate a date column as follows: Note: ssb is a string
builder and sline is a string holding the line of text
ssb.append(sline.substring(198,2) & "/"
ssb.append(sline.substring(200,2) & "/"
ssb.append(sline.substring(196,2) & "/"
ssb.tostring would return the following: mm/dd/yyyy
dr.PaidThruDate = ctype(ssb.tostring,date)
In the XML documents the date would appear as:
<PaidThruDate>2000-06-19T00:00:00.0000000-05:00</PidThruDate>
I need it to be 06/19/2000.

I cannot tell you how much I would appreciate an answer to these two issues.

Thanks,
Roy
 
M

Miha Markic

Hi Roy,

Roy said:
Hi All,
I am using a typed dataset to write XML to a document.
I have two issues that need resolving.

1. The command : ds.name = "root" results in
<root xmlns="http://www.tempuri.org/dsAPPAR.xsd">
Is there any way to have it write <root> without the = etc?

Set DataSets.Namspace property to string.Empty ("").
2 I am populating the dataset using a datarow. The data is coming from a
text file. I populate a date column as follows: Note: ssb is a string
builder and sline is a string holding the line of text
ssb.append(sline.substring(198,2) & "/"
ssb.append(sline.substring(200,2) & "/"
ssb.append(sline.substring(196,2) & "/"
ssb.tostring would return the following: mm/dd/yyyy
dr.PaidThruDate = ctype(ssb.tostring,date)
In the XML documents the date would appear as:
<PaidThruDate>2000-06-19T00:00:00.0000000-05:00</PidThruDate>
I need it to be 06/19/2000.

Assuming you are using us culture then you should do:
Declare the column in question of string type (instead datetime) and then
you can put whatever value you want, such as:
ctype(ssb.tostring,date).ToString("d")
I cannot tell you how much I would appreciate an answer to these two
issues.
How much? :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top