Thanks for the correction. I meant ReadXml().
Yes perhaps your explanation is right.
thnx
"Martin Honnen" wrote:
[color=blue]
>
>
> binvij wrote:
>
>[color=green]
> > An xml file can be loaded into a dataset in the following ways:
> >
> > XmlTextReader reader = new XmlTextReader("inrss.xml");
> > DataSet ds = new DataSet();
> > ds.Load(reader);[/color]
>
> I don't think there is a method named Load, the methods are documented here:
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataDataSetMembersTopic.asp>
> Perhaps you are asking about the method named ReadXml?
>[color=green]
> > OR
> >
> > string fileName = "inrss.xml";
> > DataSet ds = new DataSet();
> > ds.Load(fileName);
> >
> > Which one is better? I have seen few authors preferring the first way. Is
> > there anything special to it.[/color]
>
> Not really, if you want to load from a local file then you can use the
> method overload which takes a string with the file name. But if you
> wanted to load from a URL for instance then you might need an overload
> that allows that, using an XmlTextReader is one way to achieve that.
>
> --
>
> Martin Honnen --- MVP XML
>
http://JavaScript.FAQTs.com/
>[/color]