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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0HELP!!! DNN site is inaccessible after a compilation error with module development attempt!HELP!!! DNN site is inaccessible after a compilation error with module development attempt!
Previous
 
Next
New Post
1/26/2007 9:51 AM
 

I was following the module development exercise in the book "Building Websites with VB.NET and DotNetNuke 4" by Daniel N. Egan, Michael Washington, and Steve Valenzuela. It was the chapter (Chapter 8) on "Connecting to the Database" that my site got killed.

I followed all the instructions & used the code I downloaded from the publisher's web site. The files CoffeeShopListingOptionsController.vb, Settings.ascx, and Settings.ascx.vb cannot be compiled successfully due to some errors/problems the codes in them. Since I don't know enough of the language VB.NET and how to utilize it for database connection, I am stuck and can't fix the bugs. I hope someone can help me (or someone who has read the book and know about the exercise/tutorial).

Here is the code and the corresponding errors in the 3 files:

--------------------------------------------------------------
FILE: CoffeeShopListingOptionsController.vb

<CODE>

Imports System
Imports System.Data
Imports System.Collections.Generic

Namespace EganEnterprises.CoffeeShopListing
    Public Class CoffeeShopListingOptionsController
        Public Function EganEnterprises_GetCoffeeShopModuleOptions(ByVal ModuleId As Integer) As List(Of CoffeeShopListingOptionsInfo)
            Return CBO.FillCollection(Of CoffeeShopListingOptionsInfo)(CType(DotNetNuke.Data.DataProvider.Instance().ExecuteReader("EganEnterprises_GetCoffeeShopModuleOptions", ModuleId), IDataReader))
        End Function
        Public Function EganEnterprises_UpdateCoffeeShopModuleOptions(ByVal objShopListOptions As EganEnterprises.CoffeeShopListing.CoffeeShopListingOptionsInfo) As Integer
            Return CType(DotNetNuke.Data.DataProvider.Instance().ExecuteScalar("EganEnterprises_UpdateCoffeeShopModuleOptions", objShopListOptions.moduleID, objShopListOptions.AuthorizedRoles), Integer)
        End Function
        Public Function EganEnterprises_AddCoffeeShopModuleOptions(ByVal objShopListOptions As EganEnterprises.CoffeeShopListing.CoffeeShopListingOptionsInfo) As Integer
            Return CType(DotNetNuke.Data.DataProvider.Instance().ExecuteScalar("EganEnterprises_AddCoffeeShopModuleOptions", objShopListOptions.moduleID, objShopListOptions.AuthorizedRoles), Integer)
        End Function
    End Class
End Namespace

</CODE>

ERROR: DotNetNuke.Data.DataProvider.Instance().ExecuteReader
MESSAGE: 'ExecuteReader' is not a member of 'DotNetNuke.Data.DataProvider'.

ERROR: DotNetNuke.Data.DataProvider.Instance().ExecuteScalar
MESSAGE: 'ExecuteScalar' is not a member of 'DotNetNuke.Data.DataProvider'.

--------------------------------------------------------------
FILE: Settings.ascx

<CODE>

<%@ Control language="vb" AutoEventWireup="false" Inherits="EganEnterprises.CoffeeShopListing.Settings"  CodeFile="Settings.ascx.vb"%>
<%@ Register TagPrefix="Portal" TagName="DualList" Src="~/controls/DualListControl.ascx" %>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="1">
 <tr>
  <td>
   <p align="center">ShopListOptions</P>
  </td>
 </tr>
 <tr>
  <td><portal:duallist id="ctlAuthRoles" runat="server" ListBoxWidth="130" ListBoxHeight="130" DataValueField="Value"
    DataTextField="Text" /></td>
 </tr>
</table>

</CODE>

ERROR: portal:duallist
Message: Element 'duallist' is not a known element. This can occur if there is a compilation error in the web site.

--------------------------------------------------------------
FILE: Settings.ascx.vb

<CODE>

Imports DotNetNuke
Imports DotNetNuke.Security.Roles
Imports System.Web
Imports System.Collections.Generic
Imports System.Web.UI.WebControls

Namespace EganEnterprises.CoffeeShopListing

    Partial Class Settings
        'Inherits Entities.Modules.PortalModuleBase
        Inherits DotNetNuke.Entities.Modules.ModuleSettingsBase

