Problem with CAST NOT VALID


Author
Message
Tony Charpentier
Tony Charpentier
StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)
Group: StrataFrame Users
Posts: 10, Visits: 81
hello,

I' have a little problem when i call a BO with type System.Int32.

ex:
this.TXT_ETAGETOT.Text                  = oAffairesBo.etage.ToString().Trim();


My error message :

Le cast spécifié n'est pas valide.

Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.InvalidCastException: Le cast spécifié n'est pas valide.

Erreur source:

Ligne 2742 : get
Ligne 2743 : {
Ligne 2744 : return (System.Int32)this.CurrentRow["etage"];
Ligne 2745 : }
Ligne 2746 : set


Have you an idea ?

thanks
Tony

Reply
Michel Levy
Michel Levy
StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)StrataFrame User (329 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Tony,

That's it! saying "don't allow Null", you ask your BO to reject NULL, and by consequence, to throw an error if there are NULLS... exactly the opposite you want Crying I think it is a side effect of the french grammer order and minding (opposite as the american mainding). And that's what I've seen in the code of the BO Designer you sent to me.

In the BO Mapper, you need to choose Generic on Null, or get/set a specific value (as I show you in the french speaking StrataFrame forum)

------

En français maintenant...

Eh paf! en choisissant "Don'allow Null", tu demandes à ton BO de refuser les NULL, et donc il te lève une erreur s'il en trouve. c'est pile poil le contraire de ce que tu veux Crying Je pense que c'est la conséquence des la façon de penser et de construire la grammaire française (à l'opposé de la grammaire anglo-américaine). Et c'est ce que j'ai vu dans le code du BO Designer que tu m'as envoyé.

Dans le BO Mapper,il te faut choisir Generic on Null, ou forcer une valeur précise pour le get/set, comme je te le montre sur le forum francophone.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search