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...SQL and SQL Ser...SQL and SQL Ser...Invalid Column Name Invalid Column Name 'LastForumsView'
Previous
 
Next
New Post
1/24/2011 10:17 AM
 
Hi,

I am trying to move a site into a shared hosting server of GoDaddy. I have the the site files and a .bak copy of the site's database.
I have copied the site files to the new location and created a new database on GoDaddy. Now I am trying to transfer the database from the .bak through SQL studio 2008. I was able to restore the database from the .bak file to my local machine. But, when I publish the database, I receive the following error:

TITLE: SqlManagerUI
------------------------------

An error occurred while trying to publish the following script:IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Forum_ForumUserViewsUpdate]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'


CREATE PROCEDURE [dbo].[Forum_ForumUserViewsUpdate]
(
@UserID int,
@ForumID int
)
AS
UPDATE dbo.Forum_Users
SET   
    [LastForumsView] = getdate()
WHERE  
    [UserID] = @UserID  

-- If read/unread tracking record for this user has not been created yet, create      
IF NOT EXISTS(SELECT UserID FROM dbo.Forum_ThreadsRead (nolock) WHERE ForumID = @ForumID AND UserID = @UserID)
BEGIN
print ''insert''
    INSERT dbo.Forum_ThreadsRead
        (UserID, ForumID, ReadThreads, LastPurseDate)
    VALUES
        (@UserID, @ForumID, '''', ''01/01/2000'')
END
'
END


------------------------------
ADDITIONAL INFORMATION:

Invalid column name 'LastForumsView'. (System.Web.Services)

------------------------------
BUTTONS:

OK
------------------------------


Can somebody guide me how to sort out this issue? Please let me know if any additional info is required.

Many Thanks,
Gipson
 
New Post
1/24/2011 1:28 PM
 
I had run into similar problems, although not with that particular Forums stored procedure, when I had migrated a site to GoDaddy at the request of a client. Such errors are one problem with the database publishing that GoDaddy requires be used instead of allowing a restore of a database created on a different SQL server.

I could not find the column LastForumsView or the stored procedure Forum_ForumUserViewsUpdate in the 5.00.00 release of DNN Forums so looked back through prior versions SQL scripts to see when they were dropped. Back in Forums v 04.03.00, the LastForumsView column was dropped from the Forum_Users table but while not in use in later versions, the stored procedure Forum_ForumUserViewsUpdate was never dropped thus leaving the old version in the database to trip up the database publishing wizard.

Assuming that your version of the Forums module is 4.03.00 or later you should be safe to delete the Forum_ForumUserViewsUpdate procedure from the database then attempt to publish the database to GoDaddy again. As I recall, I ended up redoing this five times with publishing proceeding a bit further each time until a database object reference error was found and the offending stored procedure deleted. Finally, it made it all the way through without error.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/25/2011 4:19 AM
 
Hi Bill,

Thanks for trying to help me with this :)

The site's DNN version is 04.09.03 and the Forum module's version is 04.04.03.

I tried following your suggestion of dropping the procedure, Forum_ForumUserViewsUpdate and republishing the DB. Now I receive the following error:

TITLE: SqlManagerUI
------------------------------

An error occurred while trying to publish the following script:IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Forum_AA_StatisticsSiteUpdate]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'


CREATE  PROCEDURE [dbo].[Forum_AA_StatisticsSiteUpdate]
(
@UpdateUserPostRank bit = 0,
@UpdateMostActiveUserList bit = 0,   
@ModuleID int,
@TabID int   
)
AS
-- Get summary information - Total Users, Total Posts, TotalTopics, DaysPosts, and DaysTopics
DECLARE @TotalUsers int
DECLARE @TotalPosts int
DECLARE @TotalTopics int
DECLARE @TotalModerators int
DECLARE @TotalModeratedPosts int
DECLARE @NewThreadsInPast24Hours int
DECLARE @NewPostsInPast24Hours int   
DECLARE @MostViewsThreadID int
DECLARE @MostActiveThreadID int       
DECLARE @MostActiveUserID int
DECLARE @NewUsersInPast24Hours int
DECLARE @MostReadThreadID int
DECLARE @TotalAnonymousUsers int
DECLARE @NewestUserID int
SET NOCOUNT ON
-- Total Anonymous Users
SET @TotalAnonymousUsers = 0
-- Total Moderators     
SET @TotalModerators = ISNULL((
                SELECT
                    count(DISTINCT UserID)
                FROM
                    dbo.Forum_Moderators FM (nolock)                   
                    INNER JOIN dbo.Forum_Forums F (nolock) ON FM.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID
                WHERE
                    G.ModuleID = @ModuleID   
                ), 0)   
-- Total Moderated Posts     
SET @TotalModeratedPosts = ISNULL((
                SELECT
                    count(*)
                FROM
                    dbo.Forum_ModerationAudit MA (nolock)
                    INNER JOIN dbo.Forum_Posts P (nolock) ON MA.PostID = P.PostID   
                    INNER JOIN dbo.Forum_Threads T (nolock) ON P.ThreadID = T.ThreadID
                    INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID
                WHERE
                    G.ModuleID = @ModuleID
                ),0)   
-- Most viewed thread     
SET @MostViewsThreadID = ISNULL((
                SELECT
                    TOP 1 T.ThreadID
                FROM
                    dbo.Forum_Threads T (nolock)                   
                    INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                WHERE
                    G.ModuleID = @ModuleID AND
                    F.IsPrivate = 0
                ORDER By
                    T.[Views] DESC
                ), 0)
-- Most active thread     
SET @MostActiveThreadID = ISNULL((
                SELECT
                    TOP 1 T.ThreadID
                FROM
                    dbo.Forum_Threads T   (nolock)                       
                    INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                WHERE
                    G.ModuleID = @ModuleID AND           
                    F.IsPrivate = 0
                    AND
                    F.IsActive = 1
                ORDER BY
                    T.Replies DESC
                ), 0)
-- Most active user   
SET @MostActiveUserID = ISNULL((
                SELECT
                    TOP 1 FU.UserID
                FROM
                    dbo.Forum_Users FU (nolock)                       
                    INNER JOIN dbo.Users U (nolock) ON FU.UserID = U.UserID   
                    INNER JOIN dbo.UserPortals UP (nolock) ON UP.UserID = U.UserID
                    INNER JOIN dbo.Tabs DT (nolock) ON UP.PortalID = DT.PortalID
                    INNER JOIN dbo.TabModules TM (nolock) ON DT.TabID = TM.TabID
                    INNER JOIN dbo.Modules DM (nolock) ON TM.ModuleID = DM.ModuleID
                WHERE
                    DM.ModuleID = @ModuleID AND
                    FU.EnableDisplayInMemberList = 1
                ORDER BY
                    FU.PostCount DESC
                ), 0)
-- Newest user - no need in DNN   
SET @NewestUserID = 0
-- Most read posts
SET @MostReadThreadID = 0   
SELECT
    -- Total Users       
    @TotalUsers = ISNULL((
                SELECT
                    COUNT(*)
                FROM
                    dbo.Forum_Users FU (nolock)                   
                    INNER JOIN dbo.UserPortals UP (nolock) ON UP.UserID = FU.UserID
                    INNER JOIN dbo.Tabs DT (nolock) ON UP.PortalID = DT.PortalID
                    INNER JOIN dbo.TabModules TM (nolock) ON DT.TabID = TM.TabID
                    INNER JOIN dbo.Modules DM (nolock) ON TM.ModuleID = DM.ModuleID                                   
                WHERE
                    DM.ModuleID = @ModuleID AND
                    DT.TabId = @TabId
                ) ,0) ,
    -- Total Posts
    @TotalPosts = ISNULL((
                SELECT
                    -- SUM(Replies + 1)
                    Count(PostID)
                FROM
                    dbo.Forum_Posts P (nolock)
                    INNER JOIN dbo.Forum_Threads T (nolock)  ON P.ThreadID = T.ThreadID                   
                    --dbo.Forum_Threads T (nolock)

                    INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                WHERE
                    G.ModuleID = @ModuleID
                    AND
                    F.IsActive = 1

                ), 0),
    -- Total Topics
    @TotalTopics = ISNULL((
                SELECT
                    COUNT(*)
                FROM
                    dbo.Forum_Threads T (nolock)                           
                    INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                    INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                WHERE
                    G.ModuleID = @ModuleID
                    AND
                    F.IsActive = 1
                ), 0),
       
    -- Total Posts in past 24 hours        
    @NewPostsInPast24Hours = ISNULL((
                    SELECT
                        COUNT(*)
                    FROM
                        dbo.Forum_Posts P (nolock)                           
                        Inner JOIN dbo.Forum_Threads T (nolock) ON T.ThreadID = P.ThreadID                           
                        INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                        INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                    WHERE
                        G.ModuleID = @ModuleID AND                       
                        P.IsApproved = 1 AND
               
        P.IsLocked = 0 AND
                        P.CreatedDate > DATEADD(dd,-1,getdate())
                    ), 0),
    -- Total Users in past 24 hours
    @NewUsersInPast24Hours = 0,   
    -- Total Topics in past 24 hours   
    @NewThreadsInPast24Hours = ISNULL((
                    SELECT
                        COUNT(*)
                    FROM
                        dbo.Forum_Posts P (nolock)                        
                        Inner JOIN dbo.Forum_Threads T (nolock) ON T.ThreadID = P.ThreadID                           
                        INNER JOIN dbo.Forum_Forums F (nolock) ON T.ForumID = F.ForumID
                        INNER JOIN dbo.Forum_Groups G (nolock) ON F.GroupID = G.GroupID                           
                    WHERE
                        G.ModuleID = @ModuleID AND
                        P.IsApproved = 1 AND
                        P.ParentPostID = 0 AND
                        P.CreatedDate > DATEADD(dd,-1,getdate())
                    ), 0)
    
    INSERT INTO dbo.Forum_statistics_Site
    SELECT
        CreatedDate = GetDate(),
        TotalUsers = @TotalUsers,
        TotalPosts = @TotalPosts,
        TotalModerators = @TotalModerators,
        TotalModeratedPosts = @TotalModeratedPosts,   
        TotalAnonymousUsers = @TotalAnonymousUsers,   
        TotalTopics = @TotalTopics,       
        NewPostsInPast24Hours = @NewPostsInPast24Hours,
        NewThreadsInPast24Hours = @NewThreadsInPast24Hours,
        NewUsersInPast24Hours = @NewUsersInPast24Hours,       
        MostViewsThreadID = @MostViewsThreadID,
        MostActiveThreadID = @MostActiveThreadID,
        MostActiveUserID = @MostActiveUserID,       
        MostReadThreadID = @MostReadThreadID,
        NewestUserID = @NewestUserID,   
        ModuleID = @ModuleID
    SET NOCOUNT OFF
'
END


------------------------------
ADDITIONAL INFORMATION:

Invalid column name 'IsPrivate'.
Invalid column name 'IsPrivate'. (System.Web.Services)

------------------------------
BUTTONS:

OK
------------------------------


I tried dropping the procedure Forum_AA_StatisticsSiteUpdate and republish the DB (I wasn't sure if it is okay to drop this). SQL Studio initiated dropping tables and upon dropping AddUserRole, it returned an internal error 'Internal error during cancel publish'.

Any idea where I went wrong and how to correct it?

Many Thanks,
Gipson
 
New Post
1/25/2011 9:31 AM
 
The Forum_AA_StatisticsSiteUpdate stored procedure appears to have been created in an earlier forum version and is used during the 04.04.03 forum upgrade to move statistics into a new table. Apparently it was never dropped in 04.04.03 and does reference a column (IsPrivate) of the Forum_Threads table which was removed. Hence the publishing error for that occured for this stored procedure. So, I believe that you were correct in removing it.

The publishing wizard has two distinct steps. 1) build scripts to publish each database object and 2) connect to the remote database server and run each of the scripts on the destination database thus "publishing" the database structure and its data. I believe that the "internal error on cancel publish" that you received this time indicates that step 1 was completed successfully and that step 2 has started. The error may mean that there is a problem connecting or that there was a problem when trying to drop database objects that had been already created on the remote database during the previous attempts.

Are you able to connect to the GoDaddy database from SSMS. If so, take a look to see what tables and stored procedures may have been already created. If you can connect and the remote database contains objects that have been published, you may want to delete the remote database and then create a new one. I recall that I had problems with connecting to the remote database because the one that the client had already created in his GoDaddy hosting account did not allow remote connections. That option could not be changed once the database was created and had to be turned on when creating a new database.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/26/2011 2:26 PM
 
Hi Bill,

I restored the local DB and started it all over again. This time, the DB publishing went smooth. Thanks!

BTW, after changing the portal alias in the new published DB, I tried loading up the site and I receive this error:

Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[PolicyException: Required permissions cannot be acquired.]
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7606579
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly 'ChilkatDotNet2, Version=8.6.0.0, Culture=neutral, PublicKeyToken=###############' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[Configurati sException: Could not load file or assembly 'ChilkatDotNet2, Version=8.6.0.0, Culture=neutral, PublicKeyToken=################' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
   System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
   System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
   System.Web.Compilation.BuildManager.CompileResourcesDirectory() +31
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +304

[HttpException (0x80004005): Could not load file or assembly 'ChilkatDotNet2, Version=8.6.0.0, Culture=neutral, PublicKeyToken=################' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729

[HttpException (0x80004005): Could not load file or assembly 'ChilkatDotNet2, Version=8.6.0.0, Culture=neutral, PublicKeyToken=################' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8894031
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333


Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016

I tried removing chilkatdotnet2.dll from the bin directory but it throws up a compilation error:

Compiler Error Message: BC30002: Type 'Web.HttpResponse' is not defined.

Source Error:

Line 32:         Implements System.Web.IHttpHandler
Line 33:
Line 34:         Private Sub RenderToResponseStream(ByVal Response As Web.HttpResponse, ByVal controller As XmlController)
Line 35:             ' save script timeout
Line 36:             Dim scriptTimeOut As Integer = HttpContext.Current.Server.ScriptTimeout


Is this a problem with the chilkatdotnet2.dll running in low or medium trust level? Can GoDaddy help me with this or is there a work around that you are aware of?

Many Thanks,
Gipson
 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Invalid Column Name Invalid Column Name 'LastForumsView'


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