#Region "Base Method Implementations"

        Public Overrides Sub LoadSettings()
            Try
                ' declare roles
                Dim arrAvailableAuthRoles As New ArrayList
                Dim arrAssignedAuthRoles As New ArrayList

                ' Get list of possible roles
                Dim objRoles As New RoleController
                Dim objRole As RoleInfo
                Dim arrRoles As ArrayList = objRoles.GetPortalRoles(PortalId)

                'String of roles for shoplist
                Dim objShopRoles As New CoffeeShopListingOptionsController
                Dim objShopRole As CoffeeShopListingOptionsInfo
                Dim arrShopRoles As List(Of CoffeeShopListingOptionsInfo) = objShopRoles.EganEnterprises_GetCoffeeShopModuleOptions(ModuleId)

                'Put roles into a string
                Dim shopRoles As String = ""

                For Each objShopRole In arrShopRoles
                    'If it makes it here then we will be updating
                    shopRoles = objShopRole.AuthorizedRoles.ToString
                Next


                'Now loop through all avalible roles in portal
                For Each objRole In arrRoles
                    Dim objListItem As New ListItem

                    objListItem.Value = objRole.RoleID.ToString()
                    objListItem.Text = objRole.RoleName.ToString()

                    'If it matches a role in the ShopRoles string put
                    'it in the assigned box
                    If shopRoles.IndexOf(objRole.RoleID & ";") <> -1 Or objRole.RoleID = PortalSettings.AdministratorRoleId Then
                        arrAssignedAuthRoles.Add(objListItem)

                    Else ' put it inthe avalible box
                        arrAvailableAuthRoles.Add(objListItem)

                    End If
                Next

                ' assign to duallist controls
                ctlAuthRoles.Available = arrAvailableAuthRoles
                ctlAuthRoles.Assigned = arrAssignedAuthRoles
            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub


        Public Overrides Sub UpdateSettings()
            Try
                Dim objShopRoles As New CoffeeShopListingOptionsController
                Dim objShopRole As New CoffeeShopListingOptionsInfo
                Dim item As ListItem
                Dim strAuthorizedRoles As String = ""
                For Each item In ctlAuthRoles.Assigned
                    strAuthorizedRoles += item.Value & ";"
                Next item

                objShopRole.AuthorizedRoles = strAuthorizedRoles
                objShopRole.moduleID = ModuleId
                Dim intExists As Integer
                intExists = objShopRoles.EganEnterprises_UpdateCoffeeShopModuleOptions(objShopRole)
                If intExists = 0 Then 'New record
                    objShopRoles.EganEnterprises_AddCoffeeShopModuleOptions(objShopRole)
                End If

            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

#End Region

    End Class
End Namespace

</CODE>

ERROR: ctlAuthRoles.Available = arrAvailableAuthRoles
MESSAGE: Name 'ctlAuthRoles' is not declared.

--------------------------------------------------------------


Any assistance is appreciated. Or any advice in how to roll the site and database back to the state before this madness is extremely welcome too.

Thanks in advance!
jc

 

 
New Post
1/26/2007 4:00 PM
 

I wrote the chapter

The errors are not in the code. There is another error that is causing the site to not compile so other errors show up. The errors will go away when the original error is cleared up.

I hope this is not a production site that is crashed? If so what is the error message you are receiving?

Which step did you make that "got my site killed"?



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/26/2007 5:06 PM
 

Hello, Michael. Thanks for extending a hand!

Fortunately, it is not a production site . . . wheeeeeuuuh! Nonetheless, even if it is the company's development site, it is quite bad because I am at a standstill (and this is Friday) since I don't know how to fix it. I can always roll the site back to the state before all of my module development exercises by restoring my site backups and database backups (I assume that can bring my site back, right?) But since I want to learn something here, I am struggling on . . .

The error messages are under each of the 3 files I posted with my original post:

* For the CoffeeShopListingOptionsController.vb file, the 2 error messages are about the "DotNetNuke.Data.DataProvider.Instance().ExecuteReader" & "DotNetNuke.Data.DataProvider.Instance().ExecuteScalar" . . . that they are not a member of 'DotNetNuke.Data.DataProvider'.

* For the Settings.ascx file, the error message is about the "portal:duallist" . . . that element 'duallist' is not a known element.

* For the Settings.ascx.vd file, the error message is about the "ctlAuthRoles.Available = arrAvailableAuthRoles" . . . that the name 'ctlAuthRoles' is not declared.

I followed the steps to the dot. I was at Page 199, after having saved all the files and built the page/code, then I got the error messages in my Output Window of VS2005. And sure enough, when I went to my site with 3 portals in it (with IE browser), I got the following error message in my browser window:

--------------------------------------------

Server Error in '/DotNetNuke' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'ExecuteReader' is not a member of 'DotNetNuke.Data.DataProvider'.

Source Error:

Line 6: Public Class CoffeeShopListingOptionsController

Line 7: Public Function EganEnterprises_GetCoffeeShopModuleOptions(ByVal ModuleId As Integer) As List(Of CoffeeShopListingOptionsInfo)

Line 8: Return CBO.FillCollection(Of CoffeeShopListingOptionsInfo)(CType(DotNetNuke.Data.DataProvider.Instance().ExecuteReader("EganEnterprises_GetCoffeeShopModuleOptions", ModuleId), IDataReader))

Line 9: End Function

Line 10: Public Function EganEnterprises_UpdateCoffeeShopModuleOptions(ByVal objShopListOptions As EganEnterprises.CoffeeShopListing.CoffeeShopListingOptionsInfo) As Integer

Source File: C:\DotNetNuke\App_Code\CoffeeShopListing\CoffeeShopListingOptionsController.vb Line: 8

--------------------------------------------

 

While I did realize that it could be just one very small error that caused the cascading effect (with other errors), I don't what it is, plus I am a relatively newbie to DNN in terms of the backend development, I don't know where to look.

Any help/suggestions/comments is extremely appreciated!

Thanks again!

jc

 

 
New Post
1/26/2007 5:16 PM
 

For now you can remove the coffeeshop directory under desktopmodules and all the pages in the coffeeshop directory under app_code (do not remove the coffeeshop directory under the app_code directory because you may have a entry for it in your web.config file and that will cause another error).

This will get your site back. There is no need to restore the database.

contact me offine (webmaster@adefwebserver.com) so we can walk through this. I will be out of town until Sunday.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/26/2007 6:14 PM
 

Thanks for the CoffeeShop removal instructions, Michael.

Now my development site is back, I can at least feel a bit better about leaving the office for the weekend.

I'll contact you offline on Monday. Thanks so much!!!!

Have a good weekend :)

jc

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0HELP!!! DNN site is inaccessible after a compilation error with module development attempt!HELP!!! DNN site is inaccessible after a compilation error with module development attempt!


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