asp.net - Failed to connect to server in ssis integrationservices in C# upon deployment -


i have code

    var connectionstring = "data source=" + servername + ";initial catalog=" + databasename + ";integrated security=true";             var connection = new sqlconnection(connectionstring);             var integrationservices = new integrationservices(connection);   // error here. failed connect server.              var package = integrationservices                 .catalogs["ssisdb"]                 .folders["myfolder"]                 .projects["myproject"]                 .packages["mypackage.dtsx"];              long executionidentifier = package.execute(true, null);              executionoperation eo = integrationservices.catalogs["ssisdb"].executions[executionidentifier];             while(!eo.completed)             {                 eo.refresh();                 system.threading.thread.sleep(5000);             } 

during development, no error encountered when web deploy it, error occurs when instantiate integrationservices

    var integrationservices = new integrationservices(connection); 

it saying "failed connect server". know error because when console.log error in browser, says so. preventing me connect integrationservices.

can give me idea on this? thanks.

edited:

i enabled allow remote connections

enter image description here

looks case of either bad connection string or sql server doesn't allow 1433 port connections.

do following:

  1. wrap whole code under try catch
  2. on error, try display/log connectionstring variable value.

once have that, either it'll show incorrect value. (possibly because dts variables or source of servername/databasename variable values not set) or sql server not allowing remote connections. (you need open ports)


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -