Setting Expressions In Datareader's SQLCommand Property Dynamically

Sep 19, 2006

Hi all,

I have been playing with integration services for a few days and at the moment, its up there with my list of software that I find ......painful.

What I am trying to do is read different tables from my one SQL database, then populate my Access database with its data.

I have put a foreach loop which goes through a collection SQL statements that I have entered into it. It first assigns it to a string variable called tablenameVar which contain statements such as "Select * from Terminals". Then the datareader is supposed to execute it based on the connectstring which never changes, and the SQLCommand value which I passed using the variable @[User::tableName]. However when I try to run it, I'm getting this error.

TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at Data Flow Task [DTS.Pipeline]: "component "DataReader Source" (1)" failed validation and returned validation status "VS_NEEDSNEWMETADATA".

Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.

Error at Data Flow Task: There were errors during task validation.

(Microsoft.DataTransformationServices.VsIntegration)

------------------------------
BUTTONS:

OK
------------------------------


Does anyone have an idea of what I should do? or maybe a better way to do it? I appreciate you guys for taking a time to look at this.

Thanks,

Joseph

View 1 Replies


ADVERTISEMENT

Using Variable In DataReader's SqlCommand Text

Jan 17, 2007

I'm attempting to configure a DataReader's SqlCommand text to use a package-level variable and I'm having trouble. I've read about using the "sql command from variable" option but although I see that during the configuration of Ole DB source, I don't see the same option for DataReader source. Viewing the properties of the DataReader and selecting the SqlCommand property does have button to configure the value but only displays a string value editor window. (I was hoping for the expression editor.)

The configured connection to the DataReader uses the odbc Data Provider (under .Net providers). I'm connecting to mySql, if that matters.

What I'm looking to do is to use a variable in the where clause of the DataReader's SqlCommand. Any hints how to accomplish this or other ideas would be greatly appreciated.

Thanks

View 4 Replies View Related

Problem With Variable In DataReader SQLCommand

Nov 20, 2007

Hello,
I'm trying to set the SQLCommand of a DataReader with a string variable (at the DataFlow Task level), and I'm having some problems. The source is a DB2 table. The destination is an MS Excel file. Here is what I have:

1. A variable named SQLStatementDataFlow of type String. EvaluateAsExpression is set to True, and the SQL statement in the expression evaluates without a problem.
2. In the Expression property of the DataFlow Task, I have the [SqlCommand] property configured with the variable.

First, in the component properties of the DataReader, what kind of SQLCommand do I set up here if the DataFlow SQLCommand is configured to use a variable?

Thank you for your help!

cdun2

View 4 Replies View Related

Passing Parameter From SQL Task To DataReader SQLCommand

Aug 27, 2007

Hello,

Newbee here

64 bit SQL 2005 running on Windows Server 2003 X64

I have an exececute SQL task (in the control flow obviously)

SELECT MAX(last_update) AS OrdersLastUpdateFROM orders

This task executes successfully and I can see that my user variable called "User:tmOrdersLastUpdate" populates correctly in the "variables" pane.. ALL GOOD.

The next step of the Control flow is a dataflow task

Details

DataFlow Source = DataReader Source (MySQL .NET connector)
DataFlow Dest = local SQL Server OLE DB.

In the DataFlow Source the DataReader SQLCommand property is
Select * from orders where last_update >= @User:tmOrdersLastUpdate

I've tried every conceivable permutation and I can't get SSIS to itnerpret the variable as such...it always gets passed to the server as a literal.

How do I pass a user-defined global variable to the WHERE clause in a DataRader object?

Thanks

View 5 Replies View Related

DataReader With ODBC As Source Using A User Variable In The Sqlcommand

Nov 15, 2007

Does anyone know how I can use a user variable in a sqlcommand in a Datareader source with an ODBC connection as the source?
I am storing a date value in a user variable(Date) I fill with a SQL Task and then want to use the value in the sqlcommand I use in the Datareader Source. It won't let me use the @variablename in the sql command.
Can anyone help with some advice on how I can make this work?
Appreciate any help I can get.
Thank you

View 5 Replies View Related

Expressions And Datareader Source

Mar 12, 2007

Greetings my SSIS friends,

Apologies for asking a similar question again but I am still non the wiser with this problem!

Let me explain to you my situation and the method I've adopted to try and solve it.

