Changing The DataSource At Runtime

Feb 21, 2007

I have to create a script for changing the datasource at runtime.

Here is my screnario, While development I am using Data source name called "DevDatasource1" and when I am deploying it to other evnironment the datasource name will change let us say "QADatasource".

I have to create a script for changing the datasource(i.e. DevDatasource1 to QADatasource). How I can achieve I this using the setItemdatasource?

View 5 Replies


ADVERTISEMENT

Deciding The Datasource Server At Runtime

Jan 29, 2008

Hi,
I want to read the database server name from config file at runtime and then pass on that to the datasource. I got an article on the MSDN stating the way it should be approached. But it doesn't seem to work.
Following is what I've done:
a.) Create a static datasource and dataset.
b.) Build a report based on the fields fetched from the stored procedure.
c.) Save the report.
d.) Change the datasource value to an expression: ="data source=" & Parameters!ServerName.Value & ";initial catalog=ReportTest"
e.) Deploy the report.

But when invoking the report from my aspx page, I receive an error
An error has occurred during report processing.

Query execution failed for data set 'TestDataSet'.


Incorrect syntax near 'usp_TestProcedure'.



Anybody who has implemented this or any idea what to do next?
TIA.

View 2 Replies View Related

Changing DataSource With C#

May 6, 2008

So I'm trying to run through a directory of reports and change the data source of every report from whatever it has now, to a shared data source. I'm using C#.

If I understand the process correctly, I want to .GetItemDataSources on the reports service and store it in an array of datasources. Then I want to Change the name and reference of the datasource to match something that I alredy have elsewhere. Here is the code...


foreach (CatalogItem item in _reportsService.ListChildren("/" + reportingServicesRoot, true))
{
if (item.Type == ItemTypeEnum.Report)
{
try
{
DataSource[] Sources = new DataSource[1];
Sources = _reportsService.GetItemDataSources(item.Path);
DataSourceDefinitionOrReference Reference = _reportsService.GetDataSourceContents(@"/Data Sources/" + reportingServicesRoot);

Sources[0].Item = Reference;
Sources[0].Name = reportingServicesRoot;

_reportsService.SetItemDataSources(item.Path, Sources);

}
catch (Exception ex)
{
DataSource[] s = _reportsService.GetItemDataSources(item.Path);
throw ex;
}
}
}


Here is the error I get....

