使用sqlserver.management.smo并与运行vpn programm发生冲突

问题描述:

下面你看到我的程序的一部分,以获取我的网络中的sql服务器。

below you see part of my program to get the sql servers in my network.

正常它工作正常,我得到了服务器。但是当我运行vpn programm

normaly it works correct and i get the servers. but when i am running the vpn programm

同时检查点scu remote时,我没有得到服务器列表。

check point scu remote at the same time, i get no list of servers.

需要帮助才能看到冲突。

need help to see the conflict.

________________________________________________________

________________________________________________________

privatevoidbtnSQLServerAuswählen_Click(object sender,EventArgs e)

         {

            cmbSQLServer.Items.Clear();

            cmbSQLServer.ForeColor = Color.Red;

            cmbSQLServer.Text =" Suche SQL Server ... bitte warten";

            bgwSQLOptionen.WorkerSupportsCancellation = true;

            // Hintergrundprozess zum einlesenderStücklisteninformationenineine Datatable starten

            bgwSQLOptionen.RunWorkerAsync();

        }


        private void bgwSQLOptionen_DoWork(object sender,DoWorkEventArgs e)

        {

            _sqltable = SmoApplication.EnumAvailableSqlServers();


        }


        private void bgwSQLOptionen_RunWorkerCompleted(object sender,RunWorkerCompletedEventArgs e)

        {

            foreach(_sqltable.Rows中的DataRow行)

            {

                cmbSQLServer.Items.Add(row [0] .ToString());

            }
            cmbSQLServer.ForeColor = Color.RoyalBlue;

            cmbSQLServer.Text ="BittegewänschtenServerususwählen...&quot ;;

            btnDBAuswählen.Enabled= true;

            cmbDBAuswählen.Enabled= true;

        }

private void btnSQLServerAuswählen_Click(object sender, EventArgs e)
        {
            cmbSQLServer.Items.Clear();
            cmbSQLServer.ForeColor = Color.Red;
            cmbSQLServer.Text = "Suche SQL Server... bitte warten";
            bgwSQLOptionen.WorkerSupportsCancellation = true;
            // Hintergrundprozess zum einlesen der Stücklisteninformationen in eine Datatable starten
            bgwSQLOptionen.RunWorkerAsync();
        }

        private void bgwSQLOptionen_DoWork(object sender, DoWorkEventArgs e)
        {
            _sqltable = SmoApplication.EnumAvailableSqlServers();
        }

        private void bgwSQLOptionen_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            foreach (DataRow row in _sqltable.Rows)
            {
                cmbSQLServer.Items.Add(row[0].ToString());
            }
            cmbSQLServer.ForeColor = Color.RoyalBlue;
            cmbSQLServer.Text = "Bitte gewünschten Server auswählen...";
            btnDBAuswählen.Enabled = true;
            cmbDBAuswählen.Enabled = true;
        }

________________________________________________

________________________________________________

最好的问候

Harald

如果唯一的区别是VPN或没有VPN,那么这听起来像是一个权限问题这将是环境而不是代码问题。另一个想法是  VPN使用的端口与无VPN。

If the only difference is VPN or no VPN then this sounds like a permission issue which would be environmental rather than a code issue. Another thought is  the port used by the VPN vs no VPN.

编辑,来自EnumAvailabeServers

Edit, from EnumAvailabeServers

此方法无法列出本地如果防火墙正在服务器上运行,则为instance。即使发件人来自本地计算机,防火墙也会阻止调用该方法时发出的任何广播流量。

This method fails to list the local instance if a firewall is operating on the server. The firewall blocks any broadcast traffic issued when the method is called, even if the sender is from local machine.