Ahmad
Ahmad

Reputation: 24827

When using xsd.exe, which File option should I choose and why?

I have received a xsd file from a third party vendor for some XML files we currently receive. In order to process the files, I have used xsd.exe to generate my classes. I see that there are two command line options available, namely:

My question is noobish at best, which option should I choose and why?

PS: I have tried both, however, at present, the /d option results in some error regarding nested tables. The /c option does work for me although it requires a lot of data-mapping to my domain objects.

Upvotes: 1

Views: 174

Answers (3)

John Saunders
John Saunders

Reputation: 161773

Use /c. A DataSet is an in-memory representation of a relational database. Not all XML Schema files map to a relational database model. The error message you received was no doubt because your schemas cannot map to the relational model.

/c will produce classes that can be loaded from or saved to an XML file by using the XmlSerializer.

Upvotes: 1

Bruno Costa
Bruno Costa

Reputation: 2720

I think /d will give you a dataset to work with the data of the XML. The /c will generate the classes you need to work with the data.

Now, that's your choice, you'll need data-mapping to your domain objects for both options, imho.

Upvotes: 0

Paul Carroll
Paul Carroll

Reputation: 1887

I'd advise choosing the 'c' option as datasets are evil. Pure evil.

Upvotes: 1

Related Questions