c# - Accessing structure array data of form1 in form2 -
here question.
i've custom structure follows in form1.
public struct messageinfo { public int messageposition; public string userid; public string putdatetime; public string id; public string messagelength; public string messagedata; }
i've multiple structure data, i'm storing in array of structures below
public messageinfo[] messages;
and i'm storing multiple data of each structure in array. now, want access structure array, has data in form2. advise how do this?
i tried below in form1, i'm unable access data in form2.
public messageinfo[] getmessageinfo { { return messages;} }
i following exception.
cannot implicitly convert type 'form1.messageinfo[]' 'form2.messageinfo[]'
thanks in advance.
regards, vinay
your exception telling have defined struct
in both forms. need define struct messageinfo
in one place , refer same both forms.
Comments
Post a Comment