J
JohnFol
The parameter count is probably 3 as there is a default @Return
I would typically use a command object to represent tblAccount_SELECT_BY_PROMOTIONAL and just do the following:
sqlCommand.Parameters.add ("@FKCustomerID",PKCustomerID)
sqlCommand.Parameters.add ("@Assigned",Assigned)
Hi Folks,
Can someone explain me why I'm getting the following error?
The error message I got is : "Parameter count does not match Parameter Value count."
Here is the Stored Procedure:
ALTER PROCEDURE dbo.tblAccount_SELECT_BY_PROMOTIONAL
@FKCustomerID int,
@Assigned bit
AS
SELECT * FROM tblAccount WHERE Assigned = @Assigned AND IsPromotional=1 AND PromotionalOwner = @FKCustomerID AND DELETED=0
Here is the Code where I call from:
try
{
ENTITY.dsAccount dsAccount = new YNOTCALLME.COMMUNICATION.ENTITY.dsAccount();
SqlParameter [] arParams = new SqlParameter [2];
arParams[0] = new SqlParameter("@FKCustomerID",PKCustomerID);
arParams[1] = new SqlParameter("@Assigned",Assigned);
SqlHelper.FillDataset (DBConnection, "tblAccount_SELECT_BY_PROMOTIONAL",dsAccount,new string[] {"Account"},arParams);
return dsAccount;
}
catch (SqlException ex)
{
YNOTCALLME.FRAMEWORK.ERRORMANAGER.Error.Save (ex);
return null;
}
Thanks
laszlo
I would typically use a command object to represent tblAccount_SELECT_BY_PROMOTIONAL and just do the following:
sqlCommand.Parameters.add ("@FKCustomerID",PKCustomerID)
sqlCommand.Parameters.add ("@Assigned",Assigned)
Hi Folks,
Can someone explain me why I'm getting the following error?
The error message I got is : "Parameter count does not match Parameter Value count."
Here is the Stored Procedure:
ALTER PROCEDURE dbo.tblAccount_SELECT_BY_PROMOTIONAL
@FKCustomerID int,
@Assigned bit
AS
SELECT * FROM tblAccount WHERE Assigned = @Assigned AND IsPromotional=1 AND PromotionalOwner = @FKCustomerID AND DELETED=0
Here is the Code where I call from:
try
{
ENTITY.dsAccount dsAccount = new YNOTCALLME.COMMUNICATION.ENTITY.dsAccount();
SqlParameter [] arParams = new SqlParameter [2];
arParams[0] = new SqlParameter("@FKCustomerID",PKCustomerID);
arParams[1] = new SqlParameter("@Assigned",Assigned);
SqlHelper.FillDataset (DBConnection, "tblAccount_SELECT_BY_PROMOTIONAL",dsAccount,new string[] {"Account"},arParams);
return dsAccount;
}
catch (SqlException ex)
{
YNOTCALLME.FRAMEWORK.ERRORMANAGER.Error.Save (ex);
return null;
}
Thanks
laszlo