2009-11-26 154 views
-1

我有一個奇怪的問題。我正在開發一個使用firebird 1.5.6 .NET提供程序和Visual Studio 2005的項目。一切正常。然後我將項目轉換爲VS2008項目。現在我有問題,當我試圖連接到Firebird數據庫,我得到了一個錯誤:將項目從VS2005轉換爲VS2008後的Firebird連接錯誤

Index was out of range. Must be non-negative and less than the size of the collection. 
Parameter name: index. 

錯誤表明即使是當我打開連接。我在server type = Default中得到了這個錯誤,但是如果我設置了server type = Embedded那麼我有可能打開連接。

我試圖在另一臺電腦上運行我的項目,並在那裏工作。

可能是什麼問題?

+0

您是否有此錯誤的堆棧跟蹤? – 2009-11-27 11:05:46

+0

您是否嘗試過最新的2.5.1 .net提供程序? http://www.firebirdsql.org/index.php?op=files&id=netprovider – 2009-11-27 11:18:34

+0

@Douglas Tosi。是的,我正在使用2.5.1 .NET提供程序。 – Jooj 2009-11-29 10:48:04

回答

0

也許這可能會幫助您在這裏閱讀article

希望這會有所幫助。

0

這是我得到的堆棧跟蹤錯誤。

at System.Collections.ArrayList.get_Item(Int32 index) 
    at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.GetServerVersion() 
    at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database) 
    at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect() 
    at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create() 
    at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut() 
    at FirebirdSql.Data.FirebirdClient.FbConnection.Open() 
    at DbAccess.Connect() in D:\Appi\Connection.cs:line 87 

和線路87:

   ... 
       conn.Open(); 
       ... 

我真的不知道該怎麼辦。

+0

奇怪的是,顯然服務器沒有返回服務器版本字符串。這是什麼Firebird版本?你有沒有嘗試更新它? – 2009-11-30 17:43:08

+0

我解決了它。問題是我必須在Windows重啓後重啓FB服務器manualy。不知道爲什麼,但是我解決了這個問題。 – Jooj 2009-11-30 23:29:01

1

我在連接到Interbase時有同樣的錯誤。 我修復它。

  1. 下載源代碼NETProvider-2.6.5-src.7z
  2. 編輯文件GdsDatabase.cs 替換線 return this.GetDatabaseInfo(items, IscCodes.BUFFER_SIZE_256)[0].ToString();

    ArrayList ar = this.GetDatabaseInfo(items, IscCodes.BUFFER_SIZE_256); if (ar.Count > 0) return ar[0].ToString(); else return String.Empty;

  3. 重建項目

完成