Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesThe stored procedure 'dbo.myCompany.MyModule' doesn't exist.The stored procedure 'dbo.myCompany.MyModule' doesn't exist.
Previous
 
Next
New Post
8/8/2013 6:54 PM
 

I am new to developing in DNN. I used the templates that come with dnn and have created a new module with the DNN interface on the Extensions page.  When I try to add the module to a page I gt an error:

Error: myModule is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: The stored procedure 'dbo.myCompany_GetmyModules' doesn't exist. ---> System.InvalidOperationException: The stored procedure 'dbo.myCompany_GetmyModules' doesn't exist. at System.Data.SqlClient.SqlCommand.DeriveParameters() at System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command) at Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection connection, String spName, Boolean includeReturnValueParameter, Object[] parameterValues) at Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection connection, String spName, Boolean includeReturnValueParameter) at Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) at myCompany.Modules.myModule.SqlDataProvider.GetmyModules(Int32 ModuleId) in c:\Users\Michael\Documents\Visual Studio 2012\WebSites\DotNetNukeWebsite2\App_Code\myCompany.myModule\SqlDataProvider.cs:line 178 at myCompany.Modules.myModule.myModuleController.GetmyModules(Int32 ModuleId) in c:\Users\Michael\Documents\Visual Studio 2012\WebSites\DotNetNukeWebsite2\App_Code\myCompany.myModule\myModuleController.cs:line 119 at myCompany.Modules.myModule.ViewmyModule.Page_Load(Object sender, EventArgs e) in c:\Users\Michael\Documents\Visual Studio 2012\WebSites\DotNetNukeWebsite2\DesktopModules\myCompany.myModule\ViewmyModule.ascx.cs:line 98 --- End of inner exception stack trace ---

 

can someone tell me how to fix this?

 
New Post
8/8/2013 7:58 PM
 
Given the error message "The stored procedure 'dbo.myCompany_GetmyModules' doesn't exist"

Are you looking for something other than "Create the stored procedure"?

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
8/8/2013 9:22 PM
 

Here is my sqldataprovider.  Am I doing anything wrong?

/************************************************************/
/*****              SqlDataProvider                     *****/
/*****                                                  *****/
/*****                                                  *****/
/***** Note: To manually execute this script you must   *****/
/*****       perform a search and replace operation     *****/
/*****       for {databaseOwner} and {objectQualifier}  *****/
/*****                                                  *****/
/************************************************************/

/** Create Table **/

if not exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_MyModule]') and OBJECTPROPERTY(id, N'IsTable') = 1)
BEGIN
CREATE TABLE {databaseOwner}[{objectQualifier}MyCompany_MyModule]
(
[ModuleID] [int] NOT NULL,
[ItemID] [int] NOT NULL IDENTITY(1, 1),
[Content] [ntext] NOT NULL,
[CreatedByUser] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL
)

ALTER TABLE {databaseOwner}[{objectQualifier}MyCompany_MyModule] ADD CONSTRAINT [PK_{objectQualifier}MyCompany_MyModule] PRIMARY KEY CLUSTERED  ([ItemID])
CREATE NONCLUSTERED INDEX [IX_{objectQualifier}MyCompany_MyModule] ON {databaseOwner}[{objectQualifier}MyCompany_MyModule] ([ModuleID])

ALTER TABLE {databaseOwner}[{objectQualifier}MyCompany_MyModule] WITH NOCHECK ADD CONSTRAINT [FK_{objectQualifier}MyCompany_MyModule_{objectQualifier}Modules] FOREIGN KEY ([ModuleID]) REFERENCES {databaseOwner}[{objectQualifier}Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION
END
GO


/** Drop Existing Stored Procedures **/

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_GetMyModules]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}MyCompany_GetMyModules
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_GetMyModule]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}MyCompany_GetMyModule
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_AddMyModule]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}MyCompany_AddMyModule
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_UpdateMyModule]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}MyCompany_UpdateMyModule
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}MyCompany_DeleteMyModule]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}MyCompany_DeleteMyModule
GO

/** Create Stored Procedures **/


create procedure {databaseOwner}{objectQualifier}MyCompany_GetMyModules

@ModuleId int

as

select ModuleId,
       ItemId,
       Content,
       CreatedByUser,
       {objectQualifier}MyCompany_MyModule.CreatedDate
from {objectQualifier}MyCompany_MyModule with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}MyCompany_MyModule.CreatedByUser = {objectQualifier}Users.UserId
where  ModuleId = @ModuleId
GO

create procedure {databaseOwner}{objectQualifier}MyCompany_GetMyModule

@ModuleId int,
        @ItemId int

as

select ModuleId,
       ItemId,
       Content,
       CreatedByUser,
       {objectQualifier}MyCompany_MyModule.CreatedDate
from {objectQualifier}MyCompany_MyModule with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}MyCompany_MyModule.CreatedByUser = {objectQualifier}Users.UserId
where  ModuleId = @ModuleId
and ItemId = @ItemId
GO


create procedure {databaseOwner}{objectQualifier}MyCompany_AddMyModule

@ModuleId       int,
@Content        ntext,
@UserID         int

as

insert into {objectQualifier}MyCompany_MyModule (
ModuleId,
Content,
CreatedByUser,
CreatedDate

values (
@ModuleId,
@Content,
@UserID,
getdate()
)

GO

create procedure {databaseOwner}{objectQualifier}MyCompany_UpdateMyModule

@ModuleId       int,
        @ItemId         int,
@Content        ntext,
@UserID         int

as

update {objectQualifier}MyCompany_MyModule
set    Content       = @Content,
       CreatedByUser = @UserID,
       CreatedDate   = getdate()
where  ModuleId = @ModuleId
and    ItemId = @ItemId

GO

create procedure {databaseOwner}{objectQualifier}MyCompany_DeleteMyModule

@ModuleId       int,
        @ItemId         int

as

delete
from   {objectQualifier}MyCompany_MyModule
where  ModuleId = @ModuleId
and    ItemId = @ItemId

GO

/************************************************************/
/*****              SqlDataProvider                     *****/
/************************************************************/

 

 

 
New Post
8/9/2013 1:44 AM
 
I see some issues on your procedures. If you refences to a table you always have to add both the {databaseOwner} and {objectQualifier} only on refences to SQL System databases it have to be hardcoded with dbo.

So here is a sample Fix, you have to do also for the other spocs:

create procedure {databaseOwner}[{objectQualifier}MyCompany_GetMyModules]

@ModuleId int

as

select ModuleId,
ItemId,
Content,
CreatedByUser,
{databaseOwner}[{objectQualifier}MyCompany_MyModule].CreatedDate
from {databaseOwner}[{objectQualifier}MyCompany_MyModule] with (nolock)
left outer join {databaseOwner}[{objectQualifier}Users] on {databaseOwner}[{objectQualifier}MyCompany_MyModule].CreatedByUser = {databaseOwner}[{objectQualifier}Users].UserId
where ModuleId = @ModuleId
GO


Also please replace MyCompany with your Company Name or else others. I think MyModule is also created as a placeholer from the template it have then also be changed to your module Name!   It must be sure a table procedure, view or any other could not be overwite from a other module using same names! Sp best practice is always using your Company Name and Module Name for the Database artifacts.
 
New Post
8/9/2013 1:46 AM
 

Please notice after creating the Dataprovider you have also to create the tables, and other database artifacts on your developer database. This will not be done automaticly on compiling!

The {databaseOwner} placeholder have to be used about not all databases uses dbo as it Standard database Schema! 

Please don't forget to add a uninstall.SqlDataProvider  so that all existing can be removed on uninstalling the module.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesThe stored procedure 'dbo.myCompany.MyModule' doesn't exist.The stored procedure 'dbo.myCompany.MyModule' doesn't exist.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out