[Mono-list] Compilation Errors on DataSet Classes Generated by XSD.exe

Alan Tam Tam@SiuLung.com
Wed, 5 Feb 2003 00:20:08 +0800


I've tried to generate a class from XSD.exe by Microsoft and compile it in
Mono. There are many compilation errors and I have to at least patch it like
this in order to make it work.

21c21
< [System.ComponentModel.DesignerCategoryAttribute("code")]
---
> //[System.ComponentModel.DesignerCategoryAttribute("code")]
32c32
<         this.Relations.CollectionChanged += schemaChangedHandler;
---
>         //this.Relations.CollectionChanged += schemaChangedHandler;
46c46
<             this.Locale = ds.Locale;
---
>             //this.Locale = ds.Locale;
49c49
<             this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
---
>             //this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
55c55
<         this.GetSerializationData(info, context);
---
>         //this.GetSerializationData(info, context);
75c75
<     protected override bool ShouldSerializeTables() {
---
>     protected bool ShouldSerializeTables() {
79c79
<     protected override bool ShouldSerializeRelations() {
---
>     protected bool ShouldSerializeRelations() {
83c83
<     protected override void ReadXmlSerializable(XmlReader reader) {
---
>     protected void ReadXmlSerializable(XmlReader reader) {
96c96
<         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
---
>         //this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
100c100
<     protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
---
>     protected System.Xml.Schema.XmlSchema GetSchemaSerializable() {
118c118
<         this.Locale = new System.Globalization.CultureInfo("en-US");
---
>         //this.Locale = new System.Globalization.CultureInfo("en-US");
284c284
<         protected override DataTable CreateInstance() {
---
>         protected DataTable CreateInstance() {
329c329
<         protected override System.Type GetRowType() {
---
>         protected System.Type GetRowType() {

Can we at least add back the function prototypes so that the file can be
compiled and run with fewer efforts? The missing prototypes are:

System.ComponentModel.DesignerCategoryAttribute
System.Data.DataSet.Merge
System.Data.DataSet.GetSerializationData
System.Data.DataSet.ShouldSerializeTables
System.Data.DataSet.ShouldSerializeRelations
System.Data.DataSet.ReadXmlSerializable
System.Data.DataSet.GetSchemaSerializable
System.Data.DataSet.CreateInstance
System.Data.DataSet.GetRowType

For the NotImplementedException problem of Locale and Relations, are there any
solution?

Regards,
Alan