Firebird ADO NET数据提供商“无法完成对主机的网络请求”

时间:2014-12-04 04:55:10

标签: c# firebird

启动PC后的前10或15分钟,我的应用程序通过网络连接到Firebird数据库没有问题。但是在“异常”中显示“Unable to complete network request to host app1"错误”之后。我试图重新安装我的操作系统,但问题又出现了。

你可以给我建议吗?

我正在使用visual studio 2013 with Firebird ADO .NET provider。 (也按照推荐安装了DDEX)我的连接字符串很简单:

`character set=UTF8;data source=app1;Port=3050;user id=SYSDBA;password=masterkey;Database=skud_db` 

我也检查过:

  1. dns,它可以毫无问题地解析app1
  2. 服务器和我的电脑上的防火墙规则
  3. 3050端口已打开
  4. 当发生此问题时,我尝试使用相同的连接参数连接FlameRobin。它连接没有任何问题。
  5. 此外,10或15分钟后,我的应用程序恢复正常工作。可能是会议中的问题。但是我总是在sql查询后在我的应用程序中使用“connection.close”。我尝试使用不同的身份验证凭据进行连接,但它无法解决我的问题。

    仍然无法理解我的问题在哪里。

    这是我的功能部分:

    string ConnectionString = "character set=UTF8;data source=app1;Port=3050;user id=SYSDBA;password=masterkey;Database=skud_db";
    FbConnection tempConnection = new FbConnection(ConnectionString);
    tempConnection.Open();
    DataSet DS = new DataSet("SUBDIV_REF");
    string SQLCommandText = "SELECT * FROM SUBDIV_REF WHERE VISIBLE=1";
    FbDataAdapter DAREGEVENTS = new FbDataAdapter(SQLCommandText, tempConnection);
    FbCommand CMDREGEVENTS = new FbCommand(SQLCommandText);
    DAREGEVENTS.Fill(DS, "SUBDIV_REF");
    DataTable DT_REG_EV = DS.Tables["SUBDIV_REF"];
    Department.DataSource = DS.Tables["SUBDIV_REF"];
    Department.DisplayMember = "DISPLAY_NAME";
    
    tempConnection.Close();
    

    堆栈跟踪:

    в FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
       в FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.CreateNewConnection(FbConnectionString connectionString, FbConnection owner)
       в FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.CreateNewConnectionIfPossibleImpl(FbConnectionString connectionString, FbConnection owner)
       в FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Pool.GetConnection(FbConnection owner)
       в FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Get(FbConnectionString connectionString, FbConnection owner)
       в FirebirdSql.Data.FirebirdClient.FbConnection.Open()
       в Skud2015.Form1.button1_Click(Object sender, EventArgs e) в c:\Users\baynazarov_as\Documents\Visual Studio 2013\Projects\Skud2015\Skud2015\Form1.cs:строка 110
       в System.Windows.Forms.Control.OnClick(EventArgs e)
       в System.Windows.Forms.Button.OnClick(EventArgs e)
       в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       в System.Windows.Forms.Control.WndProc(Message& m)
       в System.Windows.Forms.ButtonBase.WndProc(Message& m)
       в System.Windows.Forms.Button.WndProc(Message& m)
       в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       в System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       в System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       в System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       в System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       в System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       в System.Windows.Forms.Application.Run(Form mainForm)
       в Skud2015.Program.Main() в c:\Users\baynazarov_as\Documents\Visual Studio 2013\Projects\Skud2015\Skud2015\Program.cs:строка 19
       в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       в System.Threading.ThreadHelper.ThreadStart()
    

    还有InnerException / StackTrace:

    в FirebirdSql.Data.Client.Managed.Version10.GdsConnection.Connect()
       в FirebirdSql.Data.FirebirdClient.ClientFactory.CreateManagedDatabase(FbConnectionString options)
       в FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase(FbConnectionString options)
       в FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
    

0 个答案:

没有答案