Karunakaran


I was using the code in this thread (http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1371094&SiteID=1) to create a console application which can build the SSIS package dynamically and run the package.

I'm not clear on what all could be the possible key / value combinations for the SetComponentProperty Method. From the examples I have seen its either SqlCommand or OpenRowSet. But I'm not sure about the "AccessMode" with values either 0 or 2. Is there any reference where I get more information on these

Code Block

// Set the custom properties of the source.

srcDesignTime.SetComponentProperty("AccessMode", 2);

srcDesignTime.SetComponentProperty("SqlCommand", "Select * from devdb..empl_karun");



Thanks




Re: SetComponentProperty - Possible Key / Value Combinations

Sabotta


You call the ProvideComponentProperties method to initialize a component and create it's custom properties. After you call this method, you call SetComponentProperty method to assign values to these custom properties.

The CustomPropertyCollection gets the collection of custom properties exposed by a component.

For more information, see:

- "IDTSComponentMetaData90.CustomPropertyCollection Property" (http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.wrapper.idtscomponentmetadata90.custompropertycollection.aspx)

- "CManagedComponentWrapperClass.ProvideComponentProperties Method" (http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.wrapper.cmanagedcomponentwrapperclass.providecomponentproperties.aspx)

- "Adding Data Flow Components Programmatically" (http://msdn2.microsoft.com/en-us/library/ms135932.aspx)






Re: SetComponentProperty - Possible Key / Value Combinations

Karunakaran

I have already went through those links. But they dont say what are the possible values or when to use what.

For eg., when I have to use AccessMode and what are the values should be used and when. This kind of information is what I'm looking for.

Thanks anyways for the links.

Thanks






Re: SetComponentProperty - Possible Key / Value Combinations

jwelch

One way to see these values is to configure an OLE DB Destination in a package, then view the XML code for it (by choosing View Code when you right-click on the package in the Solution Explorer). Search for the OLE DB Destination name, and you can see the properties configured on the component, and the values for the options you picked.






Re: SetComponentProperty - Possible Key / Value Combinations

DarrenSQLIS

Take a look at this topic - http://technet.microsoft.com/en-us/library/ms136001.aspx

It documents all the propertis for the different Data Flow components. Saying that for the enum style options you are better going doing as John suggests, build a sample and view the code, as the integer codes are not documeted.