how to call a function in c# which return type is array.
- by Manoj Wadhwani
public CD[] GetCDCatalog()
{
XDocument docXML =
XDocument.Load(Server.MapPath("mydata.xml"));
var CDs =
from cd in docXML.Descendants("Table")
select new CD
{
title = cd.Element("title").Value,
star = cd.Element("star").Value,
endTime = cd.Element("endTime").Value,
};
return CDs.ToArray<CD>();
}
I am calling this function on page load
ie. string[] arr = GetCDCatalog();
but this is giving Error Cannot implicitly convert type 'Calender.CD[]' to 'string[]'
Please suggetst how can i call function on page load which return type is array.