Well, may be that also. But also the name of the root element and the name
of the child element is same that was causing problem. I changes the name of
the root element from <score> to <scores> and it worked. May be .Net 2.0 is
strict about the names of root element and child elements
"Zafar Abbas" <so*****@somewhere.com> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl...
Nikhilesh,
This is an issue in .NET framework 2.0 which might be fixed in a service
pack. As a work around for .NET 2.0, could you rename your attribute
score,
so that its name is different than the element itself.
Thanks,
Zafar
"Nikhilesh Mehendale" <ni********@maqsoftware.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl... Here is the file
"Zafar Abbas" <so*****@somewhere.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... > Nikhilesh ,
> I am realy sorry, I need you to send me the XML file again. I am unable to > locate it in the archive.
>
> Thanks,
> Zafar
>
>
> "Nikhilesh Mehendale" <ni********@maqsoftware.com> wrote in message
> news:O0**************@TK2MSFTNGP14.phx.gbl...
>> DataSet dataSet = new DataSet();
>> string xmlFile = "C:\Data.xml";
>>
>> //Check if the file exists
>> if (File.Exists(xmlFile))
>> {
>> dataSet.ReadXmlSchema(xmlFile);
>> }
>> else //return null if file does not exist
>> {
>> return null;
>> }
>>
>> //Convert the scores column to integer
>> dataSet.Tables[0].Columns["score"].DataType = typeof(int);
>>
>> try
>> {
>> dataSet.ReadXml(xmlFile);
>> }
>> catch(Exception ea)
>> {
>> MessageBox.Show(ea.Message);
>> }
>>
>> This is the part of code wich works in .Net Framework 1.1 and not in 2.0. >> The try block throws exception at the statement dataSet.ReadXml(xmlFile) >>
>>
>
>