Re: XML -best method to read/write in NETcf??
- From: "Ilya Tumanov [MS]" <ilyatum@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 18:08:59 -0700
ds.WriteXml("test.xml") won't write schema, so attempt to read it via
dsXML.ReadXmlSchema(XMLreader) would sure fail.
Use DataSet.WriteXml() overload which takes XmlWriteMode and specify
XmlWriteMode.WriteSchema to ensure schema has been included.
To read it back simply use ds.ReadXml("fileName"), it would recognize and
load schema automatically.
Also, keep in mind there are no relative paths on CF and you have to specify
the exact location for a saved file.
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no rights.
*** Want to find answers instantly? Here's how... ***
1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
"mikeb" <mike@xxxxxxxxxxxxxxxxxx> wrote in message
news:eNdJyjgcFHA.3492@xxxxxxxxxxxxxxxxxxxxxxx
> I'm trying to use XML to send data to / from a scanner (ppc). Our current
> vb netcf app connects directly with the sqlserver - however some scanners
> have no network access and the SQLserver is in another location - the host
> application developers are asking us to give the scanners options to
> import/export data via xml files - the xml files will be sent via archaic
> means. They are letting us spec the xml files.
>
> For XML being THE thing, it sure is proving to be a pain getting this all
> working. Basically, I our netcf app is working under this scenario:
>
> To receive data from sql server into ppc
> (SQLserver data)->SQLStoredProcedure -->PPCdataset->SQLceDB
>
> To send updated data from ppc into sql server
> SQLceDB--> SQLStoredProcedure->(SQLserver data)
>
>
> Similarly I need to remove the stored procedure call and replace it with
> XML import/exports.
>
> Receive data from xml into ppc
> XMLfile -->PPCdataset->SQLceDB
>
> Send updated data from ppc into xml
> SQLceDB--> XMLfile
>
>
> I have been able to do a test by reading the sql server data into a
> dataset via the stored procedure (using a data adapter) - and then writing
> that out to XML [ ds.WriteXml("test.xml") ]
>
> Ok, that gave me a test XML file to play with - but I can't even read that
> XML file in to a dataset now. Trying to use:
> Dim XMLreader as New XmlTextReader(New StreamReader("test.xml")
> dsXML.ReadXmlSchema(XMLreader)
> dsXML.ReadXml(XMLreader)
>
> Are there any sample programs out there that contain a sample XML file
> that gets read into a dataset, and then maybe even exports an xml file
> containing modified data?
>
> I'm trying to do my homework - but dang. It just seems that if XML is
> the thing these days, it would be easier than this. Flat ascii files are
> sure easier and even make more sense to the naked eye. ??
>
> Thanks for any guidance.
>
.
- Follow-Ups:
- Re: XML -best method to read/write in NETcf??
- From: mikeb
- Re: XML -best method to read/write in NETcf??
- References:
- XML -best method to read/write in NETcf??
- From: mikeb
- XML -best method to read/write in NETcf??
- Prev by Date: Re: Any good tutorials on creating the deployment .CAB for VB.NET CF p
- Next by Date: Can buttons not have multiline text?
- Previous by thread: XML -best method to read/write in NETcf??
- Next by thread: Re: XML -best method to read/write in NETcf??
- Index(es):
Relevant Pages
|