.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Passing multi values to another multi value parameter

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :Sql Server
Hi, my requirement is as follows I have a parameter1 in which i populate values from database. the user can select multiple values from parameter1. after the parameter1 i have another parameter2 which is also mutliselection value. i,e depending on the selection of parameter i need to populate remaining values in Parameter2 (which is also a multi selection value). i have splited the values from parameter1 and passed the value of parameter1 (parameter1.value) to parameter2. but i am getting the following error An expression of non-boolean type specified in a context where condition is expected, near ',' incorrect syntax near the keyword 'ELSE' can anyone help me in this Thanks, Rajesh Peethala

View Complete Post

More Related Resource Links

multi-valued parameter

I need to do something like this: DECLARE @SalespersonCode SET  @SalespersonCode = '''smith'' + ',' + ''jones'''@SalespersonCode = '''SMITH'',''JONES'',''ADAMS''' SELECT * FROM Salesperson WHERE SalespersonCode in (@SalespersonCode) but I cannot get any results to return.  Is there a way to put multiple parameters in a single variable to use with in IN statement? John Schroeder* FROM Salesperson@Salesperson Varchar(100)

problem with passing parameter values to stored proceedure from asp.net c#

hi all, i am facing a problem while passing parameters to a stored proceedure. following is my sql query written for creating this stored procedure:   CREATE proc [dbo].[getstudent]( @wherecolumn nvarchar(2000), @wherevalue nvarchar(2000)) asbegin  declare @sql nvarchar(max) set @sql = 'select * from student2 where ' + @wherecolumn+'='+@wherevalueexec sp_Executesql @sql end   my table contains four columns: And the sql Query For the table is as follows:   CREATE TABLE [dbo].[student2]( [name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [rollno] [int] NOT NULL, [class] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [section] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, CONSTRAINT [PK_student2] PRIMARY KEY CLUSTERED ( [rollno] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]   from page behind I am passing the values to parameter as follows:   SqlCommand command = new SqlCommand("getstudent", c.con); SqlDataAdapter datadapter = new SqlDataAdapter(c.cmd); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@wherecolumn", SqlDbType.NVarChar).Value = "rollno"; command.Parameters.Add("@wherevalue", Sq

Having problem accessing multi-choice parameter in SQL Query in Report.

Hi, I have a report with a multi-choice input parameter. My report contains a dataset that uses CHARINDEX on this multichoice parameter. The dataset query is in text, not in stored procedure. When I run the report I get "the charindex requires 2-3 arguments the reason being that the SQL is run as follows (You can see the multi-choice list screws up the string: exec sp_executesql N'Select test.Region [Region], test.Location [Location], nvarchar3 [Year], nvarchar4 [StatisticType], nvarchar5 [StatisticType2], ntext2 [Detail], float1 [Amount]   from [WSS_Content].[dbo].[AllUserData] UD   inner join [WSS_Content].[dbo].[AllLists] AL on AL.tp_ID = UD.tp_ListId and AL.tp_Title=''Statistics''   left outer join   (       Select UD.tp_id [ID],nvarchar1 [Region],     nvarchar3 [Location]   from [WSS_Content].[dbo].[AllUserData] UD   inner join [WSS_Content].[dbo].[AllLists] AL on AL.tp_ID = UD.tp_ListID and AL.tp_Title=''Regions''   where UD.tp_ListId = AL.tp_ID   and UD.tp_ListId = AL.tp_ID   and UD.tp_DeleteTransactionId = 0x0   and tp_IsCurrentVersion = 1   ) test on test.id = UD.int1   where UD.tp_ListId = AL.tp_ID   and UD.tp_ListId = AL.tp_ID   and UD.tp_DeleteTransactionId = 0x0   and tp_IsCurrentVersion = 1  &n

NULL label doesn't appear on drop down or multi-select parameter.

Hi, I am using SSRS 2005 SP3. I have the following query that I use for my parameter: SELECT 0 AS c1, 'NOT Specified' AS c2 UNION SELECT 1 AS c1, NULL AS c2 UNION SELECT 2 AS c1, 'Test 1' AS c2 UNION SELECT 3 AS c1, 'Test 2' AS c2 Let's call my parameter prm1. The type of prm1 is string and it has "Allow null value" and "Allow blank value" options ticked. C1 is the value field and C2 is the label field for prm1. When I preview the report, and I didn't see NULL in my drop down list,  but that record has been shown as 1 (which is the value). I am wondering if this is a normal behavior of SSRS? It's not a big deal. I can replace NULL with something else, but I am just curious. Cheers, Uzzie

ReportViewer 2008 multi-select parameter alignment

We are using SSRS 2008 SP1 & ReportViewer 2008 SP1. The multi-select parameter options are left aligned in the drop-down listbox on the Report Server but when run thru ASP.Net & reportViewer, they are aligned in the center of the drop-down list. This is very problematic because the width of the drop-down is also narrow compared to the text size of the fields. I tried wrapping the ReportViewer in a Div tag (<div style="vertical-align: left; text-align: left">), but still no joy.  Would appreciate any help thanks.

How to get values from a multi row set in case of Execute SQL task?

Hi All, I'm testing the Execute SQL task, when I set the ResultSet to Full row set an try to retrieve those set into a variable, the package runs well but I' m not able to extract what is inside the record. If I try to debug the package to explore the data. All that I recieve is _ComObject as type, System._ComObject as value, I know (if I'm not wrong) that this _ComObject is the box that contains the rows though the values the question is how to extract those variables. For example, I can say how to enumerate the results sets using a ForEach container? Thank you The complexity resides in the simplicity

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

multi parameter sub report



i have a sub report that i want to pass the same multi-select parameter through as in the main report itself.

i have set the parameter in the sub report exactly the same as in the main report but i get an error.

also, in the main report i have clicked on the properties of the sub report and selected the parameter, the only difference is that the paramter automatically end with "(0)" and i dont know what this means.

Any help would be much appreciated,





Multi value Parameter Float datatype in Sql Reporting Services2008


Hello there,

I am having a report where i am having 2 parameters to pass the values to Store Procedure in SQL 2008. 

1) @Name Nvarchar(50),

2) @Cost Float

I can able to pass the Multiple values to parameter 1 . From the example below link


but i cannot use that for the float data type. How can i pass multiple values of float data type to my store procedure any help much appriciated..

Thanks Jeevan Dasari....-:)


