K
keikoo
Hi, I,m trying to fill a DataSet with a xml file, so I pretend to use
the ReadXml method.
The .xsd file is defined, and the fields of the xml file have the same
name and type than the DataTable inside the DataSet.
the method is invoked in than way:
System.Xml.XmlNodeReader _xmlreader=new
System.Xml.XnodeReader(XmlDocument);
_dataset.ReadXml(_xmlreader, System.Data.XmlReadMode.ReadSchema);
_xmreader.Close();
The code is executed without exceptions, but the datatable remains the
same, no rows were added. If I change the reading options to
InferSchema, an exception is thrown because it tries to create new
columns with the same name as existing ones, so I think, the schema is
well created with the correct fields, the same as the xml file.
If I change the reading option to IgnoreSchema I have the same result
than with InferSchema.
Anyone knows what I'm doing wrong?. I've got no much idea about xml
schemas.
Thanks in advance.
the ReadXml method.
The .xsd file is defined, and the fields of the xml file have the same
name and type than the DataTable inside the DataSet.
the method is invoked in than way:
System.Xml.XmlNodeReader _xmlreader=new
System.Xml.XnodeReader(XmlDocument);
_dataset.ReadXml(_xmlreader, System.Data.XmlReadMode.ReadSchema);
_xmreader.Close();
The code is executed without exceptions, but the datatable remains the
same, no rows were added. If I change the reading options to
InferSchema, an exception is thrown because it tries to create new
columns with the same name as existing ones, so I think, the schema is
well created with the correct fields, the same as the xml file.
If I change the reading option to IgnoreSchema I have the same result
than with InferSchema.
Anyone knows what I'm doing wrong?. I've got no much idea about xml
schemas.
Thanks in advance.