Firebrd数据库错误(在我的系统4.0框架中工作) [英] Firebrd Database Error (in my system 4.0 frame work)

查看:45
本文介绍了Firebrd数据库错误(在我的系统4.0框架中工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

源错误:

当前Web请求的执行期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息.



使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用System.Web;
使用System.Web.UI;
使用System.Web.UI.WebControls;
使用System.Data;
使用System.Data.SqlClient;
使用FirebirdSql.Data.FirebirdClient;



公共局部类数据:System.Web.UI.Page
{
受保护的void Page_Load(对象发送者,EventArgs e)
{

}
受保护的无效btnRetrive_Click(对象发送者,EventArgs e)
{
字符串ConnectionString =用户ID = SYSDBA;密码=万能钥匙;" +数据库= localhost:C:\\ Program Files \\参加HRM \\ Data \\ ITAS.FDB;" +"DataSource = localhost; Charset = NONE;";
FbConnection addDetailsConnection =新的FbConnection(ConnectionString);
addDetailsConnection.Open();


FbDataAdapter da;
DataSet ds = new DataSet();
字符串SQLCommandText =从ATT_LVE中选择*";
FbCommand addEmpinfoCommand =新的FbCommand(SQLCommandText,addDetailsConnection);
da =新的FbDataAdapter();
da =新的FbDataAdapter(addEmpinfoCommand);
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();


}
}


如何解决系统中的此错误.

错误消息:

无法加载文件或程序集"firebirdsql.data.firebirdclient"或其依赖项之一.该程序集是由比当前加载的运行时新的运行时构建的,因此无法加载.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using FirebirdSql.Data.FirebirdClient;



public partial class Data : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnRetrive_Click(object sender, EventArgs e)
{
string ConnectionString = "User ID=SYSDBA;Password=masterkey;" + "Database=localhost:C:\\Program Files\\Attend HRM\\Data\\ITAS.FDB; " + "DataSource=localhost;Charset=NONE;";
FbConnection addDetailsConnection = new FbConnection(ConnectionString);
addDetailsConnection.Open();


FbDataAdapter da;
DataSet ds = new DataSet();
string SQLCommandText = " Select * from ATT_LVE";
FbCommand addEmpinfoCommand = new FbCommand(SQLCommandText, addDetailsConnection);
da = new FbDataAdapter();
da = new FbDataAdapter(addEmpinfoCommand);
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();


}
}


how to resolve this error in my system.

Error Message:

Could not load file or assembly ''firebirdsql.data.firebirdclient'' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

推荐答案

这通常意味着您在的更高版本中编译了一个库. NET Framework,而您试图在针对.NET Framework较低版本的项目中使用它.例如,Firebird客户端是针对.NET 4.0编译的,您不能在.NET 2.0、3.0或3.5项目中使用它.

或者,Firebird客户端库有多个版本,并且您设置了对错误版本的引用.
This usually means that you compiled a library in a higher version of the .NET Framework and you''re trying to use it in a project that is targeting a lower version of the .NET Framework. For example, the Firebird client was compiled targeting .NET 4.0, you cannot use it in a .NET 2.0, 3.0 or 3.5 project.

Or, there are multiple versions of the Firebird client library and you set a reference to the wrong version.


这篇关于Firebrd数据库错误(在我的系统4.0框架中工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