The SqlParameterCollection only accepts non-null SqlParameter type objects

Posted by Rrana under Sql Server on 9/5/2011 | Points: 10 | Views : 4488 | Status : [Member] | Replies : 1
Hi
I'm getting "The SqlParameterCollection only accepts non-null SqlParameter type objects. "
do you know why I get this message?
======================
try
{
DataTable dTable = null;
clsDBAccess dbAccess = new clsDBAccess(base.ConnectionString);
SqlParameter[] param = new SqlParameter[1];
dTable = dbAccess.ExecuteDataTable("PROC_FETCH_REASON", param);
return dTable;
}
catch (Exception ex)
{
throw ex;
}
================

My S.P

==================
create PROCEDURE [dbo].[Proc_Fetch_Reason]

As

BEGIN

Begin Try

select a.break_type,b.reason_desc, b.REASON_ID from tblbreak a,tblreasons b
where a.break_id = b.break_id

End Try
Begin Catch

SELECT ERROR_NUMBER() AS ErrorNumber,ERROR_MESSAGE() AS ErrorMessage

End Catch

END
======================
Thanks in advance

Sucharitha Goud
Bank Of America..



Responses

Posted by: Vuyiswamb on: 9/5/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
it is because one of your parameters are not receiving an input.

Thank you for posting at Dotnetfunda
[Administrator]

Rrana, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response