August 20, 2013 at 2:21 pm
I take it you are working on "Lesson 3: Create an input dialog box" that takes the input from the input box and prints it to an output dialog box?
Did the output dialog box work right when you did "Lesson 2: Create an output dialog box?"
August 20, 2013 at 3:27 pm
Yes it did. I was just going to reply back that I had found what appears to be a fix for this:
using new Form() as the first param.
August 20, 2013 at 3:46 pm
So you are doing this in an SSIS script task or Visual Studio/Visual Basic Express?
If you are using a Form() object, I suspect you are not in SSIS.
August 20, 2013 at 3:55 pm
Here's an example of what I mean, using this part of your code:
'Create and loop through an array list
Dim MyList As New ArrayList
MyList.Add("Apple")
MyList.Add("Orange")
MyList.Add("Banana")
MyList.Add("Peach")
MyList.Add("Cherry")
Dim i As Integer
Dim value As String
For Each value In MyList
Dim button As DialogResult = MessageBox.Show(New Form(), value.ToString(), "ArrayList Value " + i.ToString, MessageBoxButtons.OK)
i += 1
Next
Dts.TaskResult = ScriptResults.Success
End Sub
August 20, 2013 at 4:06 pm
You added the counting integer. It must have something to do with that. Glad you got it working!
August 20, 2013 at 4:29 pm
Adding the New Form(), as the first parameter of the MessageBox.Show is what got this to work. If I remove it, it doesn't work.
I'm in the BIDS and followed the instructions you gave. It was only when I modified as above was I able to get it to work correctly. As stated, I am using windows 7. I also have a few other apps open. Does your code work without the modification in windows 7?
August 20, 2013 at 4:34 pm
It is the change I indicated that made the difference (new form()). If removed, only the 1st dialog shows.
Are you using Windows 7 to test?
(Sorry for the repeat - didn't know it was sent...)
August 20, 2013 at 4:53 pm
My code works as-is in Windows 7.
Here it is pasted into an SSIS 2008 script task.
http://i.imgur.com/vnuX5x9.png
Here is is when I run it.
August 21, 2013 at 12:15 pm
Yes - I am using same and get same. I run by right-clicking script task and execute. I also see Orange next. However, to see the next two dialogs, I have to click on icon that is in taskbar. See part of code below:
For Each value In MyList
' Dim button As DialogResult = MessageBox.Show(New Form(), value.ToString(), "ArrayList Value " + i.ToString, MessageBoxButtons.OK) 'this works
Dim button As DialogResult = MessageBox.Show(value.ToString(), "ArrayList Value " + i.ToString, MessageBoxButtons.OK) 'this only shows first two dialogs - then have to click on taskbar icon to see next two dialogs
i += 1
Next
BTW: it works fine in debug mode - but otherwise, have this problem with
August 21, 2013 at 12:45 pm
When I click the OK button, the next message box pops up. All five of them come up as they should.
Can you try it on another workstation?
August 21, 2013 at 12:50 pm
Perhaps - but not at the moment. When I get around to it, I'll let you know. Thanks for the responses.
August 21, 2013 at 1:13 pm
I've tried it on two computers now and it works on both.
November 1, 2019 at 6:11 am
This was removed by the editor as SPAM
Viewing 13 posts - 16 through 27 (of 27 total)
You must be logged in to reply to this topic. Login to reply