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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DotNetNuke.Services.Exceptions.ModuleLoadException: Must declare the scalar variable "@ModuleID".  DotNetNuke.Services.Exceptions.ModuleLoadException: Must declare the scalar variable "@ModuleID".
Previous
 
Next
New Post
1/23/2007 7:11 PM
 

Don't know how much more I might be able to help, but what I started doing was finding the bloody functions that had @ModuleId in them and changed them to @ModuleID. Even within the function itself. I did it all from notepad in Windows. You'll need to do the same for all of them. Then try and run again. Until all the scalar errors go away.

If it is saying something about being undeclared, ick!

Not being a MSSQL genius, I had to do a bit of research on how to do that darn statements properly, even how to declare variables.

Get one of the create procedure statements and run it through SQL manager.

If you get scalar errors change all the @{variables} to lower case, upper case, or what ever case is your preference.

If you get undeclared @{variable} then here comes the Declare option. It worked for me, may work for you. Let's say I fat fingered the @PortalID (Like the authors of the original functions did and thus why you are getting scalar errors, who cares if DNN doesn't support CS collation some sort of standards need to be followed in the coding of functions, but that's MHO)

To correct the scalar error(s) on @portalID, @PortalID, @portalId, or @whatever...Is do a blanket search and replace for (I used notepad and turned of case sensing) @portalid with @PortalId. And there you go. Scalar error resolved. Apply the same concept to all @variables. In this case also @BannerTypeId (replace with @BannerTypeID, for example), and @GroupName (replace with @GroupName, for example). So long as you turn off case sensing in search and replace all items will be flipped to the same thing. Yes!

But what about undeclared variables? Got me, I got an undeclared once and rewrote the statement after experimenting with the Declare option. If you have your scalars resolved create a new thread with your undeclared variable issue. Find the function where the error is occuring, hopefully DNN is giving you a hint. I think I had to turn on debugging then read it backwards. Put the function in the posting. Also futz with the Declare option. And probably a good idea, if you create a new thread post a link here to your thread. So folks can find that and follow along. :)

create procedure {databaseOwner}{objectQualifier}FindBanners

@PortalID     int,
@BannerTypeId int,
@GroupName    nvarchar(100)

AS

SELECT  BannerId,
        {objectQualifier}Banners.VendorId,
        BannerName,
        URL,
        'ImageFile' = case when {objectQualifier}Files.FileName is null then {objectQualifier}Banners.ImageFile else {objectQualifier}Files.Folder + {objectQualifier}Files.FileName end,
        Impressions,
        CPM,
        {objectQualifier}Banners.Views,
        {objectQualifier}Banners.ClickThroughs,
        StartDate,
        EndDate,
        BannerTypeId,
        Description,
        GroupName,
        Criteria,
        {objectQualifier}Banners.Width,
        {objectQualifier}Banners.Height
FROM    {objectQualifier}Banners
INNER JOIN {objectQualifier}Vendors ON {objectQualifier}Banners.VendorId = {objectQualifier}Vendors.VendorId
LEFT OUTER JOIN {objectQualifier}Files ON {objectQualifier}Banners.ImageFile = 'fileid=' + convert(varchar,{objectQualifier}Files.FileID)
WHERE   ({objectQualifier}Banners.BannerTypeId = @BannerTypeId or @BannerTypeId is null)
AND     ({objectQualifier}Banners.GroupName = @GroupName or @GroupName is null)
AND     (({objectQualifier}Vendors.PortalId = @PortalId) or (@PortalId is null and {objectQualifier}Vendors.PortalId is null))
AND     {objectQualifier}Vendors.Authorized = 1
ORDER BY BannerId

GO

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

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DotNetNuke.Services.Exceptions.ModuleLoadException: Must declare the scalar variable "@ModuleID".  DotNetNuke.Services.Exceptions.ModuleLoadException: Must declare the scalar variable "@ModuleID".


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