title: Calling a ssis package using c# windows form(containing variable to be passed in the ssis package)
body: <p>I have a SSIS PACKAGE. I have designed a windows  form containing label, textbox and button to call ssis. But i am stuck for a scenario.
  Like suppose i have 5 variables in ssis out of which a variable name say account number need to get from windows form textbox.</p>
  
  <p>My code for the textbox is </p>
  
  <pre><code> private void textBox1_TextChanged(object sender, EventArgs e)
      {
          TextBox objTextBox = (TextBox)sender;
          string theText = objTextBox.Text;
          string pkgLocation;
          Package pkg = null;
          Microsoft.SqlServer.Dts.Runtime.Application app;
          DTSExecResult pkgResults;
          Microsoft.SqlServer.Dts.Runtime.Variables myVars = pkg.Variables;
  
          pkgLocation =
          @"C:\Users\Visual Studio 2008\Projects" +
          @"\Integration Services Project1\xyz.dtsx";
          app = new Microsoft.SqlServer.Dts.Runtime.Application();
          pkg = app.LoadPackage(pkgLocation, null);
  
          myVars["Account_number"].Value = theText;
  
          pkgResults = pkg.Execute(null, myVars,null,null,null);
      }
  </code></pre>
  
  <p>Here the issue is when enter just one digit say 9 in window form it will start executing the package.Here i actually wanted to let user enter the full account_Number and run the package on button click.</p>
  
  <p>Please let me know what is the issue in the code or what should i add in order to take the account_number on button click?</p>