System.Web.Services.Protocols.SoapException: The data source 'SummerOf70' cannot be found. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DataSourceNotFoundException: The data source 'SummerOf70' cannot be found. at Microsoft.ReportingServices.DataExtensions.DataSourceInfoCollection.CombineOnSetDataSources(DataSourceInfoCollection newDataSources) at Microsoft.ReportingServices.Library.SetItemDataSourcesAction.SetReportDataSources(CatalogItem item, DataSource[] dataSources) at Microsoft.ReportingServices.Library.SetItemDataSourcesAction.PerformActionNow() at Microsoft.ReportingServices.Library.RSSoapAction`1.Execute() at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.SetItemDataSources(String Item, DataSource[] DataSources) --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.SetItemDataSources(String Item, DataSource[] DataSources) at Microsoft.ReportingServices.WebServer.ReportingService2005.SetItemDataSources(String Item, DataSource[] DataSources)

I know the DataSource is there.

Am I going about this all wrong? Should I delete the datasource first and then create a new one?

I look forward to clarifying my poor grammar. Thanks in advance!

View 1 Replies View Related

Changing Variable Value At Runtime

Oct 19, 2007



Hi,
I am relatively new to SSIS.
Please advice me on how to change the value of a variable during runtime.
i.e. user should be able to key in the value.

Regards,
Jiju

View 3 Replies View Related

SMO : Changing A Linkedserver Datasource

May 31, 2007

Hi all,

I'm trying to change the datasource of a SQL Server LinkedServer using SMO

I've got the relevant linkedserver as an object, changed the DataSource property, and selected it again to confirm the change.
However, the change is lost as soon as the object is destroyed.
Looking at BoL I think I need to be using alter() method of the linkedserver class but I just get an error
Alter failed for LinkedServer '<servername>'.


any ideas how I should be using this class to do what I want?

I can post my script (PowerShell) if it would help.

Thanks, Robin.

View 2 Replies View Related

Changing The Connection String At Runtime? C# 2.0

Oct 24, 2007

How can i change the connection string at runtime?

Scenario is, I want my customer to enter server name, database name, and some parameters at the installation time then i will use these entries to build the connection string and persist it into the app.config.

also not only at installation time but also at runtime while the program is running. i wanna make these entries as options which can be modified at any time

so, How can i do that ?

Thanks in advance

View 5 Replies View Related

Changing SQL String Of A DataReader At Runtime

Apr 22, 2008



Hello

I am connecting to an Intersystems Cache' database and extracting data with a DataReader.

Does anyone have a suggestion or example on how to change the SQL String at runtime?

Everything I could find only dealt with setting the SQL String at design time.

View 10 Replies View Related

Changing XML Source To A Variable At Runtime

Apr 12, 2007

Hiya guys,



The question:

Can I design data flows with an XML Source pointing to file system xml files, and but run them against variables? I can see the properties at design time (Accessmode=0,1,2; XMLDataVar="User::XMLData), but the XMLSource object doesn't appear to have expressions enabled to change this at runtime, nor do these properties seem to be exposed to configurations.



The scenario:

I have a package that reads through (potentially thousands) of XML files, and having identified the embedded message "type", transforms them via XSLT to an easier XML format (XML Datasource can't cope well with multiple namespaces etc). Then send this the new file off to a type specific dataflow task to send contents to database.



For performance (and other) reasons I'd rather XSLT to a single shared variable and use this variable as the XML source in the data flows (Rather than writing out to the filesystem [via xslt] and immediately reading it back in each time [via datasource]).

But designing the data flow task using a variable as xml source is frustrating for a bunch of reasons - not the least being:

(a) The variable needs to be populated with sample xml data at design time. But this could only ever match one dataflow at a time (fine at run time, but painful at designtime - leading to validation errors popping up all around the place.)

Yes I could have a seperate variable for each xmlsource - but that just makes things more complicated up front and also leaves me with 20+ large, type specific, xml variables floating around at runtime of which only one is ever being used per import - which just doesn't feel right to me.



(b) populating the variable with sample xml at design time is painful due to it being a string - and not accepting hard returns etc that are in text files, design time changes etc)



Using a file XML source at design time is infinitely easier, when I get a design time change - I can just amend the XSLT and run the appropriate task to produce a sample XML file to design against.



Any ideas?

Ta.

Gus.

View 2 Replies View Related

Dynamically Changing Web Service Task Parameters At Runtime?...

Aug 15, 2005

Okay, this one might stump you guys.

View 3 Replies View Related

Changing Header Rows To Skip Property In Flat File Connection During Runtime

Dec 21, 2006

Hi all

I have a flat file.I am trying to set the value for the property "HeaderRowsToSkip" during runtime.I have set an expression for this in my "flat file connection manager". But this is not working.The connection manager is not able to take the value during runtime.

My expression is as follows:

DataRowsToSkip : @[user:: Var]

where "Var" is my variable which gets the value from the rowcount component and trying to set it back to the "HeaderRowsToskip" property.

I ve even tried setting the value to the "HeaderRowsToSkip" property in the expression builder.

Its not working....

Can anyone help me out in solving this????

Thanks in advance

Regards

Suganya

View 22 Replies View Related

How To Configure A Dataflow Task Having A Runtime Source Table Name And A Runtime Destination Table Name

Apr 18, 2008

Hi,

I am having a Data flow task in For each loop which will gets 100 sourcetable names and 100 target table names...

am having a simpleData flow task which trasferes from OLEDBSource to OLEDBDestination.
I am repeating the Dataflow task which transfers from sourcetablename extracted from for loop to a destination table var.

The problem am gettting is for the first table it is able to transfer correcly because I did mapping for those tables at design time...but for the next coming sourcetable-desttable (which r having different no of cols,datatypes) its giving Validation failed...and...needs to refresh metadata....

is there any way to refresh the metadata of Data flow task (I set the property of OLEDBSource validate external meta to false then also same error is coming)

Thanks
Radhika

View 4 Replies View Related

SQL Runtime

Nov 30, 2007

Is there an SQL db that can function as a runtime stand alone app, inconjunction with a VB interface?

View 8 Replies View Related

Runtime DLL

Sep 18, 2007

Hello. I am trying to write a VB.net application to call our SSIS packages. I have seen several tutorials, including this one:

http://msdn2.microsoft.com/en-us/library/ms190901.aspx

Which calls for me to import:
Microsoft.SqlServer.Dts.Runtime
However, I don't have this DST Runtime DLL installed on my machine. I have installed "everything" in SQL Server Developer Edition and Visual Studio. Any idea how I can get this?

Thanks,
Chris

View 5 Replies View Related

SQL DataSource

Mar 28, 2007

I working on a form using an SQL DataSource. I am going to add a where clause. In that where clause a value from a label will be passed from the user.
How do I pass to the HTML Source the label value from the where clause. The value can change from user to user.
Sample below:
SELECT [KeyRolesID], [KeyRolesDesc] FROM [KeyRoles] WHERE ([JobCodeFamily] = @JobCodeFamily).
I want to replace the @JobCodeFamily which is currently coded with a value from the Sql DataSource in the design form with a label value entered by the user.

View 2 Replies View Related

Wcf For Xml Datasource

Aug 28, 2006

Hi, guys

I used an exported wcf service as a web service, try to use it as the reporting datasource,

[OperationContract]

DataSet GetTestReportData();

the app.config in the service host:

<configuration>

<appSettings>

<add key="BaseReportingAddress" value="http://localhost:8999/ReportHandlerService"/>

</appSettings>

<system.serviceModel>

<services>

<service name="Reporting_Handler.ReportHandlerService">

<endpoint address="http://localhost:8999/ReportHandlerService"

binding="basicHttpBinding"

behaviorConfiguration="ReportingServiceBehavior"

contract="Reporting_Handler.IReportingHandler"/>

</service>

</services>



<behaviors>

<behavior name="ReportingServiceBehavior">

<metadataPublishing

enableGetWsdl="true"

enableMetadataExchange="true"

enableHelpPage="false">

</metadataPublishing>

</behavior>

</behaviors>

I set the datasource type as xml and the connection string to http://localhost:8999/ReportHandlerService, the query string for dataset is

<Query>
<SoapAction>
http://tempuri.org/IReportingHandler/GetTestString
</SoapAction>
<Method Namespace="http://tempuri.org/IReportingHandler/"
Name="GetTestString">
</Method>
</Query>

but it doesn't work, I tried use a pure asp.net web service and it works. can anyone help me to set the connecting string for datasource and query for dataset when it using wcf as the web service? Thanks in advance.



bruce



View 2 Replies View Related

What Is A Datasource Used For?

Mar 18, 2008

Hi All,

I have a question about the datasource that we create on the Report Manager. What is it used for? In the below connection string which is given in the "Connection String" text box of a datasource link:

"Data Source=ProdServer;Initial Catalog=Northwind"

What is this datasource used for? Is it used only to use the ReportServer database or even our queries incorporated in the RDL files will be run against this datasource? I think the latter should not happen because while creating RDL files also, we provide a connection string to run the stored procedures against that datasource.

Please let me know about the same.

Thanks a lot and let me know if the question is not clear.

Manoj Deshpande.


View 11 Replies View Related

Runtime Analysis

Jul 10, 2006

I just ran a testbed of 4 types of SQL queries:1. inline SQL with a StringBuilder2. managed sql3. SQL text processing (@SQL as varchar(5000); SET @SQL = 'SELECT ' + @var...)4. a regular sproc that has the columns and table name hard coded1,2, and 4 always end up at about the same time given the averages.3 is always at last 1.5 times slower, and usually closed to 2 times.1 and 2 both use StringBuilders, the code is a direct copy, and 3 is a copy as well.My managed SQL is:    [Microsoft.SqlServer.Server.SqlProcedure]    public static void usp_Items_Select_Managed(SqlString table, SqlString name,         SqlString value)    {        // sql          StringBuilder stringBuilder = new StringBuilder();        stringBuilder.AppendFormat(            "SELECT {0}.* FROM {0} WHERE {0}.{1} = {2}",            table,            col,            value            );        SqlConnection sqlConnection = new SqlConnection("context connection=true");        SqlCommand sqlCommand = new SqlCommand(stringBuilder.ToString(), sqlConnection);        sqlConnection.Open();        SqlContext.Pipe.Send(sqlCommand.ExecuteReader());        sqlConnection.Close();    }Is there anything wrong with my Managed SQL, or is this just the way that it is?Thanks

View 1 Replies View Related

DTS Runtime Error

May 2, 2001

I'm running a package on SQL Server 7, SP2 created in the same environment.
When running a package from DTS Designer, I get an execution status of "Error Occurred" in the Package Execution Status dialog on one of the data pump tasks I'm running along with the number of rows inserted. When I double-click on the task, I get the following message: " The Connection is currently being used by a task. The connection cannot be closed or reused".

Both the exception log for the task and the package, specified for error output, indicate the task ran successfully and the clients confirm that the appropriate number of rows have been inserted in the table. Has anyone encountered this error that can explain the cause/cure?

View 1 Replies View Related

Installshield And Sql Runtime

Jun 4, 2001

Hi,

When I'm using installshield to install sql runtime, I get the message "The Workstation service has not been started" during Configure SQL Server Agent. Does someone know what it means and how to solve it?


Thank you

View 1 Replies View Related

DTS Runtime Parameter

May 12, 2000

Hi Everyone,

I've an DTS package, which has an Execute SQL Task. I'm doing the operations based on a parameter. I need to pass that in runtime. Is there any way to do that in Execute SQL Task? BOL says that the runtime parameter can be set by giving a question mark(?). But when I tried this, it says, value not passed.


Thanks in advance.

View 1 Replies View Related

Database Runtime

Sep 4, 2007

I am Using Sql Server 2005 enterprise edition to develop an accounting system.
now i want to distribute this software to other cleints.
I have created a setup which includes all the components required for the run time of the software but i dont know how to include the sql server database in it.
as i know that i have created access based software i used to include the database file in the setup and it would work but in the case of sql server i dont know how to do it .
is there any runtime of sql server which needs to be downloaded or any other way out.

View 4 Replies View Related

Replace DB Name Runtime??

May 30, 2008

Hi.

I posted similar stuff in one of my previous topic. what i need to do is parse database name runtime
means sample example is

USE <%1>
GO
SELECT * FROM Table_Name


here instead of <%1> i need to pass Test DB name

USE Test
GO
SELECT * FROM Table_Name


my .sql file contains <%1> so i need to replace it

i tried like

declare @t varchar(50)
declare @chg22 varchar(500)

set @t = 'Test'
set @chg22 = 'USE <%1> GO'
set @chg22 = REPLACE(@chg22,'<%1>',@t)

exec(@chg22)
SELECT * FROM Table_Name

but i am not getting it..in above example i am just took one line select * from table_name but actually in .sql file more that 300 lines are there so i m not able to concatenate it..


T.I.A

View 4 Replies View Related

Overflow At Runtime

Nov 30, 2006

We run a regular query through Excel that is linked to a Microsoft SQL Server data source.

We have run this query routinely for the past few years. Suddenly this query has started returning an error message - “[Microsoft][ODBC SQL Server Driver] [SQL Server] Difference of two datetime columns caused overflow at runtime�. It seems to be a common error (as per Google search) however I don’t want to go messing around with something I don’t fully understand. Can anyone point me in the direction of what to look out for?

View 2 Replies View Related

Using The SQL Query At Runtime..

Mar 28, 2007

Hi,

Currently im using SQL queries in combination with ASP.NET..

I have currently only one table('Requests'), which has all the user info of name,id,studyrequested etc.. A person can request for any number of studies.

Now the prob is that from now on whenever a user requests for a new study not only should his details be stored in the Request table but also in a new Users table. In the Users table that particular users details must only be loaded once.. i.e. if the same user enrolls for another study his details should only be updated in the requests table and not in the Users table, since his details have already been loaded once in the Users Table..

While this works fine for new users, but what bout the old users already stored in the Requests table before the Users table existed.

Is there any way i could run a sql script only once at runtime, so that all the old legacy users are loaded once in to the Users Table.



Thanks,
Nitin

View 1 Replies View Related

INSER At Runtime?

Oct 2, 2006

Hi!Can anybody tell me what I'm missing here?I'm trying to insert a new record into a sql-database from code atruntime (not stored procedure),but get the following error message:"The 'strUn' is not permitted in this context.Only constants, expressions or variables allowed here.Column names are not permitted."//Create sql connectionSqlConnection con = new SqlConnection("server=LocalHost;database=Users;uid=geir;pwd=geir");//Open database connectioncon.Open();//Create variables to hold values from textboxesstring strUn = txtUsername.Text;string strPw = txtPassword.Text;//Create a sqlCommand to insert textbox values into sql-databaseSqlCommand sqlcmd = new SqlCommand();sqlcmd.CommandText = "INSERT INTO tblUsers(Username,Password)VALUES(strUn, strPw)";sqlcmd.Connection = con;try{sqlcmd.ExecuteNonQuery();}catch(SqlException ex){lblInfo.Text = "ExecuteNonQuery failed because: " +"" +ex.Message;}finally{con.Close();}

View 4 Replies View Related

SQL Server Runtime?

Feb 19, 2007

My boss claims that there is a free SQL server runtime. Is thistrue? I was only aware of MSDE. But I believe the connections arecapped at 5 in MSDE. If there is a free SQL server runtime, are thereany limitations to using it (performance, connection count)? Thanks.

View 2 Replies View Related

Can I Specify SubReport Name At Runtime?

Aug 4, 2006

I want to combine a bunch of reports (which are stand alone reports on there own) as subreports in a parent or master report. We have done this in Crystal Reprots in order to get a group of reports out in one file.

The issue with Reporting Services is the header and footers of the subreports are not rendered, so I have to repeat the logo information for each subreport in the body of the parent report. I can do this in a table or list or rectangle, but I have to do this for each subreport. Is there any way that I can specify the name of the subreport at runtime? That way I can put everything into a List and drive it from the database. I noticed that the dropdown to select the report name does not allow you to create an expression for this field.

View 3 Replies View Related

How Can I Get The Sql Statement Runtime?

Jan 25, 2008

is that have a function to get it?

View 3 Replies View Related

Runtime Parameters

Jan 19, 2006

Does anyone have an idea on how to handle runtime parameters for a package? Ideally I'd like to have the package prompt the user for a date range and then store the 2 dates in package variables for use later in the package.

View 1 Replies View Related

Set FontFamily Runtime

Mar 23, 2007

Hey Guyes,

I'm developing SSRS 2005 Reports in multi languages (i.e. regional language like hindi, marathi)

here i'm sending font name from database field with the help of expression in FontFamily Property of textbox as follows

FontFamily =IIF(Fields!DistrictNameRegional.Value<>Nothing,CStr(Fields!FontName.Value),"Tahoma")

It don't work.

But when i'm Writting like this

FontFamily =IIF(Fields!DistrictNameRegional.Value<>Nothing,"Shivaji01","Tahoma")

It works.

Plz tell me where I'm wrong with this.



View 4 Replies View Related

Modify Rdl During Runtime

May 8, 2007

Hi



I am trying to create a report with unknown number of report items. (as I dont know how many columns the stored proc is going to return).Is there a way to create these type of reports using SSRS other than creating the rdl programatically using vb.net or c#?



Let me know if I am not clear.



Thanks in advance.

View 1 Replies View Related

Runtime Destination.

Mar 31, 2008



Hi,
Is it possible to create Flat file as runtime destination ?

For Ex:
Data retriew from SQL Server, in the fly destination flat file need to create along with timestamp (abcyyyymmdd.txt).

Regards,

View 1 Replies View Related

Set Variable Value At Runtime

May 20, 2007

I'm trying to create a custom data flow transformation, I need to set the value of a user variable which will be used by a downstream component(for example: a data flow destination) at runtime, is this possible? If possible, in which method should I do that? Thanks.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved