vendredi 9 septembre 2016

Convert different types of objects and list in Datatable C#

I am new to Data Components in C# and I aa trying to convert 2 different objects and 1 list object in datatable but not able to do so.

My two objects are p_avail

pna_response.PriceAndAvailability p_avail = new pna_response.PriceAndAvailability();

p_avail object has following member variables: name, quantity price, branch(list type)

header_details object has following member variables: senderid, recieverid, date

list_branch contains the object of type branch where branch has member variables called orderdate, ordered, location

Other object is header_details

 pna_response.TransactionHeader header_details = new pna_response.TransactionHeader();

List object is list_branch

List<pna_response.Branch> list_branch = new List<pna_response.Branch>();

Now I want to convert all of the above objects in datatable to display data from any of data component

Aucun commentaire:

Enregistrer un commentaire