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.0DAL+ helpDAL+ help
Previous
 
Next
New Post
5/1/2009 11:44 PM
 
DAL+ help  Modified By najmeddine  on 5/2/2009 9:14:39 PM

despite I use codesmith template to generate a DAL+ data access layer I got the following error when i use the module to populate a text boxes :

Error: Emission is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Common.Utilities.CBO.FillObject(IDataReader dr, Type objType, Boolean ManageDataReader) at DotNetNuke.Common.Utilities.CBO.FillObject(IDataReader dr, Type objType) at Company.DNN.Modules.PA.Business.EmissionController.GetHoraireEmission(Int32 horaireID, Int32 moduleId) in C:\DotNetNuke40\App_Code\Emissions\EmissionController.vb:line 33 at Company.DNN.Modules.PA.Business.ListEmission.Page_Load(Object sender, EventArgs e) in C:\DotNetNuke40\DesktopModules\Emissions\ListEmission.ascx.vb:line 44 --- End of inner exception stack trace ---

this is the code from the Controller:

Public Function GetHoraireEmission(ByVal horaireID As Integer, ByVal moduleId As Integer) As EmissionHoraireInfo

 line 32 start here -->          Return CType(CBO.FillObject(DotNetNuke.Data.DataProvider.Instance().ExecuteScalar("HoraireEmissionsGet", horaireID, moduleId),    GetType(EmissionHoraireInfo)), EmissionHoraireInfo)

        End Function

and this is the code in the ascx page :

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

            Try
                Dim EmissionController As New EmissionController
                'Dim emissionHoraireInfo As New EmissionHoraireInfo
                Dim emissionHoraireItem As New EmissionHoraireInfo

          line 44 start here --->      emissionHoraireItem = EmissionController.GetHoraireEmission(HoraireID, ModuleId)

                If Not emissionHoraireItem Is Nothing Then
                    Label1.Text = emissionHoraireItem.HeureDebut.ToString()
                    Label2.Text = emissionHoraireItem.HeureFin.ToString()
                    Label3.Text = emissionHoraireItem.JourSemaine.ToString()
                End If



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



        End Sub

 

and thanks for intersting.

 
New Post
5/4/2009 12:55 PM
 

Resolved ! this is the solution

Public Shared Function GetHoraireEmission(ByVal horaireID As Integer, ByVal moduleId As Integer) As EmissionHoraireInfo
            Dim EmissionHoraireInfo As EmissionHoraireInfo = New EmissionHoraireInfo
            Using dr As IDataReader = DotNetNuke.Data.DataProvider.Instance().ExecuteReader("HoraireEmissionsGet", horaireID, moduleId)
                While dr.Read
                    EmissionHoraireInfo.HoraireID = Convert.ToInt32(dr("HoraireID"))
                    EmissionHoraireInfo.ModuleID = Convert.ToInt32(dr("ModuleID"))
                    EmissionHoraireInfo.EmissionID = Convert.ToInt32(dr("EmissionID"))
                    EmissionHoraireInfo.HeureDebut = Convert.ToString(dr("HeureDebut"))
                    EmissionHoraireInfo.HeureFin = Convert.ToString(dr("HeureFin"))
                    EmissionHoraireInfo.JourSemaine = Convert.ToString(dr("JourSemaine"))
                    EmissionHoraireInfo.JourSemaine = Convert.ToString(dr("ImagePath"))

                    'EmissionHoraireInfo.CreatedByUser = Convert.ToInt32(dr("CreatedByUser"))
                    'EmissionHoraireInfo.CreatedDate = Convert.ToDateTime(dr("CreatedDate"))
                End While
            End Using
            Return EmissionHoraireInfo
        End Function

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DAL+ helpDAL+ help


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