Issue with SSRS multi-parameter control


Hi Folks,

I am having the attached error with a multi-parameter filter control. This is happening only when there is just 1 value in the list.

Has anyone come across this issue and is there a solution to this? I am using SSRS 2005.

Sorry was trying to attached a snap-shot here but don't know if thats possible.

I'll try yo put the issue in words. The list box does not show the item in it. It does not render fully.



SSRS Multi value Parameter


I Have a Report Parameter (single Value)@Path. The Available Values for @Path are from a Dataset.

The Values are like this. \a1\b1 , \a1\b1\c1, \a1\b2, \a1\b2\c1. Now if i select the value \a1\b1 , i will get  all of the values for under the  path \a1\b1. ie., it selects '\a1\b1%'. The Main dataset of the report has the query like this. Select Col1,Col2 WHERE path = '@Path+'%' It works fine until now.

Now I want to make this Parameter to select multiple values. So I changed the Properties of the Parameter and the SQL like        Select Col1,Col2 Where path IN (@Path). This works fine as i can select  multiple values \a1\b1 and \a1\b2 and also i can get the result correctly covering these two paths. But the problem is , i want to cover the total sub paths also. So if i select \a1\b1 and \a1\b2 i should get the result covering \a1\b1\c1 and \a1\b2\c1 also.

Please help!!

passing values to object properties of action method parameter


