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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Passing Boolean Null From SqlDataProvider to Stored Procedure?Passing Boolean Null From SqlDataProvider to Stored Procedure?
Previous
 
Next
New Post
6/2/2006 3:48 PM
 
I hate to bring this up again.  But...

This solution doesn't quite work.  Now whenever I pass a False value to the booleans they end up as NULL in the database.  If pass True it becomes True in the database.  If I pass NULL it becomes NULL in the database.

Like plugging holes in a dyke....  I'll try setting a default value in the database to false and see what that yields.

I'm too poor for anything other than the community version
 
New Post
6/2/2006 3:53 PM
 
That didn't work.

I am really beginning to hate this.

I'm too poor for anything other than the community version
 
New Post
6/2/2006 5:04 PM
 
I know that my object actually does have the value of False when I assign it.

RynoStats.applyENJPT = False

So somewhere as a result of the controller calling the AddRynoStats method (ie the DAL) the value of False is getting converted to NULL.

I'm almost positive my earlier hunch is correct.  It is the GETNULL() method that is messing me up.  So I'm trying to make my own which will be called in the SqlDataProvider as far as booleans are concerned.  I want it to check to see if the property value is False and if so...simply return the object back.  I'm just not sure how to check if the property is false first.  Since the GetNull takes it as an object...if I convert it the object to a boolean I *think* that converts a null value to a False.  Because this new GetNull function turns NULLs into False.  Does anyone know of a way I can examine the Field Object to find the value of null, true, or false without converting  it to a boolean?

Private Function GetNullBool(ByVal Field As Object) As Object

            If CType(Field, Boolean) = False Then
                Return Field
            Else
                Return DotNetNuke.Common.Utilities.Null.GetNull(Field, DBNull.Value)
            End If

        End Function


I'm too poor for anything other than the community version
 
New Post
6/2/2006 5:47 PM
 
Well it looks like some part of the DAL is converting my null.nullboolean over to FALSE somewhere before the SqlDataProvider call to my modified GetNull function.  Not sure where though.

Private Function RynoGetNullBool(ByVal Field As Object) As Object
            ' Unfotunately this never finds that Field = null.nullboolean so it must have been converted prior to getting here
            If Not CType(Field, Boolean) = DotNetNuke.Common.Utilities.Null.NullBoolean Then
                Return Field
            Else
                Return DotNetNuke.Common.Utilities.Null.GetNull(Field, DBNull.Value)
            End If

        End Function

Here is what frustrates me.  My InfoObject boolean property can hold THREE values.  Null, True, False.  My SQL DataBase can hold three values for the field, as well.  So why is this getting lost in the DNN DAL translation???!!

I'm too poor for anything other than the community version
 
New Post
6/2/2006 5:53 PM
 
I'm wrong.  Evidently my Info Object cannot hold three values.  If I assign rynostats.applyenjpt = null.nullboolean it immediately becomes set to false in the object.

So the culprit is the declaration of the Info Object somewhere as Cathal pointed out.  However, it appears I can only store TWO values in my Info Object boolean property.  Is this the case?  Can I not have it set to null, true, or false?

I'm too poor for anything other than the community version
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Passing Boolean Null From SqlDataProvider to Stored Procedure?Passing Boolean Null From SqlDataProvider to Stored Procedure?


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