Click here to Skip to main content
15,906,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have getting an error message passing parameter using rdlviewer.Parameters.


Error Message:

   Severity: 4 - Unknown ReportParameter passed 'courseId ' ignored.
Severity: 8 - SQL ExceptionParameterized Query '(@courseId nvarchar(4000))SELECT CourseID, CourseStatusTypeID, C' expects parameter @courseId, which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at fyiReporting.RDL.Query.GetData(Report rpt, Fields flds, Filters f)


Source Code:

C#
rdlViewer1.Parameters = "courseId = " + label1.Text.Trim();
             rdlViewer1.SourceFile = "D:\\AMSWorks\\AMS21-09-11\\111.rdl";

How to resolve this?
please help me.
Posted
Updated 26-Sep-11 1:40am
v2
Comments
Pradeep Shukla 26-Sep-11 10:06am    
Have you defined a valid parameter in the rdl as "courseId" ?
Dirk C De Winnaar 26-Sep-11 10:55am    
Show the "connection" section of you code. Please ShockShock
Dirk C De Winnaar 26-Sep-11 10:56am    
Are you passing the the coarseId?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900