santosh kumar

santosh kumar

  • NA
  • 1
  • 1.9k

How to set object values to a property array type property

May 5 2011 3:03 AM
Hi Kesav,

Here i have a serializable class. it contains child classes please check the below sample

public partial class InvoiceInvoiceProperties {


.....
.....
private InvoiceInvoicePropertiesSpecialInstructions specialInstructionsField;

private InvoiceInvoicePropertiesReferenceInformation[] referenceInformationField;

}
public partial class InvoiceInvoicePropertiesReferenceInformation {

private uint referenceNumberField;

private object descriptionField;

private string referenceInformationIndicatorField;}

public partial class InvoiceInvoicePropertiesSpecialInstructions {

private string instructionIndicatorField;

private string valueField;
}
Here i assgned values to the properties by creating an object to that class.
and i added the child object to base class property
like

objInvoiceInvoiceProperties.SpecialInstructions = objInvoiceInvoicePropertiesSpecialInstructions;//normal property
ok it is working

when am assigning array type property it is showing error.
like
objInvoiceInvoiceProperties.ReferenceInformation = objInvoiceInvoicePropertiesReferenceInformation;//array type
here am getting error like cannot convert object to to array.i have tried many ways unable find the solutoion.


Please give me some idea on it.