.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Set Connection of OLE DB Source component at run-time in a script

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
 

Hello,

Is it possible to set the Connection property of an OLE DB Source component at run-time using a script task? The Connection Manager exists at design time but based on different development/production databases, I need to set which connection manager should be used for the OLE DB source at rum time. If possible, how do I accomplish this?

(Visual Studio 2005)

Thanks.




View Complete Post


More Related Resource Links

How to create a source component using Oracle oledb connection

  

How to create a source component using Oracle oledb connection in x64??

 


abstract away the source of the connection string using a class with a static property.

  
ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Encapsulation
Let's abstract away the source of the connection string using a class with a static property.

Script Component HELP!

  
Hi Guys, I have some recordset in the data flow. CURRENT Column1 Column2 Column3 Column4 Column5 Column6 Dine In DISCOUNT 20100824 121618 1859 37 Dine In TAX 20100824 121618 1859 -15.8 Dine In TOTAL 20100824 121618 1859 6.77 Dine In TENDER 20100824 121618 1859 63.2 Dine In TAX 20100824 121618 1859 63.2 Dine In DISCOUNT 20100824 121618 1860 37 Dine In TAX 20100824 121618 1860 -15.8 Dine In TOTAL 20100824 121618 1860 6.77 Dine In TENDER 20100824 121618 1860 63.2 Dine In TAX 20100824 121618 1860 63.2 I want to rename the second "TAX" in Column2 with the value of "DELIVERY CHARGE" and i was thinking on how to do this using script component. TARGET Column1 Column2 Column3 Column4 Column5 Column6 Dine In DISCOUNT 20100824 121618 1859 37 Dine In TAX 20100824 121618 1859 -15.8 Dine In TOTAL 20100824 121618 1859 6.77 Dine In TENDER 20100824 121618 1859 63.2 Dine In DELIVERY CHARGE 20100824 121618 1859 63.2 Dine In DISCOUNT 20100824 121618 1860 37 Dine In TAX 20100824 121618 1860 -15.8 Dine In TOTAL 20100824 121618 1860 6.77 Dine In TENDER 20100824 121618 1860 63.2 Dine In DELIVERY CHARGE 20100824 121618 1860 63.2 Thanks in advance,

Script Component

  
Hi Guys,   I am newbie and never done coding in vb. script, I am using SSIS component for this. I am using below code to allow user to enter storeid and change file name inside the directory from filename.ajk to storeid_filename.ajk.   Example:  01012010.ajk 02012010.ajk 03012010.ajk Once the user enter the storeid all the files in that particular directory will change to like this automatically 192572_01012010.ajk 192572_02012010.ajk 192572_03012010.ajk Now all I want is to change the file name from 01012010 to 20100101. So once the user enter the storeid it has to change it to  192572_20100101.ajk 192572_201001012.ajk 192572_20100103.ajk     Please help me guys its a urgent help.       Public Sub Main() ' ' Add your code here         '         Dim InputFilePath As String         Dim StoreNo As String = InputBox("Enter Store No", "StoreNo")         InputFilePath = Dts.Variables("strInputFolder").Value         Dim strFileSize As String = ""           Dts.Variables("StoreNo").Value = StoreNo         Dim di As New IO.DirectoryInfo(InputFilePath)         Dim aryFi As IO.FileInfo

Question using Script Component

  
Hi Guys, I have this records on my dataflow.   Column1 Column2 Column3 ITEM 1 P ITEM 2 S ITEM 3 N ITEM 4 O ITEM 5 M ITEM 6 MC ITEM 7 MAO ITEM 8 MT ITEM 9 P ITEM 10 S ITEM 11 N ITEM 12 O ITEM 13 M ITEM 14 MC ITEM 15 MAO ITEM 16 MT    I want to add a new column that based on these condition. 1. If Column1 and Column3 is "S", "N", "O", "P" then Column4 value is  1 2. If Column1 and Column3 is "M" then Column4 values is 0 3. if Column1 is not "ITEM" then Column4 value is NULL 4. If Column1 and Column3 is "MC", "MAO" , "MT" then get the last column2 value place for Column4.  Column1 Column2 Column3 Column4 ITEM 1 P 1 ITEM 2 S 1 ITEM 3 N 1 ITEM 4 O 1 ITEM 5 M 5 ITEM 6 MC 5 ITEM 7 MAO 5 ITEM 8 MT 5 ITEM 9 P 1 ITEM 10 S 1 ITEM 11 N 1 ITEM 12 M 12 ITEM 13 O 1 ITEM 14 MC 1 ITEM 15 MAO 1 ITEM 16 MT 1  I have the following script to get some of the conditions, but im stuck in the last one with the "MC, MAO, MT" in Column3.  If Column1 = "ITEM" And Column3 = "S" Or Column3 = "N" Or Column3 = "O" Or Column3 = "P" Then             Column4 = "1" &

Error in Script component in the Data Flow Task

  
Hi, I need a small help. This is what i require. I need to generate a auto increment number using script component and assign it to target column. use db1 go create table src (name varchar(10) ) insert into src select 'A' union all select 'B' union all select 'C'   create table trg (id int, name varchar(10) ) while loading the trg table, i need to generate a auto increment number and then load it to target. Finally, my trg table data should look as follows id name 1  A 2  B 3  C This is what i have done inside the package. step1 : declared a global variable "tmp" of int32 step2 : created a connection manager pointing to "db1" database step3 : drag n drop data flow task step : inside the data flow task , i have the following        OLEDB Source  (select name from src)           |        Script Component (i have added a new Output column "v_id" of int datatype in INPUTS AND OUTPUTS page)           |        OLEDB Destination In the Script page in Script component , in ReadWriteVariables | User::tmp, I have chose Visual Basic 2008 and clicked the EDit script and inside the Editor this and inisde the below routine i have added only two

Need an example of error in OLE DB Source component when source is Excel file.

  
I want an example of error (not truncation) in individual row or individual cell that can occur in OLE DB Source component when source is Excel file. I'm trying out Error Output of data task component.  I have already tried out Error Output of OLE DB Destination component.

I need to create a script in SSIS which creates a data source that connects to an Access database.

  
I need to create a script in SSIS which creates a data source that connects to an Access database. The Access database file name needs to be set as a variable as it will change from month to month. I have no idea what I am doing can anybody give me some tips? Mr Shaw

how to check one time java script file download not every session

  
how to check one time java script file download not every session

Script Component Question

  
Hi Guys, I got this recordet from a flat file. C1 C2 ITM 0 ITM 0 ITM 0 ITM 0 TX 0 DC 0 TOT 1 TN 0 ITM 0 ITM 0 ITM 0 ITM 0 TX 0 DC 0 TOT 2 TN 0 The requirement is if C1 = TOT, then the C2 value remains the same. If C1 <> TOT then C2 value is equal to C1 = TOT value. C1 C2 ITM 1 ITM 1 ITM 1 ITM 1 TX 1 DC 1 TOT 1 TN 1 ITM 2 ITM 2 ITM 2 ITM 2 TX 2 DC 2 TOT 2 TN 2 The sorting is fix. TOT always come first before the TN. Can a script component do this and how? Thanks,

SSIS script component bugs at around 10k rows

  
I'm trying to load a dimension table from a tab delimited file to a parent-child table. I have made a script like this: public override void Input0_ProcessInputRow(Input0Buffer Row) { String level0 = null, level1 = null, level2 = null, level3 = null, level4 = null, level5 = null; while (!Row.EndOfRowset()) { if (Row.Description_IsNull || Row.Description == "") { if (!Row.NextRow()) break; continue; } if (!Row.Level0_IsNull) { Row.ID = Row.Level0; Row.ParentID = null; level0 = Row.Level0; Row.Description = Row.Description; } else if (!Row.Level1_IsNull) { Row.ID = Row.Level1; Row.ParentID = level0; level1 = Row.Level1; Row.Description = Row.Description; } else if (!Row.Level2_IsNull) { Row.ID = Row.Level2; Row.ParentID = level1; level2 = Row.Level2; Row.Description = Row.Description; } else if (!Row.Level3_IsNull) { Row.ID = Row.Level3; Row.ParentID = level2; level3 = Row.Level3; Row.Description = Row.Description; } else if (!Row.Level4_IsNull) { Row.ID = Row.Level4; Row.ParentID = level3; level4 = Row.Level4; Row.Description = Row.Description; } else if (!Row.Level5_IsNull) { Row.ID = Row.Level5; Row.ParentID = level4; level5

