1
votes

I am trying to get some basic code running. I am using a SSIS script component (source type). I have set up the component using the code in http://technet.microsoft.com/en-us/library/ms136060(v=sql.105).aspx (section: ADO.NET Source Example). However the following line is gnerating an error:

connMgr = this.Connections. MyADONETConnection;

'Connections' does not contain a definition for 'MyADONETConnection' and no extension method 'MyADONETConnection' accepting a first argument of type 'Connections' could be found (are you missing a using directive or an assembly reference?)

I have set up the connection and output columns as per the instructions. Any thoughts appreciated. Johnny

1

1 Answers

0
votes

UPDATE: Bill is correct, in the Script Component editor, you have to explicitly add a reference to the Connection Manager you created in order to access it in the script.

  1. Open the editor for your Script Component.
  2. Select the Connection Managers tab from the left.
  3. Add a new entry for your MyADONetConnection to the Connection Managers list. You can name it anything you want, though generally you should name it the same as your connection manager for maintainability.
  4. Now you can access this connection as a property of the Connections collection in your script.