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