What is wrong in my code ?
Thank you
Peter G.
<<code>>
/***************************************************************/
public class Lidmaatschap : ILoopBack
{
...
[UmlTaggedValue("Eco.AllowNULL", "True")]
[UmlTaggedValue("Eco.DefaultDBValue", "NULL")]
[UmlMetaAttribute("initialValue", "<NULL>")]
public DateTime LaatsteInschrijvingsdatum
{ get { return
((DateTime)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.LaatsteIn
schrijvingsdatum))); }
set {
this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.LaatsteInschrijvingsd
atum, ((object)(value))); }
}
/***************************************************************/
...
/***************************************************************/
if
(oLidmaatschap.AsIObject().Properties["LaatsteInschrijvingsdatum"].AsObject
== null)
{
MyControls.dtLaatsteInschrijving.Visible = false;
MyControls.lblLaatsteInschrijving.Visible = false;
}
else
{
MyControls.dtLaatsteInschrijving.Value =
oLidmaatschap.LaatsteInschrijvingsdatum;
}
It certainly looks correct.
What happens if you actually assign a null, i.e.
oLidmaatschap.AsIObject().Properties["LaatsteInschrijvingsdatum"].AsObje
ct = null;
is it still false?
> How can I test if an attribute is empty (or is holding a null).
> in my case, the condition if
> (oLidmaatschap.AsIObject().Properties["LaatsteInschrijvingsdatum"].AsO
> bject == null) is allways false
>
> What is wrong in my code ?
>
> Thank you
> Peter G.
>
> <<code>>
> /***************************************************************/
> public class Lidmaatschap : ILoopBack
> {
> ...
>
> [UmlTaggedValue("Eco.AllowNULL", "True")]
> [UmlTaggedValue("Eco.DefaultDBValue", "NULL")]
> [UmlMetaAttribute("initialValue", "<NULL>")]
> public DateTime LaatsteInschrijvingsdatum
> { get { return
> ((DateTime)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Laa
> tsteIn schrijvingsdatum))); }
> set {
> this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.LaatsteInschrij
> vingsd atum, ((object)(value))); }
> }
> /***************************************************************/
> ...
> /***************************************************************/
> if
> (oLidmaatschap.AsIObject().Properties["LaatsteInschrijvingsdatum"].AsO
> bject == null)
> {
> MyControls.dtLaatsteInschrijving.Visible = false;
> MyControls.lblLaatsteInschrijving.Visible = false;
> }
> else
> {
> MyControls.dtLaatsteInschrijving.Value =
> oLidmaatschap.LaatsteInschrijvingsdatum;
> }
--
Greetings
Peter G.
"Jan Nordén" <jan.n...@borland.com> schreef in bericht
news:44d7...@newsgroups.borland.com...