Resources for the DotNetNuke Community
I know this is a newbie question, I've read the turtorial several times, and I'm really missing something. I feel like I'm SOOO close!
Ive got everything setup, but when it runs I get the following error message:
The stored procedure 'dbo.GetGroupContactMgrByModules' doesn't exist. ---> System.InvalidOperationException: The stored procedure 'dbo.GetGroupContactMgrByModules' doesn't exist.
I look in the database and its not there.
Where/How/When does
public abstract void DeleteGroupContactMgr(int ItemID);
SP's get created? Do I write them myself? Did I miss a CodeSmith template somewhere? I looked carefuly in the CodeSmith StoredProcedure template and could find no reference to ByModules or any of the others.
Thanks in advance!
Jordan,
the cs stored procedures template will create all base stored procedures for any given table (add, get, list, delete, update). AND if the table has any relationship to any other one it will also build the GetBy.. stored procedures based on the defined foreing keys. If you did not define that relation the stored proc will not be created.
Take a look at the helloworld tutorial, it's explained there.
First, thank you so much for the reply.
I think I'm really missing something here..
I ran the cs stored procedure template, and I did get SP's for my table.
But...
It (the code created from the dnnJungle project template) wants to call a SP called: GetGroupContactmgrByModuleID. Now GroupContractMgr is NOT a table, but the name of my PA or module name.
Did I just screw up when I created the project? or is there something that creates this SP?
The other modules don't seem to have this SP either, so I'm beginning to think I screwed up somewhere.
Here is the code generated from the CodeSmith Templates. These have Coresponding SP's.
#region
But .. I also get:public abstract IDataReader ListGroupContactMgr();public abstract IDataReader GetGroupContactMgrByModules(int ModuleId);public abstract IDataReader GetGroupContactMgr(int ItemID, int ModuleId);public abstract int AddGroupContactMgr(int ModuleId, string Field1);public abstract void UpdateGroupContactMgr(int ItemId, string Field1);public abstract void DeleteGroupContactMgr(int ItemID);These have my Module Name in them, NOT the table. Get[GroupContactMgr]ByModules for example. GroupContactMgr is my Module or PA.
So just to be clear... When you did the Hello world example.. Did you get anGetHelloWorldByModules SP? If so, can I see it? and where did you get it? (who/what generated it?)
And I will re-read the tutorial again. Thanks in advance.
Here it is:
SET QUOTED_IDENTIFIER ON
GO
SET
CREATE PROCEDURE
@moduleID
AS
SELECT
[itemID],
[moduleID],
[message]
FROM
WHERE
[moduleID]=@moduleID
SET QUOTED_IDENTIFIER OFF
Also generated from the templates you should get:
in Sqldataprovider.vb
in Dataprovider.vb:
Public
in controller file: