Error when convert my xsd schema

May 30, 2013 at 9:51 AM
visual studio 2012 give me these error when i convert xsd schema in class (with default parameter):
    <System.Xml.Serialization.XmlIgnoreAttribute()> _
    Public Property GestioneProdottoSpecified() As Boolean
        Get
            Return Me.gestioneProdottoField.HasValue
        End Get
        Set(value As Boolean)
            If value==false Then
                Me.gestioneProdottoField = null                        <- Error 
            End If
        End Set
    End Property

Errore 44 'null' non è dichiarato. La costante 'Null' non è più supportata. Utilizzare 'System.DBNull'. D:\Progetti\XSD\bitstream\xdsl.Designer.vb 3584 48 bitstream


Can any help me. Thanks.
Jul 28, 2013 at 8:30 PM
Looks like VB.NET code and if that is correct, there are 2 issues in the Set statement of the property.
  1. If value == false should only have 1 equal sign like this value = false
  2. Me.gestioneProdottoField = null should be Me.gestioneProdottoField = nothing
    <System.Xml.Serialization.XmlIgnoreAttribute()> _
    Public Property GestioneProdottoSpecified() As Boolean
        Get
            Return Me.gestioneProdottoField.HasValue
        End Get
        Set(value As Boolean)
            If value=false Then
                Me.gestioneProdottoField = nothing                         
            End If
        End Set
    End Property
Hope this helps...
It doesn't fix the code generation but it should at least allow your code to compile.