Connect to SQL database inside Script Task in SSIS
you cant use the configurations from a connection manager from inside a script task like: conectionManager1.exceuteSQLStatment(...)
once you are "inside" the script task you need to access the CM like a variable:
ConnectionManager cm;
System.Data.SqlClient.SqlConnection sqlConn;
System.Data.SqlClient.SqlCommand sqlComm;
cm = Dts.Connections["conectionManager1"];
sqlConn = (System.Data.SqlClient.SqlConnection)cm.AcquireConnection(Dts.Transaction);
sqlComm = new System.Data.SqlClient.SqlCommand("your SQL Command", sqlConn);
sqlComm.ExecuteNonQuery();
cm.ReleaseConnection(sqlConn);