Monday, 1 August 2011

WEBSERVICE TASK

How to generate wsdlfile ?
  Type the word wsdl at the end of the webservice(.asmx) with a question mark added.

http://domain.com/WebServices/yourservice.asmx?WSDL


The WSDL can also generally be reached by appending "?wsdl" to the address of the asmx file.

Thursday, 14 July 2011

Check a Connection Of a Database Using Script Task in SSIS

public void Main()

{



ConnectionManager cm = Dts.Connections.Add("OLEDB");
 //cm.ConnectionString = Dts.Variables["ConnectionString"].Value.ToString() + " Connect Timeout=6;";
cm.ConnectionString = "Data Source=10.200.1.123;User ID=sa; Password=Welcome123; initial Catalog=UwinLiteModel1; Provider=SQLNCLI10.1; Persist Security Info=True; Auto Translate=False;Auto Translate=False;
Connect Timeout=6;";
//The connection Timeout is that time used for checking the connection

            try
            {
           
               
                cm.AcquireConnection(null);
                //MessageBox.Show("Connection Success");
                Dts.TaskResult = (int)ScriptResults.Success;
               
            }
            catch
            {
                //MessageBox.Show("Connection Failure");
                Dts.TaskResult = (int)ScriptResults.Failure;
               
            }


           
           
        }