Value Cannot Be Null. Parameter Name: DataSet (was SQL Help :()

Feb 11, 2005

I keep getting "Value cannot be null. Parameter name: dataSet" when I run this statement and bind it to a dataset using a sqldataadapter in ASP.NET using VB.NET.


"SELECT playerstats.playerid, playerstats.gameid, SUM(playerstats.fta), SUM(playerstats.ftm), SUM(playerstats.tpm), SUM(playerstats.rb), SUM(playerstats.fga), SUM(playerstats.fgm), SUM(playerstats.tp), SUM(playerstats.st), SUM(playerstats.a), 100(SUM(playerstats.fgm)/SUM(playerstats.fga)) AS fgp, player.playerid, player.lname + ', ' + player.fname AS fullname FROM playerstats, player WHERE playerstats.playerid = player.playerid AND player.leagueid = " & ddlLeague.SelectedValue & " ORDER BY " & strSortField


I know there is data in the db.

Please help :confused:

View 6 Replies


ADVERTISEMENT

Filters For Dataset From Parameter - How To Ignore If The Parameter Is NULL ?

Apr 10, 2007

Hi,

I am starting to use reporting services and I created a report that takes 4 parameters for a Filter on the dataset.

The idea is the create snapshot nightly and then display the report filtered based on parameters to users.



I'd like that the filter be ignored for a parameter if the parameter is passed as NULL,

Right now I defined it this way :



Left =Fields!RegionCode.Value
Operator =
Right =IIF(IsNothing(Parameters!RegionCode.Value),Fields!RegionCode.Value,Parameters!RegionCode.Value)

I do this for the 4 parameters that are passed, if they are null, make then equals to the field.

I was wondering if there is a way to ignore the whole parameter all together, I would guess it'll be faster to execute.



Thanks

View 5 Replies View Related

Reporting Services :: Adding Dataset Parameter Doesn't Add Report Parameter In Visual Studio 2008 SSRS

Apr 22, 2015

I'll go to a dataset, open up the query designer, add a new parameter, then refresh the fields, but the parameter won't be added as a report parameter.  If I go to the dataset properties under the list of parameters, the value in the dropdown will be blank.  However, sometimes this will automatically add. 

Is this a bug in Visual Studio?  How do I get around this? 

View 3 Replies View Related

Reporting Services :: Give Meaning Full Name To Allow Null Value Check Box In Report Parameter Instead Of NULL?

Oct 20, 2015

In my report i have CNAME parameter , which allows null value. I checked Allow null value check box in report parameter properties.

when i preview the report , it displays checked NULL check box beside CNAME parameter . I want to give some meaningful name(i.e.ALLCustomers) to this checkbox instead of NULL. 

Is it possible through SSRS designer?

View 5 Replies View Related

Subscription Issue With Null Default Parameter - Key Cannot Be Null

May 3, 2007

I have a report that is run on a monthly basis with a default date of null. The stored procedure determines the month-end date that it should use should it be sent a null date.

The report works fine when I tell it to create a history entry; however, when I try to add a subscription it doesn't appear to like the null parameter value. Since I have told the report to have a default value of null it doesn't allow me to enter a value on the subscription page.

Now, I suppose I could remove the parameter altogether from the stored proc, but then the users would never be able to run the report for a previous time period. Can someone explain to me why default values aren't allowed to be used on subscriptions when they seem to work fine for ad hoc and scheduled reports? This is really quite frustrating as most of my reports require a date value and default to null so that the user doesn't have to enter them for the latest data.



An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help




Key cannot be null. Parameter name: key

View 1 Replies View Related

Reporting Services :: Share Point List Data Set Parameter Allow Null In Multivalue Drop Down Parameter

Aug 28, 2015

my dataset from sharepoint list. and this dataset value assign to parameter. i want when no any parameter is selected than it should filter like "ALL". when i select alow null value it give me prompt error you  can not select null in multivalue parameter.How can i do it. i am using share point list.

View 3 Replies View Related

Display First Non NULL Value From My Dataset?

Dec 18, 2006

Hello,

I would like to display the first non null value from my dataset, is this possible? I am aware of first() and last() but what are my options for displaying the aforementioned? Thanks much!

John

View 3 Replies View Related

Running Value And NULL In A Dataset

Aug 6, 2007



Hi Everyone,

I have a dataset like below









X15ForecastsCounts
X16ActualsCounts
WeekEnding

38
18
7/23/07

38
14
7/30/07

38
35
8/6/07

37
NULL
8/13/07

37
NULL
8/20/07

37
NULL
8/27/07

37
NULL
9/3/07

36
NULL
9/10/07

36
NULL
9/17/07

22
NULL
9/24/07



I am plotting this data set as an S-Curve using the Running Value funtion.
The value and data point value is =RunningValue(Fields!X15ForecastsCounts.Value,Sum,"Series") similar code for X16Actuals Counts.

Unfortunately I am getting the curve like this http://tinypic.com/view.php?pic=4lyiuko

I dont want my X16ActualsCounts to extend beyond 8/6/07 in this case....and next week I dont want it to extend beyond 8/13/07.

How can I fix this issue??


View 3 Replies View Related

Testing For Null Dataset

Dec 11, 2007



Hi All,

I need to find out how I can detect a NULL dataset at runtime. I have just released my first report using SQLServer Reporting services and all went well until I had an empty dataset on the server. There was no problem ever on my development system, running under Visual Studio 2005 Pro, even if I got no data back. Shortly after release to the server though I found that the report reported javascript errors. After a lot of searching I nailed it down to my code that alternated the background color of the rows in the report. The code looks like this:

=iif( RowNumber("DataRecords") Mod 2, "WhiteSmoke", "White")

I had this line in the BackGround property for my table row. It works great, unless DataRecords is Null and RowNumber is 0. I ended up taking the expression out, because I could not find a way to test if DataRecords was null or RowNumber was 0, without getting a compiler error.

Can anyone here tell me what I need to do so I can put that expression back in and alternate the color of my data rows again? I get the data using a stored procedure, if that matters.

TIA
URW

View 2 Replies View Related

Using Parameter From XML DataSet In Another XML DataSet

Apr 5, 2007

Hi every body...
I have a probleme
I have a web Services which contains a method getValue(IDEq (int), idIndicator(int), startTime(dateTime), endTime(dateTime))
I need to call this method. But my problem is how pass parameter ?
I see the tab Param but it isn't work as I wait,... maybe I do a mistake...

I want that statTime and endTime are select by the user via a calendar for example...
now idIndicator and idEq was result of an other dataSet from a xml datasource...

But I don't how integrate dynamically... I try to enter a parameter via the param tab, and create and expression :
=First(Fields!idEq.Value, "EquipmentDataSet")
but when i execute the query, the promter display <NULL>...
So I don't know how to do and if it is possible !
I hope someone can help me !
Thank you !

View 3 Replies View Related

Passing NULL To DataSet Parmameter

Apr 13, 2007

Hey All,

I have a number Stored Procs that have been around for a while that pull the entire list, or if I pass an ID, will just the record for that ID like below.

I want to be able to use these querries to poplate Multi-Select parameter dropdowns. going to the Data tab and creating a new dataset, I put in the SP name, and close the window. I then go to the Red ! point to preview the data it prompts me for my ID parmaeter on my SP. In the dropdown list it has '<Null>' (no ' though). When I run it, it works fine and returns all of my records.

When I run the report, it errors saying I didn't pass a parm for ID. I go back to the data tab, and edit my DataSet hitting the elipse. I go to the 3 tab called parameters, and type the following I get the following errors:



@ID = <Null> ---- ERROR - [BC30201] Expression expected

@ID= ---- ERROR - Return statement in function must return a value

@ID = Null -----ERROR - Null constant not supported use System.DBNull instead

@ID = System.DBNull ----ERROR - [BCS30691] DBNull is a type in System and cannot be used in an expression

@ID=System.DBNull.Value --- NO ERROR, but it does not return anything either. I also did a SQL Trace, and I can see that it doesn't even send the querry to the database.



Does anyone know another magic value I can pass to get this to work?



I am being a little stuborn, I know that I could just create new procs, and wrap up the null, but the more stuff you create the more you have to maintain, so I would prefer to reuse these.



Thanks in advance.



Eric Wild



PS: My company is moving from crystal reports to Reporting service, and Reporting services is Rocks! It is very intuitve, simple and straign forward. The formatting is easy with the table and the matrix control blows away the crosstab control in crystal. Also, I'm finding that because crystal was so un extendable, that I would spend hours shaping sql to get over it's blemishes, and hours shaping it in the report, only to sometimes reliaze that the proposed onetime hack wouldn't work, and have to start all over! So far with RSS any tips and tricks I have learned can very easily be applied to any report I work on! Aslo, I do mostly interanet web apps, and it is nice to dump my reports on the Report Server, and not worry about haing to create a web page, create a datasource and all the ansilary stuff to go along with it. The only thing I don't like is the name 'Roporting Services': It does not stick out too far in Google Searches like 'AJAX.NET' or 'ASP.NET'. Anyway kudoes to the Reporting Services team!







ALTER PROC [dbo].[spGetLaborRole]
@ID INT = NULL
AS
BEGIN
SELECT ID, Descr
FROM dbo.LaborRole
WHERE ( (ID = @ID) OR (@ID IS NULL) )

View 3 Replies View Related

How To Update A Column In Input Dataset With 'NA' If It's Null

Feb 6, 2007

Do I have to use condition split?, then union all?

if in script, I can use update from <tablename> Set column = isnull(column, 'NA'). It's so simple.

I'm also wondering can we run SQL Script against input dataset in a SSIS component?

 

 

View 6 Replies View Related

Web Service Dataset With Null Or Empty Spaces.

Sep 6, 2007

HI,
I am using XmlDataDocuments returned by webservices and query in the reports to populate the reports.

The issue I have is if the dataset used to populate the XML document has any nulls or empty spaces in any field the whole column or row is missing in the data generated by my query in the Reports. Sometimes the whole data is not being returned to the reports.

Sample query I use

<Query>
<SoapAction>http://xxxx.webservices.org/SelectReportRegisters</SoapAction>
<Method Namespace="http://xxxx.webservices.org/" Name="SelectReportRegisters">
<Parameters>
<Parameter Name="p_registerType">
<DefaultValue>All</DefaultValue>
</Parameter>
<Parameter Name="p_registerName">
<DefaultValue>All</DefaultValue>
</Parameter>
<Parameter Name="p_asOfDate">
<DefaultValue>7-1-2009</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>

I have tested the webservice with sample data and it works well, returns data.

I use the ISNULL() in my stored procedures to avoid nulls but with empty strings, replacing them with a default value in the managed code is expensive and slows down the reports.
Is there some feature I am missing because of which nulls and empty strings are causing this problem.

I am using Reporting services 2005.

Any pointers will be truly appreciated.

View 2 Replies View Related

DateTime.Now, An Allowed Null Field, And My Insert Function From My Dataset

Jun 6, 2008

I have a table adapter for one of my SQL2005 tables, and in two different fields I accept a date time. Now 99% of the times, new rows to this table will be filled out using DateTIme.Now(), as a Time Stamp is what I'm going for.
 
Here is the line of code in question...cops_current_data_adapter.Insert(ProductOrder, Convert.ToInt16(Session["StationId"].ToString()),
PartNumber, DateTime.Now, DateTime.Now, Convert.ToInt16(qty), 0);
 The second DateTime.Now is the one that can be null, and it's throwing a formatting error everytime I try and drop it in there. It's a FormatException, and there's not much more to the example except unhelpful tips like be careful when conveting a string to a dateTime, which I'm not doing. Needless to say for the code to compile, and then throw a Format error at runtime is a bit frustraiting.
 Any suggestions would be most appreciated

View 1 Replies View Related

Basic Parameter In Two Dataset

Feb 11, 2008


Hi All

I have two datasets (for querying active directory but this is kind of irrelevant for my problem which is a basic one)

The first gets a list of groups and I want to display GroupName in a dropdown list:

SELECT DistinguishedName, GroupName, GroupDescription
FROM tvf_GetListOfGroups('LDAP://OU=Applications,OU=Groups,OU=Production,DC=MRP,DC=NET,DC=NZ','Subtree')
ORDER BY GroupName


The above is fine and works but then I want to use the corresponding DistinguishedName of the GroupName selected in
the dropdown to drive the second query to populate the report


SELECT * FROM tvf_GetGroupMembers('LDAP://' + @DistinguishedName)
ORDER BY UserLogin

My problem is how to populate @DistinguishedName with the correct value to run run the query.

How? Please?

Thanks
Pete

View 1 Replies View Related

Passing Parameter Into Dataset

Jun 15, 2007

Hello



Im trying to pass a integer parameter to my dataset query depending on the selection made from the user. It is suppose to get the Top number off records based on what number the user chooses



I get the error Incorrect syntax near '@Param_TopNo, If i take the top @param_topno out the query works



The cutdown version off the query is...



Select Top @Param_TopNo SaleDate, Consultant, Productname

From tblSales

where product = 2000


Im not sure if the method above is even achievable !!!! does anyone know how i can pass a variable/parameter into my dataset and maybe provide an example off the code.



thanks



View 1 Replies View Related

2 DataSet From Xml DataSource, And Parameter ...

Apr 5, 2007

Hi !!!
I have a problem, I don't know how to do...
I have 2 dataset from 2 differents XML dataSource...
I want the result of one dataSet to be a parameter for the second !

I try to add a parameter in param tab, with expression, I choose DataSet and
=Sum(Fields!ID.Value, "DataSetID")
but when I execute the query, the prompt for the param appear, but the value of id was <NULL>...

Someone have ideas to resolve this problem ?
thank you for your help !

View 1 Replies View Related

Default Parameter Value = First Value Of Dataset

May 31, 2007

Any way to have the default value of a parameter for a multi select parameter be the first value of the query of that parameter?

View 7 Replies View Related

Parameter For Where In (@Par1) In Typed Dataset

Aug 21, 2007

Hi,
 Is there any work around to passing a set of strings to a parameter in a Typed Dataset for example I am pasing '4226222172004','4212012182004' which I build on my code the number of items will vary passed on the user selection but since the Typed Dataset uses sp_executesql and the parameters are change to '''4226222172004'',''4212012182004'''
 Any ideas how I can format the Parameter I am passing.so that it will end like where in ( '4226222172004','4212012182004') instead of where in ('''4226222172004'',''4212012182004''') I again the number of parameters will very.
Thanks
Julio D

View 1 Replies View Related

Pass Hidden Parameter From One Dataset To Another

May 3, 2007

I have 2 datasets in my report and I want to pass a field from the 1st dataset as a parameter to the 2nd dataset.

How can I do this?

I tried to set the report parameter from a query using the 1st dataset but the parameter is always equal to the first record in the recordset-it never changes per row.

View 1 Replies View Related

How Do I Use A Parameter In A Dataset Field Value Using An MDX Query?

May 23, 2007

Let me simplify. The value of my dataset field Dimension_1 is



[SOB Year].[Yr Id].[Yr Id].[MEMBER_CAPTION]



I want to use parameters for SOB Year and Yr Id like I do on the query.



But if I use



="["& Parameters!dimension_1_table.Value &"].["& Parameters!dimension_1_column.Value &"].[" & ["& Parameters!dimension_1_column.Value &"]"



it returns null for the values. I don't know how to make these parameters





I am passing in parameters for the table and column to build an MDX query here is my query.



="SELECT NON EMPTY { [Measures].[Liability Amt] } ON COLUMNS, NON EMPTY { (["& Parameters!dimension_1_table.Value &"].["& Parameters!dimension_1_column.Value &"].["& Parameters!dimension_1_column.Value &"].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [SOB Clean] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS"





Anyone know what value I need to use on the dataset field to access the column?



Thanks,

Roger

View 10 Replies View Related

Parameter Cannot Set The Command Text For Dataset

May 14, 2007

Hello



I get the following error in a very quick test system i created:



An error occurred during local report processing.

An error has occurred during report processing.

Cannot set the command text for data set 'test'.

Error during processing of the CommandText expression of dataset 'test'.



My sql is:

= "select T.testid, T.test from test T " & Iif(Parameters!test1.Value = 1, "", "Where T.testid = " & Parameters!test1.Value)



There is nothing obviously wrong in the code as far as i can see



The parameter 'test1' is of type 'string'



The database 'test' has 2 columns of type 'smallint' and 'Name:nvarchar(50)'



I am at a loss, as this query is really simple, and is similar to the example query set up my microsoft which works fine



Thanks

View 5 Replies View Related

How Can I Set Default Value Of Parameter That Come From Dataset By Using Expression?

Feb 27, 2008

Hi,

Now I can query dataset and bind to report parameter. But I have some problem about setting default value. I don't know, how to select max value from dataset by using expression.

Example, I query disticnt year from my table. The result has 2 years "2007" and "2008"
select distinct year(mytime) as myyear from mytable.

I set available parameter by using this dataset. Then, I set default value for this parameter by the other dataset ...

select max (distinct year(mytime)) as maxyear from mytable.

I want to select max value by using expression, not select max by using dataset.

How can I do?

Thank you very much.

View 4 Replies View Related

How Can I Have A Variable Number Of Parameter Values In A Dataset?

Apr 20, 2007

I have a strongly typed dataset, and I need to be able to do a search on multiple values of a parameter.  The problem is I don't know how many.  I have a textbox that the user can enter search words in.  The select string is built from the string of words that are entered, like this:For iCount = 0 To UBound(sArray)    strSQL = strSQL & "Description LIKE '%" & sArray(iCount) & "%' OR "Next Can I do this is a dataset method?  How?  If I can't, what are my options?Diane 

View 6 Replies View Related

Referencing A Multi-valued Parameter In A Dataset

Oct 22, 2007



Hello,
I am attempting to create a cascading parameter.
Parameter's 1 & 2 are multi-valued.
Datasets 1 & 2 supply Parameter's 1 & 2.
The values for Parameter 1 as derived from Dataset 1 are 'A', 'B', 'C', 'D' and 'E'.
The potential values for Parameter 2 will only be created if value 'C' is amongst the multiple values selected for Parameter 1.
Thus I need to write my query for Dataset 2 so that it can check the values of Parameter 1 for the existence of 'C' otherwise it returns nothing.
What is the best practice for a dataset referencing the values of a multi-valued parameter in order to generate it's resultset?

Any help is appreciated.

View 2 Replies View Related

Using A Dynamically Created Parameter In Another Dataset Query

Jul 27, 2007



It's been a while since I used Reporting Services so I'm sure this is really straight forward. Basically I have the following report parameters:

reportMonth - Just a non-queried list of months for the user to select
reportYear - Generated using the following query from dataset "Years":

declare @curYear int
set @curYear = 2000
declare @yearTable table (repYear int not null)
while @curYear <= year(getdate())
begin
insert into @yearTable(repYear) values (@curYear)
set @curYear = @curYear + 1
end
select * from @yearTable

This generated a list like:

2000
2001
2002
etc.

I then have a 2nd dataset "Main" which I'd like to use both the reportMonth and reportYear parameters in once they've been generated. How do I go about setting this up and referencing the parameters? I've tried a few things but nothing seems to be working.

Thanks

View 10 Replies View Related

Dataset Becomes Empty After Adding Query Parameter

Mar 13, 2008



Hi all,

hope anyone can help me on this one.

I have a parameterized report based on a MDX query (so no drag and drop of filters and fields).
Now i have to ad a parameter. So i open the query parameter dialog box and i ad my parameter.
when i click ok , my dataset becomes empty , resulting in an error on my report saying that the fields on the report cannot by found and should be in the scope of the dataset.

Has anyone experienced this problem before, or am i forgetting something here?

thanks in advance

Steven J

View 1 Replies View Related

How Do I Get The OUTPUT Parameter Value From A Stored Procedure That I Am Using To Fill A Dataset?

May 10, 2007

View 6 Replies View Related

Pass Parameter Values To Stored Procedure In Dataset

Jul 10, 2007

I have a stored procedure "spDetailsByDay" which takes parameters @StartDateTime as datetime, @Day as int, @Hour as int, @Value1 as varchar(20), @value2 as varchar(20)



My report Parameters are StartDateTime as DateTime, Day as integer, Hour as integer, Value1 as string, Value2 as string, ReportType as string

In the dataset, I typed

=IIF(Parameters!ReportType.Value="Day", "EXEC spDetailsByDay " & Parameters!StartDateTime.Value & "," & Parameters!Day.Value & "," & Parameters!Hour.Value & "," & Parameters!Value1.Value & "," & Parameters!Value2.Value", "EXEC spDetailsByMonth")



I am getting syntax errors. Can anyone help me how to pass parameters to stored procedure in dataset.



Thanks.

View 4 Replies View Related

Preview Report Tab Is Prompting For An Input Parameter That Does Not Exist For The Dataset

Apr 11, 2008



I created a dataset based on a stored procedure. There are nine input parameters. When I click on the preview tab, it is asking me for ten input parameters.

I double checked my dataset on the data tab, and it only shows the expected nine parameters when I look at the parameters tab. I can also run the query without issue from the data tab.

I have no idea why it is asking for an extra parameter on the preview tab. It is a column name that does exist in my database, but is in no way used in the stored procedure in question.

Has anyone else run into a similar situation?

View 1 Replies View Related

Reporting Services :: Passing All Parameter Selection To Dataset Query

Nov 20, 2015

I have a report that prompts the user to select a parameter, for simplicity, let's say the parameter is for color choice, options are Red, Yellow, Blue or *. The * is for include all colors. I am passing that parameter back to the dataset query which, again for simplicity is

select
Hue from AvailableColors
whereColor
= @ColorParam.

For a specific color this works fine, for the "*" selection it returns a null. It would seem that I need to convert the * to % but I am not sure how.....

View 6 Replies View Related

Reporting Services :: Report Builder - How To Use Multiple-value Parameter In Dataset Control

Oct 25, 2015

I have used my parameter value in where clause of my dataset control SQL query. When I choose a single value in my multiple-value parameter then I get output as expected. Hovewer when I choose multuple values I get an arror:

Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
----------------------------
Query execution failed for dataset 'DATABASE'. (rsErrorExecutingCommand)
----------------------------
An error has occurred during report processing. (rsProcessingAborted)

I am convinced that it's a syntax problem. Is there a way I can change syntax of data output from query:

select @parameter

I need output to be like: value, value, value ... etc.

The dataset control query looks something like the following:

select
ID,
a,
b,
c,
d
from DATASET.dbo.Table
where ID in (select @parameter)

I have been searching through google for weeks to solve this and got this far and got stuck. Is it possible at all to achieve what I am looking for?

View 4 Replies View Related

Null Parameter

May 5, 2008

I have a sql proc. I need to make a parameter optional. I've setup the parameter to use a dataset as its source, and I need NOT to allow the value to be null. I've NOT selected allow nulls check box, But, when the parameter is null (‘’), still data comes back in a table as empty or if it is date will default to 1/1/1900. How do I send a null value to the database through sql proc and raise an error without inserting a null value? I’m hoping to avoid creating a special query just for that purpose.

Thanks.


Josephine

View 3 Replies View Related







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