我有一个奇怪的问题。我正在使用firebird 1.5.6 .NET提供程序和Visual Studio 2005进行一个项目。一切正常。然后我将项目转换为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 :(得分:1)
我在连接到Interbase时遇到同样的错误。 我解决了。
编辑文件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;
重建项目
完成
答案 1 :(得分:0)
也许这可以帮助你阅读这里的article?
希望这有帮助。