September 3, 2014 at 9:40 am
Yes of course, labels are fine now! I tried executing the script task in SSIS and filled in 20 values, clicked on submit, then it hung for a while and gave the attached error:
My variables are called
dtsCampaign_Code1
dtsCampaign_Code2
dtsCampaign_Code3
dtsCampaign_Code4
dtsCampaign_Code5
dtsCampaign_Code6
etc
.
.
dtsCampaign_Code20
I have added them all as readwrite variables in the script task editor so it contains
User::dtsCampaign_Code1,User::dtsCampaign_Code10,User::dtsCampaign_Code11,User::dtsCampaign_Code12,User::dtsCampaign_Code13,User::dtsCampaign_Code14,User::dtsCampaign_Code15,User::dtsCampaign_Code16,User::dtsCampaign_Code17,User::dtsCampaign_Code18,User::dtsCampaign_Code19,User::dtsCampaign_Code2,User::dtsCampaign_Code20,User::dtsCampaign_Code3,User::dtsCampaign_Code4,User::dtsCampaign_Code5,User::dtsCampaign_Code6,User::dtsCampaign_Code7,User::dtsCampaign_Code8,User::dtsCampaign_Code9
I think this is really close to working now! I am really grateful
September 3, 2014 at 9:52 am
i guess you are missing the attachment.
September 3, 2014 at 9:53 am
sorry error attached now:
September 3, 2014 at 9:54 am
It looks like it is timing out when trying to set the first value in the form to my dts variable dtsCampaign_Code1?
September 3, 2014 at 10:13 am
Please use the below code for btnCampaignCode_Click
void btnCampaignCode_Click(object sender, EventArgs e)
{
foreach (TextBox inputBox in txtCampaignCode)
{
string variable = "dts" + inputBox.Name.Replace("txt", "");
// Now you can use the variables
if (inputBox.Name.ToString().Substring(3, (inputBox.Name.ToString().Length) - 3) == variable.ToString().Substring(3, (variable.ToString().Length) - 3))
{
int number;
if ((int.TryParse(inputBox.Text, out number)) == true)
{
Dts.Variables[variable].Value = Convert.ToInt32(inputBox.Text);
}
// if DTS varibale is of type String
// Dts.Variables[variable].Value = inputBox.Text.ToString();
}
}
frm.Close();
}
September 10, 2014 at 7:05 am
rxm119528 just wanted to say this is now working great and doing exactly what I need it to do. I will have to go on a C# course
Thanks so much for being so generous with your time
Best Wishes from the UK
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply