Configuring The Connection (DataSource) Dynamically
Feb 6, 2008
Hi All,
I need to write a report which will run based on the user's input for Server Group. Meaning, if the user wants the report to be run for one say, UAT group, the report (and therefore the stored procedure) should be executed against UAT server. Or, if the user wants it to be run on the Production machine, the stored procedure should be executed on the Production Server. Assume that both UAT and Production servers are in the same domain to rule out any authentication issue.
I think one way of doing it is to create a linked server on one server which we use to connect via the Report Manager. So, whatever Server Group is selected based on that the SP will be executed on that respective Server Group's Server, since in the query we will have given full names of the tables that we use.
But, I strongly suspect, that having linked servers will not be accepted since it requires that the server owners maintain that. So, I was thinking if there is any other way of achieving this. If anyone knows, please help me with this.
Thanks a lot and let me know if the question is not clearly stated.
Hi When I try to configure a SQL datasource and I use a Microsoft SQL Server datasource I get a blank drop down list for server name. My aspnetdb is available in SQL Server 2005 and I can log into it through management studio, and the service is started. I am also using Vista Ultimate. Is there any other configuration I need to do for Visual Studio 2008 to see the SQL Server instance? Thanks Kwis
I have several Sql Tables, each containing more than 100 fields, on which I need to perform display operation through GridView, Insert and Update through an array of dynamically created and databound TextBoxes. I would like to use a single page to manage all Sql Tables on the basis of the name of the specific one invoked by the user. In order to achieve that, I need to dynamically configure the SqlDataSource Web Control present on the page for each Sql Table. In particular I need to generate at runtime the InsertCommand and the UpdateCommand. On how to do it I have no idea. Federico
I am using SQL Server 2005 Reporting Services. I have many parameters to pass to the dataset. Is there a way to change the dataset dynamically based on the parameters selected?
Suppose If param1 is selected, I want to use dataset1 and if param 2 is selected. I want to use dataset2 and so on... in my reports.
I have been struggling with this for quite awhile so any help would be appreciated.
I need to know if there is away to populate the fuzzy grouping control dynamically. I know you programmatically design a package and customize it in C# but for our purposes we would like to control the SSIS package via database settings. When the settings change the package would then act different. Its a simple a package consisting of an Input - fuzzy grouping - conditional split - output. The connections are setup dynamically using parameters, expressions and a script task. Is there anyway I could do a similar thing for Fuzzy Grouping?
I need to write a report which will run based on the user's input for Server Group. Meaning, if the user wants the report to be run for one say, UAT group, the report (and therefore the stored procedure) should be executed against UAT server. Or, if the user wants it to be run on the Production machine, the stored procedure should be executed on the Production Server. Assume that both UAT and Production servers are in the same domain to rule out any authentication issue.
I think one way of doing is to create a linked server on one server which we use to connect via the Report Manager. So, whatever Server Group is selected based on that the SP will be executed on that respective Server Group's Server, since in the query we will have given full names of the tables that we use.
But, I suspect, that having linked servers will not be accepted since it requires that the server owners maintain that. So, I was thinking if there is any other way of achieving this. If anyone knows, please help me with this. I am working on SRS 2000 and NOT 2005 please.
Hello All, How to assign the DataSource to Server Report which is stored in the remote machine. Now i need to work on it. If you have any solution please pass on it to me.
Hi all, I am new to SQL Server but I'm trying to learn it.. :) I've created a database on my campus server. Now I want to configure it so that I can access the database from my laptop computer through internet. I have an account in the SQL server installed on my remote server. I can connect to the remote server through remote connection.
I am trying to configure a connection manager for a database that is still using SQL Server 6.5 But it is not working properly. I put the server name, user name and pass word, I select the Native OLE DBMicrosoft OLE DB Provider for SQL Server as my provider.
When I click Test Connection it says the connection is fine but then the drop down list for the list of databse names hows nothing!
I am programmatically creating a package in c#. I need this package to contain a flat file connection manager. I have been successfully able to create the connection manager with the following code:
Package p = new Package(); //New package
ConnectionManager cm = p.Connections.Add("FLATFILE"); //Add a flat file connection manager
cm.ConnectionString = "C:DevmyTestFile.txt"; //Set up the connection string
At this point, I want to configure the flat file specific properties of the connection manager (RowDelimiter, HeaderRowDelimiter, etc.). The problem is that the properties collection of the ConnectionManager object is read only. I think I could access the inner object of the connection manager and set the properties in the following way:
ConnectionManagerFlatFileClass ffClass = (ConnectionManagerFlatFileClass) cm.InnerObject; //Get the inner object
ffClass .RowDelimiter = "{LF}"; //Set the properties here Even if this would work, I do not like the solution b/c the BOL states that the ConnectionManagerFlatFileClass "supports the SQL Server 2005 infrastructure and is not intended to be used directly from your code". Does anyone know the "right" way to set these properties? Many thanks in advance! David
When I configure and test and OLEDB connection SQL Server 2005 keeps stopping with an error message as shown below. The problem seems to happen when I open the connection for ediing in Data Flow Window. There is a consistent pattern of errors (in there Event Log) relating to the Evnet Log prior to this error occurring.
Any idea what the problem is?
I have to say that my experience with SSIS has not been very encouraging so far.
Event Type: Error Event Source: MSSQL$SQL2005 Event Category: (2) Event ID: 17311 Date: 23/01/2007 Time: 2:06:41 PM Description: SQL Server is terminating because of fatal exception c0000005. This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling. Check the SQL error log for any related stack dumps or messages. This exception forces SQL Server to shutdown. To recover from this error, restart the server (unless SQLAgent is configured to auto restart).
I'm creating an xml configuration file to hold the connection string including the password (sql server authentication). My package protection level is set to 'EncryptSensitiveWithPassword'. I set up my connection manager and I check the 'Save my password' box. The 'Test connection' button reports that the connection is OK. I enable the package configurations and I go through the Package Configuration Wizard and I specify 'xml configuration file' and I choose 'Specify configurations settings directly' and I specify a configuration file name with the same directory as the package. I check the 'ConnectionString' property and the 'Password' property and then click 'Close'. Then I save my package changes. Now I look at the xml configuration file in a text editor and I see the Password property has an empty element:
<ConfiguredValue></ConfiguredValue>
Is it supposed to be empty? When I right-click the package in solution explorer and pick 'Reload with upgrade' then I have to enter the password, but the validation fails with 'Acquire connection' error. Should I just be saving the 'Connection string' property, or should I save all the connection elements (i.e. ServerName, UserName, Password etc.)? If I edit the xml configuration file and I type the password into the <ConfiguredValue> element above, and then I do 'Reload with upgrade', then the 'Acquire connection' validation error goes away. Could this mean that I am not able to encrypt the password? Thanks.
have developed a report on a test server which I can access from i./e. http://localhost/reports
DataSourcce is accessed using a sql login
My colleague on his machine can not access. His error is:
An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'MarketAnalytics'. (rsErrorOpeningConnection) For more information about this error navigate to the report server on the local server machine, or enable remote errors
I have one problem with my reports. I have one Cube and every week, we process the cube to recalculate the measures. Before, my report can be displayed with any problem but know, since we process the cube, we can't see the reports based on the cube. The errors display in the report manager are : rsProcessingAborted and rsErrorOpeningConnection.
When i try to access the report directly from my local project thanks to visual studio, the reports works well.
I think that it may be a problem of rights and abilitations. Or maybe it'a an IIS problem ? Or a firewall problem ?
Does anyone out there have any ideas on the best way to connect in integration services to a nonstop sql database running on a tandem computer? We have some odbc drivers that have proven to be problematic and slow to use. What oledb products I can find apparently come with something that's around $36K per processor to buy. Thanks.
Hello, I Created a report with reportbuilder, after clicking on Run Report I got this message, Its very strange it seems that its trying to generate or create a datasource.
Para obtener más información acerca de este error, vaya al servidor de informes en el equipo del servidor local o habilite los errores remotos ---------------------------- No se puede crear una conexión al origen de datos 'dataSource1'. ---------------------------- Error al procesar el informe.
I have develop any report in reporting services on server Development. i deploy my report to server production. i have connection to cube as data source. if open report manager in server production and open the report, its succesfully. the report is open. but if i open report manager in server development show error
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'PNL'. (rsErrorOpeningConnection)
For more information about this error navigate to the report server on the local server machine i use windows authentication in my pnl datasource.
I've written a DTS Package to pull information from a number of servers. I have a list of servers (Source Servers) and for each one I automatically update the Datasource property of the Source Server connection using vbscript in an ActiveX Script task and a global variable.
I have a transformation that occurs between the Source server and Target server.
As I process each Source Server in turn, the global variable gets set correctly and so does the Datasource property of the Source Server connection. However the transformation still runs against the first Source Server that was processed.
Looking at BOL it appears that a transformation stays connected even after it has finished. Therefore I assume that although I change the Datasource of the connection to a new server, it still runs against the first server that was used.
My question is how do I get the connection to run against the updated Datasource, i.e. do I need to do a refresh of the Connection, disconnect or what ?
i have to store some data on a remote sever(MS SQL SERVER2000). The scenario is like 1. The web application runs on a local machine. User (who inputs) uses through LAN.2. The Input should be stored in the remote server. if the remote connection is ok. otherwise it should be saved in local server's database(MS SQL 2000).3. In the application's web.config there is a connection string pointing to the remote server and another one (alternating one) points the local server's database. in scenario like this i first to tested the remote connection. if it is not ok then i initialize the local server's connection like thisprivate MyConnection() { try { connectionSql = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnForRemote"].ToString()); connectionSql.Open(); } catch (Exception ex) { connectionSql = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnForLocal"].ToString()); } finally { connectionSql.Close(); } connectionSql2 = new SqlConnection(ConfigurationManager.ConnectionStrings["Temp"].ToString()); }My problem is when the remote connection is lost it takes almost 1 minute to store in local database. how can i make it more time efficient. Thanks....
Hi - hope someone can help. We're creating a ASP.NET C# site that allows a user to connect to any of our 100+ SQL Servers and query a database that sits on every server. I'm trying to work out (and failing) how we can set the 'Data Source' in a connection string dynamically using the server name selected by the user in a drop down box. Any help appreciated, thanks in advance,
Hi. I have this kind of problem since I am not very conversant with SSIS and stripting in VB.NET.
The set-up is the following: Flat File Source -> Script Component -> Flat File Destination
The flat file source looks like this:
NameOfFile Headers Data Data Data and many more rows of Data NameOfAnotherFile Headers Data Data Data and many more rows NameOfAnotherFile Headers Data Data and so on in the same manner...
My stript looks like that (not very complicated): Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Dim strRow As String = Row.Column0.Trim() Dim strFolder As String = "Data" Dim strConn As String Dim charSep() As Char = {CChar(" ")}
If Mid(strRow.ToLower(), 1, 2) = "d0" Then
' This is the file name, so start a new connection to a new file ' which definitely does not exist yet strConn = strFolder + strRow + ".csv"
' DestinationFile is the name of the ' Flat File Connection Manager With Me.Connections.DestinationFile .ConnectionString = strConn End With
Else Row.Column0 = String.Join(",", strRow.Split(charSep, StringSplitOptions.RemoveEmptyEntries)) End If End Sub
I have several questions regarding this one.
1. Is it ok to change the ConnectionString property of the manager to redirect the row to a different file? If not, what more to do?
2. If the new destination file does not yet exist, will it be created for me or will I get an error? If I do, what to do not to?
3. The most important: What steps to take so that a row is discarded from the pipeline in the script? I want some rows not to be directed to the file destination. These are the lines that contain the name of the file into which the data below belongs.
If you can optimize some steps in the script, then please do so by all means. Thank you for any comments and the knowledge you kindly agree to share with me. Darek
I have 3 web identical web apps whose only diff is that they access different SQl Server DB's. I use the SQLDataSource in a number of pages to retrieve data from the db. The apps all use Forms Auth. I would like to be able to see who is the logged on user user and assign the approp connection string to all the SQLDataSources in the app. For example when user UserA logs in they are retrieving data from on db but when UserB logs in they are retrieving data from another db. I am sure this can be done but could use a little guidance. Thanks in advance.
I am looking to dynamically change the connection string in my SSIS package, to avoid changing the connection string each time I want to run in different environments.
I have an ssis package that contains a DateTime variable named RefDate its value saved in the package is 8/31/2006. I setted up a Package configuration for read the value of RefDate from the parent package.I inserted a script task with message box to verify that the package configuration works. When I launch the parent package the message box shows the value of RefDate setted in the parent package. The problem is that when I use RefDate to dynamically set the connection string of the log connection of the SSIS log provider for XML files for the child package, the connection string contains the child value of RefDate.
Hi, I am new to SSIS and i have to develop a ssis package which will run in a production machine through VB.Net(2003) exe.I am facing a problem while setting connection string of SSIS package dynamically.Can anybody help me on this?
I want to transfer data from one server to another by using SSIS. i want the connection string to be dynamic and also according to the some other variable, the transforming data is changing.
Could you provide me the solution thet how i am able to change my connetction string dynamically and the other variable too.
i am using VS 2003 as front end and SQL server 2005 as a backhand.
Due to VS.NET 2003 i am able to create DTS packages but i have to migrate it and then anly i am able to use it in JOB in SQL server agent of SQL server 2005.
is that any code or any stored procedure from which i am able to migrate DTS packages to SSIS packages.
Is there a way to dynamically create a connection manager @ run time? I would like to do this from a data set of connection strings so I can link them into a union all component.
Within an SSIS Package, we are trying to change the connection string of an output file connection manager at runtime (used for package logging).
To do this, we have defined variables with package-level scope and set the connection manager connection string to this variable. The first step of the package is to set these variables. The second step begins the rest of the package operations (moving data). The package executes successfully, but the log file is never created/appended to.
When the package is debugged, I can verify that the variables are being set correctly in the script task and that the variable values are being passed to the connection manager data sources.
I need to make my site aware of which server_name it is loading from so it uses a different connection string. (have dev + prod servers for web/sql)Currently my connection string is in web.config as follows: <connectionStrings> <!-- Development and Staging connection string --> <add name="myconnection" connectionString="server=myserver; user id=mysuer; password=mypassword; database=mydatabase" /> </connectionStrings> I need to make sure the 'name' is the same for both connection strings since that is how the rest of my site looks for it. However, I'm not sure how to get both in here with some sort of 'if/then' statement to determine which one to use.I've heard it could be done in global.asax with something similar to the code below, but I dont know how to assign a 'name' to a connection string for that type of setup. Sub Session_OnStart ServerName = UCase(Request.ServerVariables("SERVER_NAME")) IF ServerName = "prod.server.com" THEN ...Set Prd string... ELSE ...Set Dev string... END IF End Sub
I have hard coded the value for the User::FilePath variable in the parent package.
I am mapping this variable to the value of the same variable in the Child Package.
I created a directory and sql file: "C: empsqlb.sql". I have verified that the path variable value is passed to the child package by using a Script task with a messgbox call.
How do I define an execute sql task to execute sql file: @[User::FilePath] & "sqlb.sql". I'm using this expression for the SqlStatementSource property. I have entered the OLEDB server information and specified the SQLSourceType = fileconnection.
However I get the error:
[Execute SQL Task] Error: Connection manager "D: lewisdevZsqlb.sql" does not exist.
I am pretty new to SQL Server 2005 and SSIS. I am trying to dynamically load files into SQL Server 2005 using files/paths contained in tables. I have a key table in my SSIS package that defines which files should be processed, some default values that will be associated with each file (ie CompanyKey and PeriodKey) and the file path (see below for example):
CompanyKey
PeriodKey
ProcessFlag
FileName
2
61
FALSE
2005TB200501.xls
2
62
FALSE
2005TB200502.xls
2
63
FALSE
2005TB200503.xls
2
64
TRUE
2005TB200504.xls
2
65
TRUE
2005TB200505.xls
2
66
TRUE
2005TB200506.xls
2
67
TRUE
2005TB200507.xls
2
68
TRUE
2005TB200508.xls
2
69
TRUE
2005TB200509.xls
2
70
TRUE
2005TB200510.xls
2
71
TRUE
2005TB200511.xls
2
72
TRUE
2005TB200512.xls
The package I am developing is supposed to loop through this table checking for files with ProcessFlag = TRUE. For those files, it will load all of the records/columns (prefaced with the company and period keys) into a common table.
Do I have to manually create data sources for each file or is there a way to dynamically define the connection and process the connection?
Any assitance you could provide would be greatly appreciated!
Hi, I tried to follow the widely talked about method to dynamically populate the connection string property of my flatfileconnection manager from a variable. I keep getting the following non-fatal error.
TITLE: Microsoft Visual Studio ------------------------------
Nonfatal errors occurred while saving the package: Error at Package [Connection manager "FFCM"]: The file name ""C:ProjectsSSISHLoadTOutputOut.csv"" specified in the connection was not valid.
Error at Package: The result of the expression "@[User::CsvFullFileName]" on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property.
Here is what I am trying to do. I have a foreach loop that iterates through a list of xml config files and reads the config information including the destination csv file name and does a data transformation. So I created a flatfile connection to a csv file did my data mappings. Created a package level variable to hold the destination file path In the Flat file conn. manager's properties -> expression -> set the @[User::CsvFullFileName] (which even evaluates fine)
When I try to run the package I keep getting the above mentioned non-fatal error..I checked the path and it is valid. I even tried
the c:\projects\...notation and the UNC path notation...all seem to give the same error
Anyone experience this before ? any thoughts would be appreciated.