Re: DataSet Cloning Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: dotNetDave (dotNetDave_at_discussions.microsoft.com)
Date: 01/11/05


Date: Tue, 11 Jan 2005 08:45:05 -0800

Yes, you are right, that works, but for some reason cloning won't work for
the DataSet that I create with the xml below using DataSet.ReadXml:

<Media xmlns="http://mycompany.com/MediaConfig">
        <Type>Encode</Type>
        <Standard>NTSC</Standard>
        <Peripheral>
                <ID>1</ID>
                <NumWindows>1</NumWindows>
                <Video>
                        <Name>Camera #1</Name>
                        <Source>0</Source>
                        <FrameRate>30</FrameRate>
                        <BitRate>3000000</BitRate>
                        <Resolution>4CIF</Resolution>
                        <McastIP>239.128.0.153</McastIP>
                        <Port>4000</Port>
                </Video>
                <Audio>
                        <Source>LEFT</Source>
                        <SampleRate>16000</SampleRate>
                        <McastIP>235.0.0.52</McastIP>
                        <Port>4001</Port>
                </Audio>
        </Peripheral>
</Media>

If you have any suggestions, please let me know.

David

"Cor Ligthert" wrote:

> David,
>
> I tried this code.
> \\\
> DataSet ds = new DataSet("Media");
> DataTable dt = new DataTable("Media");
> dt.Columns.Add("Media");
> dt.Rows.Add(dt.NewRow());
> dt.Rows[0][0] = "Media";
> ds.Tables.Add(dt);
> ds.WriteXml("C:\\Test1\\Media.XML",XmlWriteMode.WriteSchema);
> ///
>
> It gave this dataset,
>
> <?xml version="1.0" standalone="yes"?>
> <Media>
> <xs:schema id="Media" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
> <xs:element name="Media" msdata:IsDataSet="true" msdata:Locale="nl-NL">
> <xs:complexType>
> <xs:choice maxOccurs="unbounded">
> <xs:element name="Media">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Media" type="xs:string" minOccurs="0" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> <Media>
> <Media>Media</Media>
> </Media>
> </Media>
>
> Therefore can you explain it a little bit more?
>
> Cor
>
>
>



Relevant Pages

  • Re: Deserializing XML into an object
    ... performance is of utmost importance. ... Keeping in view, the XML I'm dealing with is very elementary, having ... "Cor Ligthert" wrote: ...
    (microsoft.public.dotnet.general)
  • Re: Original Rows
    ... It does - the XML in the table proves it. ... OHM (Terry Burns) ... Time flies when you don't know what you're doing "Cor Ligthert" wrote in message ... > You persist in my opinion with the fact that an original row needs also to> have the original values and did not give any reason why? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: probably a simple question (I hope)
    ... when I use the dataset.WriteXML the XML produced does not ... nest the data. ... "Cor Ligthert" wrote: ... > (the keyword is nested) ...
    (microsoft.public.dotnet.general)
  • Re: XML Visual Basic Questions
    ... programming model is to be taken in this context, ... handle all XML files on earth using this programming model... ... "Cor Ligthert" a écrit dans le message de ... every dataset can be a XML file, ...
    (microsoft.public.dotnet.general)