Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Tuesday, March 27, 2012

deleting parameters in report designer

i have create a paramenters and use in the sql, but after i deleting it from
the sql statement, i still need to enter the paramenter in the PREVIEW.
i have check and clear the parameters clicking the "..." button but when i
check the properties of a table and set the expression, the parameter appears
in the "parameter" column.
i dun know if it is a bug or not...but thats strange
thanks for helping in advancehi all,
mmm i have solved the problem by deleting the <reportparamenter> tag in the
*.rdl code.
dont know if this is the formal method.
anyway, just share with you all.
"Jasonymk" wrote:
> i have create a paramenters and use in the sql, but after i deleting it from
> the sql statement, i still need to enter the paramenter in the PREVIEW.
> i have check and clear the parameters clicking the "..." button but when i
> check the properties of a table and set the expression, the parameter appears
> in the "parameter" column.
> i dun know if it is a bug or not...but thats strange
> thanks for helping in advance
>|||http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_structure_data_v1_72uk.asp
"Although report parameters are created automatically from query parameters,
you manage report parameters separately in the report layout view. Also, if
you change the name of a query parameter, or delete a query parameter, the
report parameter that corresponds to the query parameter is not
automatically changed or deleted. You can remove the report parameter by
using the Report Parameters dialog box."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSUIREF/htm/f1_rsc_designer_v1_6h9v.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jasonymk" <Jasonymk@.discussions.microsoft.com> wrote in message
news:0B216069-4C8A-4404-AD60-D290AA1A0A8D@.microsoft.com...
>i have create a paramenters and use in the sql, but after i deleting it
>from
> the sql statement, i still need to enter the paramenter in the PREVIEW.
> i have check and clear the parameters clicking the "..." button but when i
> check the properties of a table and set the expression, the parameter
> appears
> in the "parameter" column.
> i dun know if it is a bug or not...but thats strange
> thanks for helping in advance
>|||In report layout, report menu, report parameters. Behind the scenes RS
creates the report parameters but they are two different things: the query
parameter and report parameter.
Bruce L-C
"Jasonymk" <Jasonymk@.discussions.microsoft.com> wrote in message
news:0B216069-4C8A-4404-AD60-D290AA1A0A8D@.microsoft.com...
> i have create a paramenters and use in the sql, but after i deleting it
from
> the sql statement, i still need to enter the paramenter in the PREVIEW.
> i have check and clear the parameters clicking the "..." button but when i
> check the properties of a table and set the expression, the parameter
appears
> in the "parameter" column.
> i dun know if it is a bug or not...but thats strange
> thanks for helping in advance
>

Deleting Parameter From Preview Pain

Product: Reporting Services 2005

Visual Studio 2005

I've added parameters to my query in the Data Tab. Then removed one. The preview pane still shows the deleted parameter even though it does not exist in my query. I've tried opening the dataset settings and re-adding the parameter, saving, then deleting. This ghost parameter will not disappear from the Preview Pane. Is this a bug or am I not deleting it correctly.

Thanks,

Matt

To solve your preview pane pain, you need to remove the parameter from the Report Parameters collection.

Select Report from the toolbar and Report Parameters. When you add a query parameter a Report Parameter is automatically created for you, but the same is not true when your remove query parameters.

-chris

Deleting Parameter Error

I have a report with 2 parameters, that are part of a hierarchy, that I want
to delete. I delete the query parameter via the designer and the query
mapping dialog and then the report parameters. When I build I get an error
saying the the query parameter I have deleted cannot find the the deleted
reporting parameter. In other situations this deletion seems to work - could
the hierarchy be a factor. This is SO frustrating. Can anyone point me in
the right direction or is it a bug. Regards, Chris.open up the file in XML and do a search on the deleted parameter name. that
will help you find where to look in the designer.
Basically there are three general places for parameters to live, in the
Report Parameters applet; Data Source -->parameters tab or Data Source Text
window depending on whether you are using a sproc or sql code; and in text
boxes in the layout, usually in the header section.
the easiest place to over look is the layout where sometimes parameters are
sometimes displayed or used as filters.
"Fresno Bob" wrote:
> I have a report with 2 parameters, that are part of a hierarchy, that I want
> to delete. I delete the query parameter via the designer and the query
> mapping dialog and then the report parameters. When I build I get an error
> saying the the query parameter I have deleted cannot find the the deleted
> reporting parameter. In other situations this deletion seems to work - could
> the hierarchy be a factor. This is SO frustrating. Can anyone point me in
> the right direction or is it a bug. Regards, Chris.
>
>|||I wouldn't know what to do with the report in XML format. I have looked in
there an I can see the parameter cropping as a query parameter in an
unrelated report parameter.
"Carl Henthorn" <CarlHenthorn@.discussions.microsoft.com> wrote in message
news:4EFB8F4F-0670-4898-B557-F1AB625CE083@.microsoft.com...
> open up the file in XML and do a search on the deleted parameter name.
> that
> will help you find where to look in the designer.
> Basically there are three general places for parameters to live, in the
> Report Parameters applet; Data Source -->parameters tab or Data Source
> Text
> window depending on whether you are using a sproc or sql code; and in text
> boxes in the layout, usually in the header section.
> the easiest place to over look is the layout where sometimes parameters
> are
> sometimes displayed or used as filters.
> "Fresno Bob" wrote:
>> I have a report with 2 parameters, that are part of a hierarchy, that I
>> want
>> to delete. I delete the query parameter via the designer and the query
>> mapping dialog and then the report parameters. When I build I get an
>> error
>> saying the the query parameter I have deleted cannot find the the deleted
>> reporting parameter. In other situations this deletion seems to work -
>> could
>> the hierarchy be a factor. This is SO frustrating. Can anyone point me in
>> the right direction or is it a bug. Regards, Chris.
>>

Wednesday, March 7, 2012

DeleteCommand, Stored Procedures, and ReturnValue Parameters = cant be done?

I've a SqlDataSource control that has stored procedures specified for each of its commands: SelectCommand, InsertCommand, UpdateCommand, DeleteCommand . And for Insert, Update and Delete, I've specified asp:parameters for each stored procedure's parameters. Now, my stored procedures all have return values, and I've successfully accessed the return values for Insert and Update, but for some reason, I'm getting very wrong results for Delete.
<DeleteParameters>
<asp:Parameter Name="result" Type="Int32" Direction="ReturnValue" />
<asp:Parameter Name="myID" Type="Int32" />
</DeleteParameters>

The moment I add my "result" with the direction ReturnValue, I instantly get a"Procedure or function <storedprocedurename> has too many arguments specified." error. I checked my SQL Profiler, and it seems that the page is passing result as an Input parameter, instead of keeping it as a ReturnValue! e.g.

exec spName @.myID=1,@.result=NULL

when it should be

exec spName @.myID=1

I get the correct behavior with Update and Insert, so I'm wondering whether if this is a bug or by-design behavior or something very screwy with my computer?

Help? Thoughts?

Hi there,

I hope you are using the "out" keyword for the parameter that needs to be passed out.

Why dont you specify the default value for the out parameter in the asp:Parameter list?

thanks,

Murthy here

|||

Do you mean the OUTPUT keyword for the stored procedures? I'm not using OUTPUT parameters, I'm looking for the ReturnValue. What I'm actually doing is trying to access the ReturnValue of the stored procedure, like below

create procedure spTest
@.myID int = 0As
'some sql statements herereturn 1GO

The value I am interested in is1.The problem, however, is that my parameter, even though it's specified as a ReturnValue, it seems to act as an Input value regardless. And it end up passing the parameter into the stored procedure when it's not supposed to at all.

However, if I'm misunderstanding your solution: where exactly should I be using this keyword?

|||

Ok are you running the stored procedure manually?

If yes, you can check the number of rows affected as:

int status=command1.ExecuteNonQuery().

and then if the status is -1 then no rows have been affected else count is greater than 0.

You do not have to explicitly add a return value to check the status of the stored procedure. Hope I am clear.\

thanks,

Murthy here

|||

No, I'm not running the stored procedure manually. Yes, I know I am able to get the status (although your example returns rows affected, right?) if I were. [The reason why I'm checking the returnvalue is because there are various reasons why the process may fail, and in each instance, I return a different value to depict it.]

My question/problem is that setting theReturnValue parameters for theSQLDataSource control'sDELETE command does NOT seem to work (although I feel it should); instead it seems to ignore the direction and sets it to Input. I'm half-convinced this is a bug-- so I've moved on to using ObjectDataSource instead.

|||

Whatever works for you,

Murthy here

|||

Hi Jnghh,

You may visit the link http://forums.asp.net/thread/1670367.aspx which has the solution to these similar problems.

Hope it helps.

Thanks.

Friday, February 17, 2012

Delete problem-too many parameters

I have a dataview control with the delete method pointing to a logical delete stored procedure in SQL SERVER Express. I am getting an error message saying too many parameters provided. I've check and there is one parameter expected and one passed in. This is my SP, the html, and the debug infor I'm looking at. Any ideas?

PROCEDUREdbo.usp_Drivers_Delete

@.mintDriver_IDint

AS

UPDATEtblDrivers

SETActive= 0

WHEREDriver_ID=@.mintDriver_ID

html:

<DeleteParameters>

<asp:ControlParameterControlID="GridView1"Name="mintDriver_ID"PropertyName="SelectedValue"

Type="Int32"/>

</DeleteParameters>

Debug:

?SqlDataSourceDrivers.DeleteParameters(0)

{System.Web.UI.WebControls.ControlParameter}

System.Web.UI.WebControls.ControlParameter: {System.Web.UI.WebControls.ControlParameter}

ConvertEmptyStringToNull: True

DefaultValue: Nothing

Direction: Input {1}

Name: "mintDriver_ID"

Size: 0

Type: Int32 {9}

?SqlDataSourceDrivers.DeleteParameters.Count

1

Error:

Exception Details:System.Data.SqlClient.SqlException: Procedure or function usp_Drivers_Delete has too many arguments specified.

Perhaps I'm missing something, but you don't really have a delete. You have an update that sets a status column (Active) to 0. I think if you try changing the <DeleteParameters> to <UpdateParameters> you should be fine.

Deb