G
Guest
Hi
I am using XML to store my datasets.
I am using 2 files: "MyXMlFilename.xml" to store the data values (all the rows) and "MyXMlFilename.xsd" to store the schema. I use DataSet.ReadXml(Full path of MyXMlFilename.xml) to read the data and DataSet.ReadXmlSchema(full path of MyXMlFilename.xsd) to read the schema. The schema definition contains Column1 as primary key. Therefore it is expected that when i add a new row into the dataset (using DataSet.Tables[0].AddRow()) with a same Column1 value, it should throw me some exception, but unluckily it is not. Instead it is adding the row with the same value and hence duplication of Column1 values. Where exactly is going wrong?
The amusing thing is if I have a single file(MyXMLFileName.Xml) which have both Schema as well as data then it certainly give me an exception, but if I have two different files as I explained above, it doesnt throw exception..
Is there any reference site where i can get around this problem, or some samples for ready reference..
Please help..
thanks a lot
Amit.
I am using XML to store my datasets.
I am using 2 files: "MyXMlFilename.xml" to store the data values (all the rows) and "MyXMlFilename.xsd" to store the schema. I use DataSet.ReadXml(Full path of MyXMlFilename.xml) to read the data and DataSet.ReadXmlSchema(full path of MyXMlFilename.xsd) to read the schema. The schema definition contains Column1 as primary key. Therefore it is expected that when i add a new row into the dataset (using DataSet.Tables[0].AddRow()) with a same Column1 value, it should throw me some exception, but unluckily it is not. Instead it is adding the row with the same value and hence duplication of Column1 values. Where exactly is going wrong?
The amusing thing is if I have a single file(MyXMLFileName.Xml) which have both Schema as well as data then it certainly give me an exception, but if I have two different files as I explained above, it doesnt throw exception..
Is there any reference site where i can get around this problem, or some samples for ready reference..
Please help..
thanks a lot
Amit.