錯誤 ?命名空間“System.Data”中不存在類型或命名空間名稱“TypedTableBase”(是缺少程序集引用嗎?)
解決:
該錯誤出現在自動生成的XXX.Designer.cs里。
.NET 3.5 :
public partial class T_OPERATOR_WLDataTable : global::System.Data.TypedTableBase<T_OPERATOR_WLRow>
要改成
.NET 2.0:
public partial class T_OPERATOR_WLDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable
然后編譯會出現另一個錯誤
錯誤 1 “DataTable”不實現接口成員“System.Collections.IEnumerable.GetEnumerator()”
繼承接口加上下面這段就可以了
public System.Collections.IEnumerator GetEnumerator() {return GetEnumerator(); }
重新編譯后會自動進化成這樣
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public virtual global::System.Collections.IEnumerator GetEnumerator() {return this.Rows.GetEnumerator(); }
?