Hi; Is there a simple and smart why to do this? I whould like to ceate a db diagram through C# code or run ADO query, or use SMO if it is possible. Thanks
Hi; Is there a simple and smart why to do this? I whould like to ceate a db diagram through C# code or run ADO query, or use SMO if it is possible. Thanks
I'm not sure in SMO gives you a way to do this or not. The database diagram is simply stored in the database in a table. It doesn't actually have anything to do with the operation of the database. It is used by the EM or SSMS (depending on your SQL version) to show you the foreign keys in the database and how they link together.
Hi mrdeny thanks for replying. So if i created a data base dinamically with SMO, and created all the tables i need, dinamically, with queries through ADO.Net. How do i create the diagrams?
For now, i craete the 'systable' like above, and insert the diagram data the same why. I get the (hard coded data) from the source data base by creating the diagrams, selectins all from 'sysdiagrams' and get the lond hexadecimal data of the definution column.
This solution is a simpler why then the use of the 'Tool_ScriptDiagram2005' stored procidure, that runs as the only solution (i saw) on the net.
Both of the solutions does not seem to me a the wright why.
Any ideas?
Thanks Oren.
No one has followed this question yet.