Script Component Help

  
Hi Guys, I have the following recordset in my dataflow.   Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 Col11 Col12 Col13 Col14 Col15 Col16 Col17 Col18 Delivery       DELIVERY 1234567 1 Ewoks 0 0 0 0 0 0 0 0 0 0 0 0   Delivery       ITEM   20100804 111524 25 1 1 4001 5 1 5 1 0 JED SPAGHETTI 1 42   Delivery       TAX   20100804 111524 25 1 1 0 0 0 0 0 0 TAX 1 92.18   Delivery       TOTAL   20100804 111524 25 1 1 5 0 7 1 0 1 Delivery       1 489.5   Delivery       TENDER   20100804 111524 25 1 1 0 1 1 0 0 0 CASH 1 489.5   DELIVERY 6671775   Sari-Sari Store 0 0 0 0 0 0 0 0 0 0 0 0     DELIVERY 6671775   Sari-Sari Store 0 0 0 0 0 0 0 0 0 0 0 0     PaidOut-Refd KPP Dep PAIDOUT   20100804 104450 1304 1 -1 7 0 0 0 0 0 PaidOut-Refd KPP Dep 1 500     Conditions: If Col1 <> "DELIVERY" And Col2 = "DELIVERY" Then Col18 = Col3 + "," + Col4 Where Col2 = "TENDER" If Col1 = "DELIVERY" And Col2 = "DELIVERY" Then Col18 = Col3 + "," + Col4 Where Col2 = "TENDER" If Col1 in first row = "DEL

SQL Server 2008 Script Componant Error - [SSIS.Pipeline] Error: component "Script Comp Name" (48) fa

  
Hi All,   I am facing one strange issue in SSIS 2008. I have developed one SSIS package which is importing excel data into SQL Server 2008. This Package contains some Scirpt componants. This package is working fine on Windows XP machine but when I am trying to run on Windows 2003 server it gives me error "[SSIS.Pipeline] Error: component "SCR RDSTableRelation" (48) failed the post-execute phase and returned error code 0x80004002". Surprising thing is that if on windows server 2003server  if I drag a new script componat and paste the previous script code itself then it works fine. Even if I copy-paste the existing script componant and give source-destination connectino to this new script componant then also it works.

Errors in the high-level relational engine. A connection could not be made to the data source with t

  
When I deploy the cube which is sitting on my PC (local) the following 4 errors come up: Error 1 The datasource , 'AdventureWorksDW', contains an ImpersonationMode that that is not supported for processing operations.  0 0 Error 2 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW', Name of 'AdventureWorksDW'.  0 0 Error 3 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Customer', Name of 'Customer' was being processed.  0 0 Error 4 Errors in the OLAP storage engine: An error occurred while the 'Customer Alternate Key' attribute of the 'Customer' dimension from the 'Analysis Services Tutorial' database was being processed.  0 0

Cannot create a connection to data source !!!! SSRS 2005

  
I cannot get this error resolve either for myself or any users, and I'm actually part of the Admin group!  Furthermore, a user with whom I'm tring allow to view this report keeps getting prompted for their windows username and password.  I thought that since this datasource was set to Windows Authentification that it would just pass it through? I'm pulling my hair out at this point: Screen Shots: http://www.webfound.net/datasource_connection.jpg http://www.webfound.net/datasource_connection2.jpg http://www.webfound.net/datasource_connection3.jpg Also As far as I know, I've given sufficient permissions to the right logins and right users on my SQL Databases and related stored procs that the datasets (not datasource) run An error has occurred during report processing. Cannot create a connection to data source 'datasourcename'. For more information about this error navigate to the report server on the local server machine, or enable remote errors

Script Component - Change One Row Input to Multiple Row Output

  
Hi All I am new to SSIS, and looking for help. I do not know if it is possible, but I like to try using the "Script Component" to change a input like this:   1234 1235 1236 ...   to and output like this:   1234, Value1 1235, Value2 1235, Value3 1235, Value4 1236, Value5 ...   Depending of the input value, 1 or more Rows are pushed out the Output, Like the value 1234 -> result in 1 Row in the output, where the value 1235 -> result in 3 rows in the output. Is this possible to do in a Script Component?? If it is how do you program such behavior? Do some good sources to learn SSIS exist out there?? I think it is not easy to find information. Peter Schwennesen

REST Connection Data Source is getting overriddeen by SPD 2010

  
Hi, I used a Linked Datasource consist of two REST Connection Data Source with the credentials saving with the data source. The first time i add the Data View to the Web Part Zone everything is fine and the data is shown fine but the moment i save it and close the aspx page and open it again, SPD overrides and adds some of the attributes in the DataSources tag, which makes it giving an error saying connection problem and if i copy paste the original Datasource tag with the values it works fine. Any Idea guy's i am just fighting with this from 2 days. Thanks Girish
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend