Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefan 117 posts 215 karma points
    Aug 01, 2013 @ 15:27
    Stefan
    0

    Exception: table does not exist when accessing context menu

    Hi, 

    I have just installed your package (which went just fine). I had to logout to see the Usergroup Permissions entry in the context menu, but whenever I click it it throws an exception saying that the table does not exist.

    I'm running Umbraco 6.0.6 using WebMatrix (for development, not live just yet) with the default SqlCe database.

    [SqlCeProviderException: Error running Reader: 
    SQL Statement:
    select * from UserGroupPermissions_UserType2NodePermission where userTypeId = @userTypeId order by nodeId
    
    Exception:
    System.Data.SqlServerCe.SqlCeException (0x80004005): The specified table does not exist. [ UserGroupPermissions_UserType2NodePermission ]
       at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
       at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)
       at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)]
       SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) +184
       SqlCE4Umbraco.SqlCEHelper.ExecuteReader(String commandText, SqlCeParameter[] parameters) +37
       umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) +82
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteReader]
       umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) +202
       UserGroupPermissions.ExtensionMethods.UsertypeExtensions.GetPermissions(Int32 userTypeId) +145
       UserGroupPermissions.ExtensionMethods.UsertypeExtensions.GetPermissions(UserType userType, String path) +25
       UserGroupPermissions.Dialogs.SetUsergroupPermissions.OnInit(EventArgs e) +1278
       System.Web.UI.Control.InitRecursive(Control namingContainer) +134
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489


    Would it be possible to manually add the table to the database? And if thats the case, please outline the details for the table :)

    Thanks in advance! Can't wait to start using the package, since it will make my life a lot easier when givng out permissions to each individual user prior to going live!

  • Richard Soeteman 3722 posts 11521 karma points MVP
    Aug 02, 2013 @ 08:26
    Richard Soeteman
    0

    Hi Stefan,

    SQL CE wasn't an option for Umbraco when I wrote this package. I think the installer failed to create the tables. You will get no error messages about that. What you can do is open the package zip file and open package.xml in there you find the sql to create the database table. If you run that manually all should be good.

    Cheers,

    Richard

  • Stefan 117 posts 215 karma points
    Aug 03, 2013 @ 11:50
    Stefan
    0

    Okay, that makes sense :)

    WebMatrix was not able to execute the query, and since I'm not that much into modifying the SQL, I could not get it to accept the query. However, I did create the table and colums manually, and now the package is working.

    The only thing I need is to setup the correct relations. Could you please provide me with the following info:

    What should be the pk and fk keys and to what table should it relate to? Do I need to set any update- and delete rules?

    And what about the following options, do I need to set those somewhere for my database?

    WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    

    Thanks you for your help!

  • Richard Soeteman 3722 posts 11521 karma points MVP
    Aug 04, 2013 @ 07:40
    Richard Soeteman
    0

    Oh there is a key indeed. It's a combined key on the columns userTypeId, nodeId and permissions.

    The other options you can ignore they are sql server specific.

    Cheers,

    Richard

  • Stefan 117 posts 215 karma points
    Aug 06, 2013 @ 17:04
    Stefan
    0

    So now the question that remains unanswered is to which table it relates to? I figured that it might be the umbracoUser2NodePermission table, but since SqlCE don't support the same datatypes as Sql, I did not succeed in creating the relationship.

    Or am I missing something?

  • Richard Soeteman 3722 posts 11521 karma points MVP
    Aug 08, 2013 @ 08:12
    Richard Soeteman
    0

    Hi Stefan,

    It's not related to any other database table. Just a key for fast searching.

    Cheers,

    Richard

  • Stefan 117 posts 215 karma points
    Aug 09, 2013 @ 14:42
    Stefan
    0

    Excuse me for my stupidity; I can't figure out exactly how to add that key, and if it is even possible with SqlCE. In Visual Studio, I have selected UserGroupPermissionUserType2NodePermission -> Table Properties -> Add Relations. And from your last post I have selected UserGroupPermissionUserType2NodePermission as primary and foreign key table column and added each column. Please see the attached image for reference.

    Screenshot

    Does this seem correct to you? And do I need to give the relation a specific name?

  • Richard Soeteman 3722 posts 11521 karma points MVP
    Aug 09, 2013 @ 14:48
    Richard Soeteman
    0

    It's not a relation so that will not work I guess Doesn't it work without the index set up?

  • Stefan 117 posts 215 karma points
    Aug 09, 2013 @ 15:48
    Stefan
    0

    It does work alright, but I just want to have everything set up properly.

    Just wondering if that key is all that important, and how I can add it in SqlCE :)

Please Sign in or register to post replies

Write your reply to:

Draft