Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem passing parameter for stored procedure in entity
Message
From
11/07/2011 13:53:10
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Problem passing parameter for stored procedure in entity
Miscellaneous
Thread ID:
01517881
Message ID:
01517881
Views:
95
Hi all,

I have a problem with VS 2005 and MM .NET regarding a stored procedure. I've added the code to the responsible entity, but somehow I always get the following error:

Procedure or function 'SUBSTANCESelectBySubGroupFK' expects parameter '@GROUP_ID', which was not supplied.

Here is the code in my entity:
        public mmBindingList<SUBSTANCEEntity> GetSubsBySubGroupFK(int? groupID)
        {
            mmBindingList<SUBSTANCEEntity> SubsList;

            if (groupID != null)
            {
                SubsList = this.GetEntityList("SUBSTANCESelectBySubGroupFK");
                    this.CreateParameter("@GROUP_ID", groupID);
            }
            else
            {
                this.GetEmptyDataSet();
                SubsList = new mmBindingList<SUBSTANCEEntity>();
            }
            return SubsList;
            //return null;
        }
And here is the stored procedure:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[SUBSTANCESelectBySubGroupFK]
(
	@GROUP_ID int
)
AS
	SET NOCOUNT ON;
	SELECT [COMPANY_ID],
		[CRE_DATE],
		[CRE_USER],
		[GROUP_ID],
		[MOD_DATE],
		[MOD_USER],
		[SUBSTANCE],
		[SUBSTANCE_ID] 
	FROM [dbo].[SUBSTANCE]
	WHERE 
		([GROUP_ID] = @GROUP_ID)
Am I missing something? It works just fine with anothere entity/stored procedure, which is pretty similar to that. The parameter is not empty, but somehow it does not get passed on to the stored procedure.
Thanks!
Michael
Next
Reply
Map
View

Click here to load this message in the networking platform