I have some source data residing in a SQL Server 6.5 database. The source data consists of a single table. For this example I will assume that my table contains only 2 columns, an ID column called result_ID and a Result_Name.

The idea is to retrieve new data each time the package is run. We will know this because the result_IDs in the source table will be greater than the maximum result_ID in my destination table . The way the package should work is like this :

1) Retrieve maximum result_ID from destination table

2) retrieve data from source table where result_ID > maximum result_ID from destination table.



My package consists of a

1) SQL Query Task which retrieves the maximum result_ID and places it in a user variable (type Int32).

2) A Data flow task with a Datareader source adapter which uses an expression to retrieve the data. My expression looks like this : "select * from result where result_id > " + (dt_str, 10, 1252) @[User::max_result_id]

When I run my package the first time all the rows are retrieved (as my destination table is empty to begin with). BUT when I run it the second time the same thing happens again!! All rows are retrieved.

I placed a breakpoint at the point where the variable gets populated with the maximum result_ID and true enough, the variable gets populated with the correct result_ID BUT then that variable gets reset to 0 in my expression!



This problem is driving me crazy! Has anybody out there experienced this kind of problem before?! What are the ways to solve it?!

Thanks for your help in advance.

View 5 Replies View Related

What Property Should I Assign To My Sqlcommand ?

Apr 2, 2008

what property should i assign to myPuzzleCmd2 ? 
 
myConnection.Open()
 Dim myPuzzleCmd2 As New SqlCommand("GetRandomCode", myConnection)
 
myPuzzleCmd2.CommandType = CommandType.StoredProcedure
 Dim retLengthParam As New SqlParameter("@Length", SqlDbType.TinyInt, 6)
retLengthParam.Direction = ParameterDirection.Input
 
myPuzzleCmd2.Parameters.Add(retLengthParam)
 Dim retRandomCode As New SqlParameter("@RandomCode", SqlDbType.VarChar, 30)
 
retRandomCode.Direction = ParameterDirection.Output
 
myPuzzleCmd2.Parameters.Add(retRandomCode)
 
Try
 Dim reader As SqlDataReader = myPuzzleCmd2.ExecuteReader()
myPuzzleCmd.ExecuteNonQuery()Catch ex As Exception
 
myPuzzleCmd2 = Nothing
 Session.Remove("RandomCode")
 HttpContext.Current.Session("RandomCode") = myPuzzleCmd2("@RandomCode")        <  ---------       Over here
 Finally
myConnection.Close()
End Try

View 7 Replies View Related

SQLCommand's Transaction Property Goes Null On Failure

Sep 20, 2007

