More XML

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

Miha,

First, thanks for your help. Without it, I would still be running in
circles.

I created the date datatypes as varchar(10) in the dataset. Of course in the
table they are datetime.

The problem I am having is I cannot get the dates to insert. All it does is
put in null values.

The XML document looks fine. Below is a date row that inserts as a null
instead of a date.

<LastPaidDate>06/19/2000</LastPaidDate>



How much is this appreciated???? Well, if I ever get married again, you can
dance at my wedding. How is that? J



Thanks so much,

Roy
 
Hi Roy,

Roy said:
Miha,

First, thanks for your help. Without it, I would still be running in
circles.
:)

I created the date datatypes as varchar(10) in the dataset. Of course in the
table they are datetime.

The problem I am having is I cannot get the dates to insert. All it does is
put in null values.

Back to database I suppose.
The XML document looks fine. Below is a date row that inserts as a null
instead of a date.

<LastPaidDate>06/19/2000</LastPaidDate>

Ok, here is the modified version.
Put it back to datetime for IO with database.
When you need export to xml do the following:
Use DataSet.Copy to produce the exact copy of dataset which we'll use for
exporting.
Do a foreach through rows (on copied dataset) and set all values for
LastPaidDate column to null (make sure that it is null alowed -
column.AllowDBNull should be true).
Change the DataType of LastPaidDate column to typeof(string).
Do a foreach row in original and copy the datetime's formated as string to
copied dataset.
Here you go: you have properly formated dataset to export.
This should work.
How much is this appreciated???? Well, if I ever get married again, you can
dance at my wedding. How is that? J

Now, I am divided - on the one hand I wish that your marriage last but on
the other ;-)
 
Back
Top