2016-04-01 55 views
0

我的任務是將Visual Studio 2005項目更新爲Visual Studio 2005.原始項目使用了一個名爲Subsonic版本2.2和多個Telerik控件的產品。我已經能夠解決Telerik DLL的問題,但一直無法找出這個錯誤,似乎是由Subsonic生成的代碼的問題。更新VS項目後,爲什麼會出現此錯誤

下面的代碼導致此錯誤「‘PSD.Tbl_Division’的分部聲明一定不能指定不同的基地」

using System; 
using System.Text; 
using System.Data; 
/// <summary> 
/// Strongly-typed collection for the Tbl_Division class. 
/// </summary> 
[Serializable] 
public partial class Tbl_DivisionCollection : ActiveList<Tbl_Division, Tbl_DivisionCollection> 
{  
    public Tbl_DivisionCollection() {} 

    /// <summary> 
    /// Filters an existing collection based on the set criteria. This is an in-memory filter 
    /// Thanks to developingchris for this! 
    /// </summary> 
    /// <returns>Tbl_DivisionCollection</returns> 
    public Tbl_DivisionCollection Filter() 
    { 
     for (int i = this.Count - 1; i > -1; i--) 
     { 
      Tbl_Division o = this[i]; 
      foreach (SubSonic.Where w in this.wheres) 
      { 
       bool remove = false; 
       System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName); 
       if (pi.CanRead) 
       { 
        object val = pi.GetValue(o, null); 
        switch (w.Comparison) 
        { 
         case SubSonic.Comparison.Equals: 
          if (!val.Equals(w.ParameterValue)) 
          { 
           remove = true; 
          } 
          break; 
        } 
       } 
       if (remove) 
       { 
        this.Remove(o); 
        break; 
       } 
      } 
     } 
     return this; 
    } 


} 
/// <summary> 
/// This is an ActiveRecord class which wraps the Tbl_Division table. 
/// </summary> 
[Serializable] 
public partial class Tbl_Division : ActiveRecord<Tbl_Division>, IActiveRecord 
{ 

我是一個初級程序員,並已花了很多時間閱讀此職位錯誤信息,我無法讓自己的想法纏繞在我正在閱讀的內容上,並將其與我的情況聯繫起來。

任何人都可以提供一個解釋,爲什麼我會得到這個錯誤,如果可能的話爲什麼會在Visual Studio 2005中的工作,但沒有的Visual Studio 2013年加我怎樣才能改變這種狀況

感謝 佩裏

回答

0

看起來Tbl_Division類是在兩個部分類中聲明的。這裏顯示的一個子類ActiveRecord ...

......這似乎有點奇怪,但它是可行的,我猜。另一個部分類必須在其基類方面說一些不同的東西。所以,根據給出的錯誤,這可能是你的問題。沒有看到你的其他部分類定義,那麼就不可能肯定地說。

+0

對不起,只是想澄清你是說我應該顯示所有的代碼 – Perry

+0

如果有可能看到Tbl_Division的每個部分類定義的初始行,而不僅僅是上面顯示的那個。或者你可以自己檢查一下,看看基類定義是否有區別。我在回答中添加了一個。看到另一個是有用的。 – ManoDestra

+0

e是其他類公共部分類Tbl_DivisionCollection的代碼的第一行:ActiveList Perry

相關問題