private void exploreButton_Click(object sender, EventArgs e) { try { DataSourceStructure dbstruct = (DataSourceStructure)dbComboBox.SelectedValue; inspector.LoadDataSource(dbstruct); nodeListPanel.ShowNodes(dbstruct.Nodes); connListPanel.ShowRelationships(dbstruct.Relationships); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }
public void AutoExploreTest() { SystemMapEntities smdb = new SystemMapEntities(); string dbstring = smdb.Database.Connection.ConnectionString; SqlConnectionStringBuilder cbuilder = new SqlConnectionStringBuilder(dbstring); DbInspector sqlInspector = DbInspector.GetInstance(cbuilder); DataServerStructure serverData = sqlInspector.InitStructure(); sqlInspector.LoadData(); Assert.IsTrue(serverData.Databases.Count > 0); foreach (DataSourceStructure dbstruct in serverData.Databases) { if (dbstruct.DataSource.Name.Equals("SystemMap")) { sqlInspector.LoadDataSource(dbstruct); Assert.IsTrue(dbstruct.Nodes.Count > 0); Assert.IsTrue(dbstruct.Relationships.Count > 0); } } }