Showing posts with label successfully. Show all posts
Showing posts with label successfully. Show all posts

Tuesday, March 20, 2012

Passing a variable between a parent and child package doesn't work

Has someone managed to pass successfully a variable from a parent package to a child package? I’ve tried a zillion permutations and I can’t get it to work. The strange thing was that I was able to successfully do this with pre-RTM builds. Basically, what I am trying to do is:

  1. The parent package has a variable, e.g. ExecutionID which I set using a script to System::ExecutionInstanceGUID. I verified that the variable is set correctly by dumping it to a SQL Server table.
  2. I created a child package variable with the same name.
  3. In the child package, I’ve created a parent package configuration that points to the ExecutionID variable.
  4. I am trying to read the variable in a Derived Column Task in which I have a column linked to @.ExecutionID.

This doesn’t work. Step-by-step instructions from someone who managed to concur this will be greatly appreciated.

Oh, I didn’t have any luck hitting a breakpoint in a script task inside a child package with both in and out of process execution also.

Never mind. My configuration got messed up. I am still not sure what needs to be done to debug a child packge though. Ideas?

Friday, March 9, 2012

Passing @UserName into Stored Procedure

I have successfully Create a Site, Inserting Updating andDeleting information in my DB all with Stored Procedures, But I need theability to pass their username into my Stored Procedures. How and where do Icode this in my ASPX file?

My SP would be something like this


Create procedure test

@.UserNamevarchar(50)

As

Select *

From table

Where username= @.username

All of thedata is tied to the user in one way or another but I do not know what code toput in my page?

If you can get correct username in your application, why not use SqlCommand?

using(SqlConnection conn= new SqlConnection(@."Data Source=.\iori2000;Integrated Security=SSPI;Database=master"))
{
SqlCommand cmd= new SqlCommand("test",conn);
conn.Open();
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@.username", username);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);

//add your code

}

|||

I do not know that I'm following.

Here is the Code I would like to put pull the username.

<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Style='position: relative'>
<Columns>
<asp:BoundField DataField="Task_Name" HeaderText="Task_Name" SortExpression="Task_Name" />
<asp:BoundField DataField="project_name" HeaderText="project_name" SortExpression="project_name" />
<asp:BoundField DataField="priority_desc" HeaderText="priority_desc" SortExpression="priority_desc" />
<asp:BoundField DataField="Assigned_to" HeaderText="Assigned_to" SortExpression="Assigned_to" />
<asp:BoundField DataField="status" HeaderText="status" SortExpression="status" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebAppConnectionString %>"
SelectCommand="task_summary_info" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</asp:Content>

Passing "hidden parameter" to Report via URL

Hi,

We are trying to pass a parameter ("hidden from user") to our report which we
access via an URL. Has anyone done this successfully? If so please outline the steps
and we'll be greatful forever!

Note: We have the latest Reporting Services software SP2 installed.
We have MS SQL Server Standard Edition - and thus do not have Report Manager on our server.

Any parameters passed using the GET method (parameters over the URL) will be visible to the user. One option you have is encrypting the value before sending it.
HTH|||Thanks for your reply - however we are not concerned with the URL line itself. The problem is that the
value never gets to the report and we get an error message about the parameter being 'read-only'.
If anyone has successfully passed an URL parameter to a report please document and share the steps! Many Thanks!
We have latest version of Reporting Services SP2, and MS SQL Server 2000 standard version.|||OK. Found the answer:
1) Make sure Reporting Services SP2 is installed.
2) Set up the report as if the user will be selecting /entering the parameter value.
3) Make sure the Report runs correctly.
4) Go back into the Report Designer and change the prompt string to one blank.
5) Test in designer (the parameter name will be used as a default prompt).
6) Deploy
7) Run report - passing parameter in the URL. This works, and you will not see a prompt.|||

Hi, I am facing the same problem. Can any one please provide me 'real' solution(code example) how to do it.

jrokita has tried to ans the Q but not enough support. The main Q was how to do it with URL. Not steps the way it will be done.

Thanks in advance.