Copied to clipboard

Flag this post as spam?

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


  • vijay 129 posts 152 karma points
    Jan 19, 2010 @ 08:38
    vijay
    0

    How to read User Types?

    Hi all,

     I am reading user types like below it is giving me following error

    The type initializer for 'umbraco.BusinessLogic.UserType' threw an exception.

     dt = new DataTable();
                dt.Columns.Add(new DataColumn("UserTypeText",typeof(string)));
                dt.Columns.Add(new DataColumn("UserTypeID",typeof(string)));
                DataRow dr;
                dr = dt.NewRow();
                dr["UserTypeText"] = "Please select type";
                dr["UserTypeID"] = "0";
                dt.Rows.Add(dr);

                List<UserType> userTypes = UserType.GetAllUserTypes();--------------> Here i am getting Error
                foreach (UserType userTypeText in userTypes)
                {
                    dr = dt.NewRow();
                    if (userTypeText.Name.ToString().IndexOf("WCMS.") != 0)
                    {
                        dr["UserTypeText"] = userTypeText.Name.ToString();
                        dr["UserTypeID"] = userTypeText.Id.ToString();
                        dt.Rows.Add(dr);
                    }
                }
                return dt;
            }

     

    ---vijay.

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jan 19, 2010 @ 22:33
    Aaron Powell
    0

    Stack traces are generally useful. But my assumption is that you're missing one or more references.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies