Visual C++ 2008 Express, Diagrams - diagramming

I'd like to get a graphic bar diagram out of some data (Percentages) calculated.
I've found the following class:
System::Windows::Forms::AccessibleRole::Diagram.
The intellisense tells me the:
"A graphical Immage used to diagram data"
Ok, now how do I use this in order to design the diagram?
How do I tell the system the type of diagram I want and
how do I associate the data to the varios bars?
Thanks and regards (hope to have expressed myself clear enough)
Uwe_98

Related

Context based (parameterised) Queries in Sparx EA

The Sparx Enterprise Architect Searches are great, however I would like to search for all requirements linked to a specific object (Activity) which I have included on a specific diagram. On that Diagram, I have added a model view (which can display a SQL query result)
My question is - Is there any way to obtain some sort of contextual perspective to use in the query? - essentially, I would like to know the diagram guid which the ModelView is being run by.
Personally I don't use Model Views, but AFAIK there's nothing extending SQL in that direction. You might want to send a feature request. But don't hold your breath.
On the other hand, if you hard code the GUID of a query, it will work for individual diagrams only. That calls for maintenance issues. Rather, you could stereotype diagrams and use that information in your query.

How to document sql query

For a Client of mine I'm documenting an existing database with a few tables and some queries.
For tables I'm using E-R Diagram to show tables and relationships. I'm doing that with DIA Diagram Editor.
How do I describe and visualize queries? There exist some sort of UML Object to do that?
So far, I've created a table with query name and a description of what it does and an example screenshot of data retrieved by the query itself. I'm doing that in Word.
I don't like the result of this work, there exist something more professional to do that?
I wouldn't install new software just know how database designers have to accomplish that task.
EDIT 1
As #Serg suggested I may use view and diagramm the view as an entity.
If I've understood something like:
What the client needs is to understand for each query where data come from.
EDIT 2
I'm doing something like the following:
Where
driver_tabella_utenti is a TABLE
driver_imp_causali_preparazione is a QUERY
driver_query_riepilogo_prsp is a QUERY
I think that isn't bast practice! How can I visual design sql queries as I do with entities and relationships?
Short summary
I see 2 options based on specification. This is only based on specification taken literally, not any additional research on the web.
Model class providing an operation representing what the SQL query does. Present a behavior describing this operation as a class stereotyped with <> and with linked object of a type OpaqueBehavior with provided values for attributes body (an SQL query) and language ('SQL').
Model class providing an operation representing what the SQL query does. Provide a note linked to the class containing description of respective OpaqueBehavior (body and language)
I've found another solution in the Specification
Model SQL query as action. The action can be depicted as usually in activity diagram (rectangle with rounded corners) and put SQL directly inside of the rectangle. The action needs to be a part of activity diagram (that is a description of a behaviour that utilizes this SQL).
Explanation
You can use a BehavioralFeature (e.g. Operation) to define that there is some SQL available (it sould be some class that exposes this operation) and then you can define a method with describing OpaqueBehavior (method) that contains body (SQL statement) and language ('SQL').
As specification does not provide any information about notation you can specify it either representing a method as an object (this is a specific instance of OpaqueBehavior) or using a note. In both cases it should be linked to a respective object describing the Behavior provided by the SQL statement as such (e.g. activity).
See 13.2.3.3 of UML Sepcification. Below is just the diagram describing this area.
Edit as a result of further research:
UML Specification describes literally your case in section 16.2 (as OpaqueAction). An example figure 16.8 in section 16.2.5.1 is exactly the case I've described as a 3rd possible answer.
Note however (as already mentioned in comments) that UML is not always the best suitable solution. While I strongly recommend modelling the system using UML, the SQL code itself should be a part of textual documentation that should be created together with the UML diagrams. It will benefit from more clarity, possibility to search, possibility to copy-paste the code etc. Also if your query is more than 2-3 short lines it might even hard to notice that it is still a part of an UML diagram.

A substitute for Visio for E-R modelling

I need to submit a college project proposal for a dbms on airline reservation systems along with the E-R diagram. Microsoft Visio is unaffordable so I tried using Dia v0.97.2.
Its easy to use but I can't figure out a way to get the diagram on a word document. I used the Copy diagram option but that doesn't get the complete diagram for me.
I tried including snapshots but since my reputation is less than 10 I couldn't.
Also what entities can be included for this system?
Did you try to export your Dia diagram in EMF or WMF format? This usually works quite well. You'll have to insert the EMF as an image in Word. If that still doesn't help you may have found a bug in Dia and should report it in Dia's Bugzilla in order to get it fixed (Most probably a sample diagram will be required to illustrate your problem) https://bugzilla.gnome.org/enter_bug.cgi
like steffen said, export is a good option! i would suggest exporting as png though, and then you can just drag'n'drop that image into your word document. personally, this is what i usually do :)

Import data into Server Management Studios diagram description fields

Suppose I have a big database, about 800 tables. In this database there is a table that serves as a metatable describing all of the fields of the other tables in the database, for documentation purposes. This table is read by a self written tool of the company I work at.
I'm new at the company and I'm rather inexperienced, so please forgive me for asking this...
In SSMS 2008 R2 I want to make an entity relationship diagram, which seems possible, which is great. I also see that it is possible to show a description for each field in the diagram, without clicking on a table/entity first to show the descriptions. Is there any way to automatically insert the relavant data of the previous mentioned "metatable" into the description/note entry of each field of the corresponding table shapes in the diagram? I could do it manually but I thought I better ask here before I do anything stupid (lot of work). I thought about SQL Procedures, but the thing I am trying to do involves the description fields of the diagram editor itsself, so I don't think that is covered with Transact SQL.
BTW, if somebody knows how to set/show the cardinality of the relationships in the diagramm please tell me.
By the way, we (the company) have Visio 2007 too (not that it would solve any of the problems..), but I'd like to use SSMS 2008 R2 first to set foreign keys (which are not there) and then import that into Visio through the reverse engineering option. Seems more logical for me, instead of using Visio in the first step. Of course I'm using a backup of our database.
The diagram description is not a property of the diagram it is a property of the table itself.
See sp_addextendedproperty in SQL Server books online:
http://msdn.microsoft.com/en-us/library/ms180047.aspx
You need to add an extended property with the name 'MS_Description'.
For a useful extended description, see here:
http://www.simple-talk.com/sql/sql-tools/towards-the-self-documenting-sql-server-database/

Visual Representation Of Database Schema

is there some standard about how to graphically represent database schemas? Is UML a defacto standard for this?
Also, is there some free tool that can help me convert an sql file (basically bunch of CREATE TABLE queries) into some nice graph (UML or not UML)?
You are looking for ERD:
http://en.wikipedia.org/wiki/Entity-relationship_model
As for a tool, visual Paradigm UML can help you model (with both UML and ERD). The community edition allows you to create ERD diagrams.
UML? No. Entity/relationship diagrams are de riguer for databases.
MySQL Workbench does a nice job.