Hi Nico,
If you want to load the diagram from the data base then please refer to the following code snippet
// Connection string for the Org.mdb Access database
string connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + datasrc + ";";
OleDbConnection orgdbconnection = new OleDbConnection(connectionstring);
orgdbconnection.Open();
// Query to select all records from the Org.mbd database
string orgdbselectquery = "SELECT EmployeeID, Name, ManagerID FROM Employees";
OleDbCommand orgdbcommand = new OleDbCommand(orgdbselectquery, orgdbconnection);
// Create a connection to the datasource
// Execute the query command to build the data reader
OleDbDataReader orgdbreader = orgdbcommand.ExecuteReader();
// Extract employee data from the reader
while (orgdbreader.Read())
{
object[] employeedata = new object[3];
int count = orgdbreader.GetValues(employeedata);
// Create an Employee instance to represent each employee
Employee emply = new Employee();
emply.EmployeeID = employeedata[0].ToString();
emply.EmployeeName = (string)employeedata[1];
if (count == 3)
emply.ManagerID = employeedata[2].ToString();
htemployees.Add(emply.EmployeeID, emply);
}
// Close the reader
orgdbreader.Close();
// Close the connection
orgdbcommand.Connection.Close();
Please refer to our OrgLayout sample(My Documents\Syncfusion\EssentialStudio\5.1.0.51\Web\diagram.web\Samples\2.0\OrgLayout) for more details. You can see the data base file in "App_Data" folder of this application. I have attached the sample for your reference.
OrgChartSample.zipPlease refer to it and let me know if you have any questions.
Thanks,
Nagaraj