I have an action method that accepts a single parm.

That parm is an object with multiple properties. MVC correctly maps values from the querystring
to properties in the parm object by matching property name to querystring value name. 
Problem is, properties in the action method parm object which are themselves objects with
properties, are not assigned their matching values from the querystring. The class object has a
constructor which accepts a single string parameter.

How do I assign to properties of an action method parameter which are themselves class objects?



                <%: Html.ActionLink("Edit", "ProductMasterEdit", 
                       new { ProdKey=item.ProductKey.Value, 
                       ProductKey = item.ProductKey.Value })%> 

    public ViewResult ProductMasterEdit(ProductMaster Item)

  public partial class ProductMaster

    public ProductKey ProductKey
      get { return new ProductKey(this.ProdKey); }
      set { this.ProdKey = value.Value; }


SSRS 2005 Error: Cannot add multi valued query parameter for data set because it is not supported b



getting the above error when running a report in SSRS 2005, using a stored procedure with many input parameters,

connected to a Sybase IQ database,

I want to have some of the prompts to be multi valued prompts.......

Please advise on how to fix......



Creating a subscription that sends out an email for each value in a multi valued parameter


I have a report that has  a paramter (drop  down) which has about 1000 possible values. I need to create a subscription that generates an excel sheet for each value in that paramter and send it as an email attachment to a selected set of people based on the paramter chosen.

assume that the paramter is called bank name and has the following possible values, pnc, wachovia, boa..

when the subscription runs

it should run the report with the parameter value for bankname as "pnc" generating an excel and emailing it to user@pnc.com

then it should run the report with the parameter value for bankname as "wachovia" generating an excel and emailing it to user@wachovia.com

then it should run the report with the parameter value for bankname as "boa" generating an excel and emailing it to user@boa.com

and so on

What is the best way to accomplish this


Thanks for any help in advance



InfoPath 2010 Set field values of multi checkbox based on drop down selection



I have a drop down with e.g values "Fruit", "Veg".I also have checkboxes - "Apple", "Pear", "Orange" ,"Tomato", "Potato". On selection of Fruit i want the checboxes applicable to fruit to be checked. I have a rule at the moment but can only get one checkbox to be ticked. How do i do multiple.

Thanks in advance.




Multi-Value Parameter Dynamic MDX Syntax


I have the following SSRS MDX working with single-value parameters (Note the StrToMember() function calls below).  I need to write a similar SSRS report which has a multi-value parameter which will replace the TopCount([Dim Developer]...) below.  I'm uncertain how to write similar syntax for multi-value parameters.

SET [Top 10 Developers] AS TopCount({Filter(Filter([Dim Developer].[Developer Id].Children,
                                [Dim Developer].[Tracked].[Tracked].&[Actively Tracked]),
                         [Dim Division].[Hierarchy].[Country].&[No Country])},
                     10, [Measures].[3 Year Total])
SET [Rest of Developers] AS {Except(Filter(Filter([Dim Developer].[Developer Id].Children,
                                [Dim Developer].[Tracked].[Tracked].&

Passing Multi-Value Parameters between reports



I have two Reports PropertySearch and PropertyDetails. In PropertySearch I have  2 parameters PropertyNameSearch (textbox) , City (multi-select from a drop down). It takes some propertyName and Few Cities as input and displays a list of properties matching these two. So the list has a link to PropertyDetails for which I just need PropertyID that passes internally to the PropertyDetails. Everything works perfect.

But when I was in second report I want to go back to the first report ( which was displaying results with based on parameters) to choose a different property. So for this I have created the parameters @PropertyNameSearch , @City in my second report and I set it to hidden. Now I'm passing these two values to the second report with actual parameter PropertyID.  I have placed a link to first report in the second report that passes the @PropertyNameSearch and @City to first report. I can pass @PropertyNameSearch successfully but my problem is I cannot pass multi-value parameter @City between two reports.

Any help or suggestions ?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend