How to parse the below xml string using linq to sql?
pXML: /p precodelt;shift_detailsgt; lt;shift_timegt;10:00 to
10:30lt;/shift_timegt; lt;countgt;0lt;/countgt; lt;shift_timegt;10:30 to
11:00lt;/shift_timegt; lt;countgt;0lt;/countgt; lt;shift_timegt;11:00 to
11:30lt;/shift_timegt; lt;countgt;0lt;/countgt; lt;shift_timegt;11:30 to
12:00lt;/shift_timegt; lt;countgt;0lt;/countgt; lt;shift_timegt;12:00 to
12:30lt;/shift_timegt; lt;countgt;0lt;/countgt; lt;/shift_detailsgt;
/code/pre pCode:/p precode var slots = from c in
xmlResponse.Descendants(shift_details) select new TimeSlots { time =
(string)c.Element(shift_time), count = (string)c.Element(count), };
customerCollection = new ObservableCollectionlt;TimeSlotsgt;(slots);
return customerCollection; /code/pre pThe above code return only one slot
item as output .but my xml contains too many records.How to read all
records in above xml?/p
No comments:
Post a Comment