可以通过以下方式实现:这将在您的初始脚本组件中。
System.Windows.Forms.Form frm = new Form(); TextBox txt = new TextBox(); Button inputset = new Button(); public void Main() { inputset.Text = "Set Variable Value"; inputset.Width = 200; inputset.Height = 100; inputset.Click += new EventHandler(inputset_Click); txt.Name = "Input"; frm.Controls.Add(txt); frm.Controls.Add(inputset); frm.ShowDialog(); MessageBox.Show(Dts.Variables["Value1"].Value.ToString()); Dts.TaskResult = (int)scriptResults.Success; } void inputset_Click(object sender, EventArgs e) { Dts.Variables["Value1"].Value = Convert.ToInt32(txt.Text); frm.Close(); }这应该是包中用于设置变量值或构造SQL Command的初始组件。



