2
Answers

display related data even if the needed data is 0

Hazel Mahmud

Hazel Mahmud

8y
313
1
hello...
 
 how do i display related data if the data i needed result is 0. 

 
 
i have the above Sql and the result are as shown but sometime there are result that doesn't exist but i want to display 0 at the count7 column with related where condition such as ans_ss_id, ans_term and so on as above result..  how do i do that..please someone help me..tq in advance
 
Answers (2)
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
You can get a string array containing the 6 attribute values using LINQ to XML as follows:

using System.Linq;
using System.Xml.Linq;
using System.IO;

// ...

XElement root = XElement.Load("maha.xml");
string[] values = root.Element("Serial").Element("Current").Attributes().Select(a => 
a.Value).ToArray();

You should find that:

values[0] will contain : 11 March 2011
values[1] will contain : 10 Rabi-Ul-Awal 1434

and so on.

It's then just a matter of assigning the appropriate values to your textblocks.