Showing posts with label adding. Show all posts
Showing posts with label adding. Show all posts

Friday, March 9, 2012

Programmatically iterating tasks/components in the data flow portion of a package.

HI All,

In several threads there has been discussion regarding adding connection managers to a package's data flow, etc. My challenge is that I have a large solution that contains many packages, and I need to change the connection manager linked to the data flow in all of the packages. When the solution was initially designed, data sources were used, and it has become a tedious maintenance issue to keep those in sync. We want to use a standard OLEDB connection manager, but adding a connection manager to each package and editing the corresponding data flow tasks in each package to use that new connection manager is a daunting task. I've coded a .Net module to access the packages, remove the old connection manager (data source) and add the new OLEDB data source. However, as I traverse the objects in the package hierarchy, when I come to the data flow object, the innerobject is not a dts object, but rather a _com object.. I can't seem to find any documentation/examples as to how to iterate the tasks within a data flow and change the connection manager. If you have any information, that would be quite helpful. If you reply with a code sample, if you would be so kind as to relate it to one of the sample packages provided with SSIS so I can run it, that would be great.

Thank you.

Steve.

Hiya Steve,

I know we discussed this offline but just for anyone else's benefit.... the following may help:

Iterate over a package programatically
http://blogs.conchango.com/jamiethomson/archive/2007/03/06/SSIS_3A00_-Iterate-over-a-package-programatically.aspx

-Jamie

Wednesday, March 7, 2012

Programmatically adding new column at desired place...not at the end

I understand that adding new column programmatically (using ALTER TABLE...),
adds it at the end of the table. Is it possible to specify that this column
should be placed at the 3rd place (not at the end).
Thanks in advance
J JustinHi Justin,
No, You can not do that. Only way for that is to drop and recreate the table
with new order.
Thanks
Hari
SQL Server MVP
"Justin" <justin@.gjsoft.com> wrote in message
news:%231cEsy0NFHA.2736@.tk2msftngp13.phx.gbl...
> I understand that adding new column programmatically (using ALTER
> TABLE...),
> adds it at the end of the table. Is it possible to specify that this
> column
> should be placed at the 3rd place (not at the end).
> Thanks in advance
>
> J Justin
>
>|||As Hari said, you can't without dropping and recreating the table. And your
code shouldn't be dependent on the physical order of the columns. Logically
speaking, columns in a table do not have an order. All references to columns
should be by name and not by ordinal.
Jacco Schalkwijk
SQL Server MVP
"Justin" <justin@.gjsoft.com> wrote in message
news:%231cEsy0NFHA.2736@.tk2msftngp13.phx.gbl...
> I understand that adding new column programmatically (using ALTER
> TABLE...),
> adds it at the end of the table. Is it possible to specify that this
> column
> should be placed at the 3rd place (not at the end).
> Thanks in advance
>
> J Justin
>
>|||http://www.aspfaq.com/2528
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Justin" <justin@.gjsoft.com> wrote in message
news:#1cEsy0NFHA.2736@.tk2msftngp13.phx.gbl...
> I understand that adding new column programmatically (using ALTER
TABLE...),
> adds it at the end of the table. Is it possible to specify that this
column
> should be placed at the 3rd place (not at the end).
> Thanks in advance
>
> J Justin
>
>

Programmatically Adding ADO.NET Connections

I can't find any documentation on the connection string for creating ADO.NET connections.

I am displaying a report in a viewer. It is connected to a wrapper DLL through an ADO.NET connection using the properties:
File Path
Class Name
Dataset Names

I'm having trouble accessing these to change them at runtime.

I've tried something like:
rpt.database:Tables(1):ConnectionProperties("File Path") = "c:\..."

No luck. Crystal doesn't have much documentation on this method. Any takers?Nevermind. Got it.

I was able to override the path of my DLL at runtime using the syntax:

report.database.tables(1).ConnectionProperties("File Path").Value = "c:\blah"

seems to be working.

Programmatically adding a user to the System User role

We have been working on an application that will be using a forms-authenticated report server (RS2005) as a reporting back-end. Using the reporting services web service I have been able to assign permissions to objects in reporting services no problem. The issue is that each user needs to be added to the System User role to be able to use the report builder properly. I can't seem to find a way to do this programmatically. Any idea?Nevermind, GetSystemPolicies() is what I was looking for.