How can we add spouse the family tree script? What can we change the database and the scripts?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Configuration;
using System.Data.OleDb;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
[WebMethod]
public static List<object> GetChartData()
{
string query = "SELECT MemberId, Name, ParentId";
query += " FROM FamilyHierarchy";
using (OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; DATA Source=" + HttpContext.Current.Server.MapPath("app_data/familytree.accdb")))
{
using (OleDbCommand cmd = new OleDbCommand(query))
{
List<object> chartData = new List<object>();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
using (OleDbDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
chartData.Add(new object[]
{
sdr["MemberId"], sdr["Name"], sdr["ParentId"]
});
}
}
con.Close();
return chartData;
}
}
}
}