I've written some provider independent code that dynamically generates and loads DbCommands with data via Parameters and executes them within a transaction. Everything works fine until an exception occurs and then the DbCommand.Transaction property that was set goes to null,  effectively killing any chance of rolling back the transaction. I've noticed this only happens when the executed command is of type SqlCommand. The OracleCommand mainitains its link to the set transaction of failure. Upon further investigation, I found that this only occurs when parameters are used but not if I dynamically generate the insert statement as a string.. For instance:SqlConnection conn = new SqlConnection(connectionString);conn.Open();SqlTransaction transaction = conn.BeginTransaction();SqlCommand comm = new SqlCommand();comm.Connection = conn;comm.Transaction = transaction; command.commandText = "INSERT INTO Table1 Values (1, 2, 3)";command.ExecuteNonQuery(); If I execute that and it fails the command.Transaction property will remain set to transaction, but in this scenario: SqlConnection conn = new SqlConnection(connectionString);conn.Open();SqlTransaction transaction = conn.BeginTransaction();SqlCommand comm = new SqlCommand();comm.Connection = conn;comm.Transaction = transaction; comm.commandText = "INSERT INTO Table1 Values (@Col1,@Col2, @Col3)";comm.Parameters.add(new SqlParameter("@Col1", 1); comm.Parameters.add(new SqlParameter("@Col2", 2);comm.Parameters.add(new SqlParameter("@Col3", 3); comm.ExecuteNonQuery(); Upon failing the comm.Transaction property gets somehow goes null and the Connection property of the transaction object also goes null.Any ideas on why this only happens with a SqlCommand but no other DbCommand?      

View 4 Replies View Related

Property Expressions Editor

Oct 10, 2007

Hi,

I am trying to load some text files to a SQLServer database. My text files are going to have a name like orders_200709.txt. I am trying to use variables and expressions to evaluate the datepart, YYYYMM. The problem I am facing is with the 'Property Expressions Editor'. When I click on the ellipsis ..., I get the editor, but I am not able to add a new expression; not able to view properites etc. Everything is like in a Disable mode. Does anyone know the cause of this?


Thanks

View 7 Replies View Related

Access To The Property Values For My Expressions

Oct 2, 2006

I may be looking too hard for this but I can't find a way around it.

I have an Expression and in that expression, I want to access a property on the same object (it would be great to get the properties of other objects as well).

Example: I have a flat file connection where I defined the name of the flat file in my ConnectionString. I also have a variable that I have it linked to my dtsConfig which points to the proper folder name at run time.

How can I create an expression similar to this:

@[User::strFolder] + @[Connectionstring]

where @[User::strFolder] is my variable and points to the correct folder for the given server the package is running on and @[Conenctionstring] is my made up name to access the VALUE of the Connectionstring that I have for this flat file.

So if I have the following:

in my connectionstring property: flatfile.txt

in my strFolder derived from dtsConfig at runtime: E:etl_data

I would like my final connectionstring to look as follow:

E:etl_dataflatfile.txt

So far I know I can do it with two variables but it would be great if I could reuse the property values of the current object for my expressions or any other object.

Perhaps this value is available thru the script where I can access "any" property in my dtsx and store it into another variable and then use it. This option at least allows me to reuse code instead of hardcoding table name (connectionstring) into my variables.

Did I make this too difficult and there is a simple way to access an object's property inside the expression builder?



Thanks

Anatole

View 4 Replies View Related

Setting Expressions In DtsConfig

Jun 12, 2007

Hi, i'm new in this forum and in SSIS, so I apologize if mine is a stupid question and also for my english.

I have this problem: i have to develop an ETL package and i have to set the transformation between input and output columns using a configuration file, i.e. my client want to change the transformation simply modifying a config file( for example from UPPER to LOWER ).

I tried using dtsconfig and setting EvaluateAsExpression with value 1( true ) and Expression UPPER[Column 2] but i get an error saying that Column 2 is not a variable.

There is a way to do it?

I don't know if i explained the problem well.

Thanks in advance

View 6 Replies View Related

Transact SQL :: GROUP Dynamically Generated Date And String Expressions

May 17, 2015

I have below SQL. When I run it I get the 'Each GROUP BY expression must contain at least one column that is not an outer reference' error. The date and string expressions are generated dynamically and need to be grouped upon if possible. What am I missing?

INSERT INTO tblStaffPayrollHistory (StaffID, FromDate, ToDate, PayrollNo, EventID)
SELECT DISTINCT tblStaffBookings.StaffID, CONVERT(DATETIME, '2015-05-17', 102), CONVERT(DATETIME, '2015-05-17', 102), 'tree', tblEvents.ID
FROM tblStaffBookings INNER JOIN tblEvents ON tblStaffBookings.EventID = tblEvents.ID
WHERE ...
GROUP BY tblStaffBookings.StaffID, CONVERT(DATETIME, '2015-05-17', 102), CONVERT(DATETIME, '2015-05-17', 102), 'tree', tblEvents.ID

View 2 Replies View Related

Dynamically Change The SelectCommand Property

Nov 8, 2007

Hello
I have a gridview that I use on a products page, my problems is certain products have different attributes that I would like to display.
Therefore what I would like to do is change the SelectCommand property to my SQLDatasource depending on the querystring that is passed.
For instance in my page load event I would have a CASE statement with numerous SQLString Variables.
Here is the current coding for my datasource
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT PS.ProductSizeMM AS [Coupling Size], PS.ProductWallThickness AS [To Suit], PS.Cost AS [Price], PS.Sold_By AS [Sold by] FROM tblProduct AS P INNER JOIN tblProductSize AS PS ON P.ProductCode = PS.ProductCode WHERE (P.ProductDescription = @ProductDescription) ORDER BY PS.Sorter">
<SelectParameters>
     <asp:QueryStringParameter Name="ProductDescription" QueryStringField="ProductDescription" />
</SelectParameters>
</asp:SqlDataSource>I have tried declaring a string variable in my page load event (SQLString) then setting the
SelectCommand="SQLString" but this causes a syntax error
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'SQLString'.
Any help would be greatly appreicated!!

View 3 Replies View Related

Using Disable Property For Data Flow Task Dynamically ?

Mar 18, 2008

hello guys,

I am having trouble with using disable property in the expression for data flow task. Here is the issue as explained below-

lets say i have 3 tables TableA, TableB, TableC from which i need to export data. So i create a table (TableList) where I save these table names and a unique id to these tables. e.g.

TableList will have-
TableName TableID
TableA 1
TableB 2
TableC 3


in the ssis package select these tableNames & Ids from tableList in Execute SQL Task. And assign the result set to a variable object (@TableList.

Then i use For Each Loop Container (For Each ADO Enumerator) , to loop through these tablesnames & iDs

Inside this loop container, i define three data flow tasks one for each table. So i have DataFlowTaskA (For TableA), DataFlowTaskB(For TableB), DataFlowTaskC (For TableC).

Now for a given table selected in the iteration, only the corresponding DataFlow Task should be exeuted. e.g. For the 1st iteration, if TableA is selected then only DataFlowTaskA should be executed and DataFlowTaskB& C should be skipped.

In order to achieve this, I am using a 3 variable @FlagA, @FlagB, @FlagC (type Boolean) one for each Table. and use the value of these flags for the "Disable" property of the data flow task (so @FlagA will be used for Disable property in the Expression for Data FlowTaskA, and so on..)

SotThe First Step inside the Loop, I use Script Task. (Input for the script task: read variable is @TableID and Read/Write varaibles are these 3 flags)

In this script task, I initialize these flags to true or false appropriately. So this is what i do


If (Dts.Variables("TableID").Value.ToString = "1") Then
Dts.Variables("@FlagA").Value = False
Else
Dts.Variables("@FlagA").Value = True

End If


If (Dts.Variables("TableID").Value.ToString = "2") Then
Dts.Variables("@FlagB").Value = False
Else
Dts.Variables("@FlagB").Value = True

End If


So in the 1st iteration, (if TableA comes) @FlagA=False and B&C will be True.
So the Disable property for DataFlowTask will be set false and for others it will be set to True. Thus, only DataFlowTaskA will be executed.

And this action should be repeated for each input table. this is the logic.



However only for the 1st iteration(say TableA is selected) it behaves as above. i.e. DataFlowTaskA is executed and DataFlowTaskB & C are skipped. But in the 2nd iteration(say TableB is selected) , it again executes DataFlowTaskA and doesnt exeute B & C (where it should have executed B & skipped A&C).

I do set daelay validation to true for all these but it still it doesnt working as expected. Even I checked the values for all the flags for each iteration and they seem to get the correct values. But somehow Diable propery in the expression not behaving as it should.

Am i missing anything. Do i need to set any other property to make this work.


I apprecite any help.

Thanks

View 3 Replies View Related

Send Mail Task Not Updating The ToLine Property Dynamically

Sep 19, 2007

Hi,

I am facing a very strange issue with the Send Mail Task:
I am fetching the recipient from a Recordset and storing it in a variable (MailList).

Now, I modify the Send Mail Task to include an Expression which updates the "ToLine" property with the email address in the "MailList" variable.

Moreover, I am not hard-coding the "To" property in the "Mail" tab of "Send Mail Task Editor" and leaving it blank. Now, it does not allow me to execute the package and gives me a "Package Validation Error" saying: No recipient is specified.

Any solutions?

Thanks in advance.
Regards,
B@ns

View 5 Replies View Related

Setting Property Of Text Box For TextDecoration

Oct 8, 2007

Hi,

I am using SSRS where I came across one text box what I want from it is..its string is "Employee Name" but I want that in format like "Employee Name"

What property i need to set for TextDecoration

Please help me

T.I.A

View 3 Replies View Related

Setting Provider-specific Property

Feb 1, 2007

Hi,
How can I set the provider-specific property? Please let me know whether my code is correct.

For example, I want set provider-specific property set DBPROPSET_SQLSERVERDATASOURCE for memory based bulk copy operation. //Initialize the COM library.
...

//Obtain access to the SQL Native Client OLE DB provider.
hr = CoCreateInstance(...);

InitProperties[0].dwPropertyID = DBPROP_INIT_DATASOURCE;
... InitProperties[1].dwPropertyID = DBPROP_INIT_CATALOG;
...

InitProperties[2].dwPropertyID = DBPROP_AUTH_INTEGRATED;
...



InitProperties[3].dwPropertyID = DBPROP_AUTH_PASSWORD;
...

rgInitPropSet[0].guidPropertySet = DBPROPSET_DBINIT;
rgInitPropSet[0].cProperties = 4;
rgInitPropSet[0].rgProperties = InitProperties;

hr = pIDBInitialize->QueryInterface(IID_IDBProperties,
(void **)&pIDBProperties);
hr = pIDBProperties->SetProperties(1, rgInitPropSet); pIDBProperties->Initialize();
// set provider-specific property
DBPROPSET DbPropSetFL[1];
DBPROP DbPropFL[1]; DbPropFL[0].dwPropertyID = SSPROP_ENABLEFASTLOAD;
DbPropFL[0].vValue.vt = VT_BOOL;
DbPropFL[0].vValue.boolVal = VARIANT_TRUE;
DbPropFL[0].dwOptions = DBPROPOPTIONS_REQUIRED;
DbPropFL[0].colid = DB_NULLID; DbPropSetFL[0].guidPropertySet = DBPROPSET_SQLSERVERDATASOURCE;
DbPropSetFL[0].cProperties = 1;
DbPropSetFL[0].rgProperties = DbPropFL; IDBProperties* pIDBPropertiesFL = NULL;
hr = pIDBInitialize->QueryInterface(IID_IDBProperties,(void **)&pIDBPropertiesFL);
hr = pIDBPropertiesFL->SetProperties(1, DbPropSetFL);
hr = pIDBPropertiesFL->Release();************************************************************
and,in SQL Server 2005 BOL,it mentioned
(ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.ko/dataacc9/html/6e14fefc-4e0b-4847-a833-4cf0abe65d50.htm)Description: To bulk copy,
SSPROP_ENABLEFASTLOAD property is set to VARIANT_TRUE.
With this property set on the data source,
the newly created session allows consumer access
to the IRowsetFastLoad interface.If the property is set to VARIANT_FALSE,
IRowsetFastLoad interface is available through
IOpenRowset::OpenRowset by requesting the
IID_IRowsetFastLoad interface
or by setting SSPROP_IRowsetFastLoad to VARIANT_TRUE.Are there any one who provide a sample of above red-mark's not blues?

View 1 Replies View Related

Setting Field Description Property...

May 19, 2008

I'm selectively migrating a load of data from one database to another and would like to be able to get & set a table fields Description property (as seen on the Design window under Column Properties) programmatically. I'm having a spot of bother in actually finding how to do it - anyone know?

Ta,

Rob


P.S. Just thought I'd mention - I do know about sp_addextendedproperty, and while I will use that if I have to, it would be nice to be able to use the existing column property Description so that when editing, the user can see the value.

View 2 Replies View Related

Programaticly Setting The Value Of A Select Query Property.

Dec 1, 2005

I have a query in which I'd like to use the username of the user currently logged in.  The expression im using to retrieve the username is: Membership.GetUser().UserName.  Currently I have the following:    <asp:SqlDataSource ID="ProjectSource" runat="server" ConnectionString="<%$ ConnectionStrings:Code %>"        ProviderName="<%$ ConnectionStrings:Code.ProviderName %>" SelectCommand="Select Name, Namespace from Project where User = $Username">        <SelectParameters>            <asp:Parameter DefaultValue="" Name="$Username" />        </SelectParameters>    </asp:SqlDataSource>    <asp:GridView ID="GridView1" runat="server" DataSourceID="ProjectSource" />I'd somehow like to set up $Username to be equivlent to Membership.GetUser().UserName.

View 2 Replies View Related

Setting The Report Language Property Programatically

May 16, 2006

Hi,

I want to set the language property of a report programatically. I get the language locale at runtime and once I get it, I need to go to all the reports which are published or still are on the local system (in rdl format) and set the language property on each of the reports.

Thanks,

View 6 Replies View Related

Setting The Column Property Description With A SQL Function Call

Feb 2, 2008

I am trying to figure out how to set the Description of a Column in my database table by making a SQL function call. I know that I can go into Microsoft Studio Express and type in each desciption for each column. I just have about 1000 variables and each variable's description is in an Excel spreadsheet. I want to be able to build SQL code that will set each of the 1000 variables own description.

Thanks for any help.

Wesley Marshall

View 4 Replies View Related

The Best Overloaded Method Match For 'System.Data.SqlClient.SqlCommand.SqlCommand Error

Sep 21, 2006

Hi,I'm new to ASP.NET, and am currently looking into XML.I'm trying to write XML using data from an SQL Server 2000 table.  But I seem to be getting the following error regarding the SQL Server connection:Compiler Error Message: CS1502: The best overloaded method match for 'System.Data.SqlClient.SqlCommand.SqlCommand(string, System.Data.SqlClient.SqlConnection)' has some invalid argumentsSource Error:Line 23: {
Line 24: SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter();
Line 25: mySqlDataAdapter.SelectCommand = new SqlCommand(queryString, connString);
Line 26: mySqlDataAdapter.Fill(myDataSet);
Line 27: return myDataSet;Source File: c:InetpubwwwrootmappingcreateGeoRSSFile.aspx.cs    Line: 25 This is my code:using System;
using System.Data;
using System.Data.SqlClient ;
using System.Configuration;
using System.Collections;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;

public partial class createGeoRSSFile : System.Web.UI.Page
{
protected void Page_Load(object sender, DataSet myDataSet, EventArgs e)
{
string connString = "server=SQLSERV1;database=Historical_Statistics;UID=dbuser;PWD=Password";
string queryString = "SELECT Town, PostCode, Latitude, Longitude FROM UKPostCodes";

using (SqlConnection mySqlConnection = new SqlConnection(connString))
{
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter();
mySqlDataAdapter.SelectCommand = new SqlCommand(queryString, connString);
mySqlDataAdapter.Fill(myDataSet);
return myDataSet;
}

// Create a new XmlTextWriter instance
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.Unicode);

// Start writing!
writer.WriteStartDocument();
writer.WriteStartElement("item");

// Creating the <town> element
writer.WriteStartElement("town");
writer.WriteElementString("PostCode",myDataSet .Tables[1].Columns("PostCode"));
writer.WriteElementString("geo:lat",myDataSet.Tables[1].Columns("Latitude"));
writer.WriteElementString("geo:lon", myDataSet.Tables[1].Columns("Longitude"));
writer.WriteEndElement();

writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
writer.Close();

}
}What seems to be causing this error?Thanks. 

View 4 Replies View Related

Getting Error When Setting Parameters Dynamically

Feb 5, 2008

Hi All,

I am creating the report and setting the datasource(dataset) dynamically to the report. I want to set the parameters also dynamically. am using Report Viewer to process the report.


When i set the parameters locally, i am getting the below error:
An error occurred during local report processing


Here is my code:
da = new SqlDataAdapter(strqry, conn);
ds = new DataSet();
da.Fill(ds);

ReportDataSource ReportDataSourceX = new ReportDataSource();
ReportDataSourceX.Value = ds.Tables[0];
ReportParameter[] parm = new ReportParameter[2];

parm[0] = new ReportParameter("Business_Function", "SQMO");
parm[1] = new ReportParameter("Application", "ETMRS");
parm[0] = new ReportParameter("Owner", "Subbu");
//parm[0] = new ReportParameter("Business_Function", ds.Tables[0].Columns["Business_Function"].ToString());
//parm[1] = new ReportParameter("Application", ds.Tables[0].Columns["Application"].ToString());
//parm[0] = new ReportParameter("Owner", ds.Tables[0].Columns["Owner"].ToString());

RptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;

RptViewer.LocalReport.ReportPath = "C:\ETMRS Reporting\ETMRS Reports\ETMRS Reports\PlannedTestCasesSummary.rdl";
//RptViewer.LocalReport.SetParameters(parm);

RptViewer.LocalReport.DataSources.Add(ReportDataSourceX);
RptViewer.LocalReport.SetParameters(parm);
RptViewer.LocalReport.Refresh();


Can anyone please help me in resloving this issue.

Thanks in advance,
SR.

View 9 Replies View Related

Setting DTS Connction Object Dynamically

May 12, 2006

Hi:

I have posted concerning this-I don't mean to double post but I have
isolated the problem and have new information. (and I'm desperate!!) Please direct me to a DTS forum if this is not the place for this, I didn't see one.

I am trying set the data connection object (ODBC to Sybase) twice in
the same package but the Data Pump Tasks that use this connection don't
seem to be using the new setting in the connection after the second
time it is set, although at the end of the package I can see that the
connection has been set. The pumps just use the original connection a
second time instead of using the 2nd connection.

Here is the progress:
1. SQL Task1: Gets server information from a SQL Server table, and sets
it to a recordset global variable in the DTS.
2. ActiveX Task1: Begins loop, and sets the connection to server2 and
sets sql of datapump tasks
3. Several data pumps run.
4. ActiveX Task2: just loops around to ActiveX Task1
5. ActiveX Task1: Sets the connection object to server2 (msgbox tells
me this happens successfully)
6. The datapumps continue to use server2(??)
7. Package finishes succesfully
8. I right click on first datapump and do a "execute task". It executes
using server2, which for some reason it did not do during execution of
the entire package.

The loops works fine (as I have gotten it from you Allan), it clearly
goes through twice when I have specified two servers (I can see the
data in the resulting table is doubled from the source server, and I
can see it in the progress window going through the data pump steps
twice). After, if I run the data pump tasks by right clicking and doing
an "execute task" then it works using server2 was set.

I put a msgbox in the ActiveX Task1 to confirm the server is being set
correctly.

Any ideas here? Is there some other property I need to set? Is it a
setting with the Data Pump task? This all seems very weird-I feel like
I must be missing something obvious.

Here is the part of the code of ActiveX Task 1 (only part) that sets
the connection (let me know if you want to see the package):

Dim pkg
Dim SCCScon
Dim objRS
Dim SQLStatement

set pkg = DTSGlobalVariables.Parent
set SCCScon = pkg.Connections("Connection_Name")

set stpEnterLoop = pkg.Steps("DTSStep_DTSDataPumpTask_1")
set stpFinished = pkg.Steps("DTSStep_DTSActiveScriptTask_5")

Set objRS = DTSGlobalVariables("gvDataSources").Value

stpFinished.DisableStep = true
stpEnterLoop.DisableStep = false
stpEnterLoop.ExecutionStatus = DTSStepExecStat_Waiting

msgbox "DSN is now: " & SCCScon.DataSource

SCCScon.DataSource = objRS.Fields(1)
SCCScon.UserID = objRS.Fields(2)
SCCScon.Password = objRS.Fields(3)

msgbox "Now I've set the DSN and it is now: " & SCCScon.DataSource

_____________________________________________
Thanks as always,
Kayda

View 1 Replies View Related

Dynamically Setting A Checkpoint Filename

Mar 14, 2008

I am trying to dynamically set the name of a checkpoint file and I have used expressions in the package property and evaluated the following expression correctly


Expression: "C:\CheckPoints\" + "CheckPointFile_ "+ @[User:BName]" + ".xml"

Evaluates as: C:CheckpointsCheckPointFile_@[User:BName].xml

when I try to save the package, it comes up with an error saying

Error at Caller Package: the filename is not valid. the filename is a device or contains invalid characters.

Anyone know why?

View 4 Replies View Related

Setting User Variable Dynamically

May 24, 2007

Hi,

I have a package that uses a variable string (in date format) to execute a package.

I want to modify that variable in such a way that if no value is set for that variable then use system date else use date in varaiable.



Can someone help me out in this.. I know it has something to do with the expression builder but donn know how to do it.



Cheers

View 5 Replies View Related

Integration Services :: Setting Delay Validation Property To True In SSIS?

May 19, 2015

I have a main package calling another package through the Execute Package task.

The main package is passing the Job Instance id as a parameter to the other package.

When i execute the Execute Package task the concerned package is not showing any execution progress.However when i set the Delay validation Property to True , I saw that the package executed instantly and the desired result was obtained.

I am not sure how the Delay Validation property worked for the cause , as in my package I had no scenario of a temp table being called or any other temporary variables being used which needed a Delay Validation.

View 7 Replies View Related

SqlDataSource SelectCommand - Dynamically Setting The Name Of The Table?

May 7, 2007

Can you dynamically set the name of the table in the SelectCommand section of the SqlDataSource? (If it is relevant, I code in C#)
 For example,
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:Test-MySQL %>" ProviderName="<%$ ConnectionStrings:Test-MySQL.ProviderName %>" SelectCommand="SELECT * FROM TestTable">
I would like to replace 'TestTable' with the name of a table that is extracted from a string array in the code-behind.
Appreciatively,Peter

View 4 Replies View Related

Setting Default Value Of A Report Parameter Dynamically

Jan 26, 2007

Hi all,

Does sombody have experience on dynamically set or change the default value of a report parameter?

Assuming: report parameters p1, p2, p3, p4 have been set up(and have their default value 'all') with the creation of the report1; report browseing is through reportviewer that embedded in the web application; datasource is datacube

What I want to do: based on the login user of the my web application, set default value of p1 as the user's username.

What I did is:

Microsoft.Reporting.WebForms.ReportParameter reportParam = new Microsoft.Reporting.WebForms.ReportParameter("P1","Mary");

ReportViewer1.ServerReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter []{ reportParam });

what I got when reveiw the report:

P1 has no default value, and p2, p3, p4 greyed and could not choose value from them.

Any idea and suggestion will be pre-appreciated!

Jone

View 1 Replies View Related

Setting Child Package Inner Variables Dynamically

Oct 19, 2006

Hi,

I am trying to execute a DTS on sql server 2000 using the "Execute DTS 2000 Package Task".

I can see the inner variables and when I set the values everything works fine.

Now I want to pass the values dynamically. How can I achieve this?

Many thanks

View 9 Replies View Related

Setting SqlDataSource Update Command And Parameters Dynamically C#

Aug 31, 2007

Hello all,
Ok, I finally got my SqlDataSource working with Oracle once I found out what Oracle was looking for. My next hurdle is to try and set the Update Command and Parameters dynamically from a variable or radiobutton list. What I'm trying to accomplish is creating a hardware database for our computers by querying WMI and sending the info to textboxes for insertion and updating. I got that part all working nicely. Now I want to send the Computer name info to a different table column depending on if it is a laptop or desktop. I have been tossing around 2 ideas. A radiobutton list to select what it is and change the SQL parameters or do it by computer name since we have a unique identifier as the first letter ("W" for workstation, "L" for Laptop). I'm not sure what would be easiest but I'm still stuck on how this can be done. I posted this same question in here a few days ago, but I didn't have my SqlDataSources setup like I do now, I was using Dreamweaver 8, it is now ported to VS 2005. Below is my code, in bold is what I think needs to be changed dynamically, basically i need to change DESKTOP to LAPTOP...Thanks for all the help I've gotten from this forum already, I'm very new to ASP.NET and I couldn't do this without all the help. Thanks again!
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CAT %>"ProviderName="<%$ ConnectionStrings:CAT.ProviderName %>" SelectCommand='SELECT * FROM "COMPUTER"' UpdateCommand="UPDATE COMPUTER SET DESKTOP = :DESKTOP, TECH = :TECH, SERVICE_TAG = :SERVICE_TAG WHERE USERNAME=:USERNAME">
<UpdateParameters>
<asp:ControlParameter Name="USERNAME" ControlId="txtUserName" PropertyName="Text"/>
<asp:ControlParameter Name="SERVICE_TAG" ControlId="txtServiceTag" PropertyName="Text"/>
<asp:ControlParameter Name="TECH" ControlId="txtTech" PropertyName="Text"/>
<asp:ControlParameter Name="DESKTOP" ControlId="txtComputerName" PropertyName="Text"/>
</UpdateParameters>
</asp:SqlDataSource>

View 1 Replies View Related

Dynamically Setting Connection String Depending On Server_name?

Apr 18, 2008

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

View 8 Replies View Related

Setting Prompt Text For Report Parameters Dynamically

Oct 31, 2007



Hi all
I hope someone can help me on this issue:
I am designing dynamical reports, that are abel to run in four different languages - so far everything works just fine for me (I select my headers and labels from a database). Only problem is the prompt text for report parameters. How can I set this text dynamically?

E.g. I have a parameter where the user selects a storage - this prompt should be "Storage: " in the English report and "Lager: " in the Danish report. I have absolutely no idea how to fix this.

I am greatful for any help.

View 6 Replies View Related







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