Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with entities and varchar(max, null) fields
Message
 
 
À
12/12/2008 13:22:57
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01367002
Message ID:
01367006
Vues:
8
I believe I saw this question asked somewhere recently (ASP.NET forums). You have to set size of the string to some value.

>I have a field in my database which is of type varchar(max, null)
>The business entity generator has set this field as type string in the entity.cs file.
>However whenever I view the field in my program using entity.fieldname in a messagebox, I get the message cannot convert system.byte[] to system.string.
>Any thoughts?
>
>Code from my entity.cs file:
>
>/// <summary>
>            /// ReturnData
>            /// </summary>
>            public string ReturnData
>            {
>                  get
>                  {
>                        if (this.Row != null)
>                              return (string)mmType.GetNullableDbValue(this.Row["ReturnData"]);
>                        else
>                              return this._returnData;
>                  }
>                  set
>                  {
>                        if (this.Row != null)
>                              this.Row["ReturnData"] = mmType.SetNullableDbValue(value); 
>                        this._returnData = value;
>                        this.OnPropertyChanged(new PropertyChangedEventArgs("ReturnData"));
>                  }
>            }
>
>Thanks
>Rick
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform