Hi,
Please refer the below sample. In this sample, datas are collected from the database and symbols are created accordingly. And then links are established between the symbols and the symbols are arranged using the DirectedTreeLayoutManager.
The data is collected from the database as shown in the code snippet below,
[C#]
private void LoadData(string tablename)
{
string datasrcpath = Server.MapPath(String.Empty);
datasrcpath = datasrcpath + @"\App_Data\Country.mdb";
// Connection string for the Org.mdb Access database
string connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + datasrcpath + ";";
OleDbConnection orgdbconnection = new OleDbConnection(connectionstring);
// Query to select all records from the Org.mbd database
string orgdbselectquery = "SELECT * FROM " + tablename;
//CreateMajorSymbols(tablename);
OleDbCommand orgdbcommand = new OleDbCommand(orgdbselectquery, orgdbconnection);
// Create a connection to the datasource
orgdbconnection.Open();
// Execute the query command to build the data reader
OleDbDataReader orgdbreader = orgdbcommand.ExecuteReader();
// Extract employee data from the reader
while (orgdbreader.Read())
{
object[] data=new object[3];
int count=orgdbreader.GetValues(data);
string[] st = new string[10];
string[] str = new string[10];
for (int i = 0; i < count; i++)
{
st[i] = data[i].ToString();
str[i] = orgdbreader.GetName(i);
}
if (tablename == "Country")
{
CreateCountryMajorSymbol(st,tablename,str);
}
} // Close the reader
orgdbreader.Close();
// Close the connection
orgdbcommand.Connection.Close();
}
Sample:
https://www.syncfusion.com/Support/user/uploads/UMLDiagram_b652b219.zipPlease try this and let us know if this helps.
Thank you for your interest in Essential Diagram.
Regards,
Ramya