Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 451359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:57:39+00:00 2026-05-12T21:57:39+00:00

I’ve written a new DAL and BLL, but when I try to create an

  • 0

I’ve written a new DAL and BLL, but when I try to create an instance of my class, I get an Object Reference error, is there anything particular I should be looking for? I am fairly new to this concept?

Call is such:

Protected Sub btnSignin_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSignin.Click
    Dim l As New Log()
    l.Log = "Attempted staff login with username [" & txtUsername.Text & "] and password [" & txtPassword.Text & "]"
    l.LogId = 0
    l.StaffId = 0
    l.LogDate = Date.Now()
    l.Insert()

The ‘Insert’ call which is where I get the reference error, calls these functions in my BLL (BLL/Log.vb);

Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Imports System.Transactions
Imports System.Text
Imports Harmony.Zizz.DAL
Namespace Harmony.Zizz.BLL.Zizz
    Public Class Log
        Inherits BaseZizz

        Protected _logid As Integer = 0
        Protected _log As String = ""
        Protected _staffid As Integer = 0
        Protected _logdate As DateTime = Date.Now

        Public Sub New()

        End Sub

        Public Sub New(ByVal logid As Integer, ByVal log As String, ByVal staffid As Integer, ByVal logdate As DateTime)

        End Sub

'////property setup removed for brevity ////
        Public Property LogId() As Integer
        Public Property Log() As String
        Public Property LogDate() As DateTime

        Public Function Insert() As Integer
            Return Harmony.Zizz.BLL.Zizz.Log.InsertLog(Me.LogId, Me.Log, Me.StaffId, Me.LogDate)
        End Function

        Public Shared Function InsertLog(ByVal logid As Integer, ByVal log As String, ByVal staffid As Integer, ByVal logdate As DateTime) As Integer
            HttpContext.Current.Trace.Write("Fired InsertLog BLL (log.vb) Line 61")
            Using scope As New TransactionScope()
                HttpContext.Current.Trace.Write("Within InsertLog BLL Transaction Scope (log.vb) Line 63")
                Dim record As New LogDetails(logid, log, staffid, logdate)
                HttpContext.Current.Trace.Write("Created LogDetails Object InsertLog BLL (log.vb) Line 65")
                Dim ret As Boolean = SiteProvider.Zizz.InsertLog(record)
                HttpContext.Current.Trace.Write("Inserted LogDetails object into SiteProvider InsertLog BLL (log.vb) Line 61")
                scope.Complete()
                Return ret
            End Using
        End Function

    End Class
End Namespace

The stack trace gets to the Dim ret As Boolean = SiteProvider line. The SiteProvider calls contains this code, which is where I think the error originates, but have no idea why – or how to fix — :

Imports Microsoft.VisualBasic
Namespace Harmony.Zizz.DAL
    Public NotInheritable Class SiteProvider
        Public Shared ReadOnly Property Zizz() As ZizzProvider
            Get
                Return ZizzProvider.Instance
            End Get
        End Property
    End Class
End Namespace

Help, if able to be given, would be hugely appreciated. Intellisense highlights no problems and if I Build the web site in VS I get a few warnings about schema information in the web.config (unrelated), otherwise no problem.

Help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:57:39+00:00Added an answer on May 12, 2026 at 9:57 pm

    Chris,

    I agree with slugster in his answer that it is probably the fact that ZizzProvider.Instance is Nothing. This is most likely due the the way it is implemented. I assume Instance is a property, if so, then check this property (in the property block) when returning the instance, check first to see if the instance is Nothing – if it is, new up an instance and store it off in the class before returning it. If you can give us the code to this ZizzProvider, we might be able to help a bit further.

    I hope this helps,

    Thanks!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I know there's a lot of other questions out there that deal with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.