[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Read (and Visualize) DB Schema from SQL Server

send.me.all.email

5/17/2007 12:59:00 PM

Hi experts,

which approaches would you suggest for:

- Reading a database schema (tables, fields, relationships) from SQL
Server 2005?
- Visualizing the DB schema?

For developing a DB tool the schema should be read from the server and
then be visualized, e.g. like the SQL Server BI Development Studio
does when importing the whole schema to a data source view.

Any ideas and hints on how to start approaching this (either reading
schema and/or visualizing it) using .NET (preferably C#) are welcome!


Regards,
Max

8 Answers

Kerry Moorman

5/17/2007 1:10:00 PM

0

Max,

http://support.microsoft.com...

I usually display the schema table info in a grid by binding the returned
table to a control like a datagridview.

Kerry Moorman


"send.me.all.email@googlemail.com" wrote:

> Hi experts,
>
> which approaches would you suggest for:
>
> - Reading a database schema (tables, fields, relationships) from SQL
> Server 2005?
> - Visualizing the DB schema?
>
> For developing a DB tool the schema should be read from the server and
> then be visualized, e.g. like the SQL Server BI Development Studio
> does when importing the whole schema to a data source view.
>
> Any ideas and hints on how to start approaching this (either reading
> schema and/or visualizing it) using .NET (preferably C#) are welcome!
>
>
> Regards,
> Max
>
>

send.me.all.email

5/18/2007 2:35:00 PM

0

On 17 Mai, 15:10, Kerry Moorman
<KerryMoor...@discussions.microsoft.com> wrote:

> http://support.microsoft.com...
>
> I usually display the schema table info in a grid by binding the returned
> table to a control like a datagridview.

Thanks a lot for this hint, Kerry! Using the code presented in the
knowledge base article I was able to read the basic schema
information.

Now that I have the schema information, the problem is visualizing it
neatly in a GUI. Something like: Tables are depicted as boxes,
containing the fields of the table as rows showing the name and type
of the field. Fields acting as primary or foreign keys are specially
marked. Relationships between tables are depicted as lines connecting
the tables. The graphical representation should be used to enable the
user to navigate the schema, select a table and perform basic
operations on them.

Which .NET framework could I use to realize such a graphical
representation of the schema?


Regards,
Max

Kerry Moorman

5/18/2007 4:02:00 PM

0

Max,

I have always used the schema information for myself as a developer, so my
presentation usually just consists of displaying the data in a grid.

For your needs you might want to model your presentation on something like
SQL Server''s Management Studio.

You could use a Treeview control in a pane on the left and a grid control in
a pane on the right to allow the user to view, navigate and interact with the
data.

Anything more sophisticated would really be turning into an
Entity-Relationship Diagramming application and that would be a considerable
undertaking.

Kerry Moorman


"send.me.all.email@googlemail.com" wrote:

> On 17 Mai, 15:10, Kerry Moorman
> <KerryMoor...@discussions.microsoft.com> wrote:
>
> > http://support.microsoft.com...
> >
> > I usually display the schema table info in a grid by binding the returned
> > table to a control like a datagridview.
>
> Thanks a lot for this hint, Kerry! Using the code presented in the
> knowledge base article I was able to read the basic schema
> information.
>
> Now that I have the schema information, the problem is visualizing it
> neatly in a GUI. Something like: Tables are depicted as boxes,
> containing the fields of the table as rows showing the name and type
> of the field. Fields acting as primary or foreign keys are specially
> marked. Relationships between tables are depicted as lines connecting
> the tables. The graphical representation should be used to enable the
> user to navigate the schema, select a table and perform basic
> operations on them.
>
> Which .NET framework could I use to realize such a graphical
> representation of the schema?
>
>
> Regards,
> Max
>
>

William \(Bill\) Vaughn

5/18/2007 8:45:00 PM

0

You mean besides the Database Diagrams supported in SQL Server EM and MS and
since VB classic?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker''s Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker''s Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<send.me.all.email@googlemail.com> wrote in message
news:1179406739.890052.297040@e65g2000hsc.googlegroups.com...
> Hi experts,
>
> which approaches would you suggest for:
>
> - Reading a database schema (tables, fields, relationships) from SQL
> Server 2005?
> - Visualizing the DB schema?
>
> For developing a DB tool the schema should be read from the server and
> then be visualized, e.g. like the SQL Server BI Development Studio
> does when importing the whole schema to a data source view.
>
> Any ideas and hints on how to start approaching this (either reading
> schema and/or visualizing it) using .NET (preferably C#) are welcome!
>
>
> Regards,
> Max
>


send.me.all.email

5/20/2007 10:36:00 PM

0

On 18 Mai, 22:45, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.com> wrote:

> You mean besides the Database Diagrams supported in SQL Server EM and MS and
> since VB classic?

Database Diagrams would be a good option for visualizing a database
schema. But if I decide to offer this representation to the users of
an application, the question arises, how to automatically generate a
Database Diagram from a given database and how Database Diagrams can
be (re)used to offer the user a visual design environment in my own
application. The user of the application should be able to browse/
navigate the database schema in a graphical way, select some tables
and perform some (nontrivial) operations on them.

I''m quite interested in any way to embed such a kind of visualization
or design environment in a .NET application. Which frameworks can I
use, to minimize my development effort? Is it possible to reuse /
embed some specialized components for this from SQL Server or BI
Development Studio in a .NET application?

Regards,
Max

send.me.all.email

5/20/2007 10:55:00 PM

0

On 18 Mai, 18:02, Kerry Moorman
<KerryMoor...@discussions.microsoft.com> wrote:

> Anything more sophisticated would really be turning into an
> Entity-Relationship Diagramming application and that would be a considerable
> undertaking.

I think I''m realizing this more and more. Isn''t there any possibility
to reuse a design environment component offered by the SQL Server
products, like e.g. for designing Database Diagrams or Data Source
Views in SQL Server BI Development Studio? Or at least, to use the
framework these design environments are based on? Perhaps something
like the Eclipse Modeling Framework (EMF) existing in the Java world
or even more sophisticated and specialized for database schema
modeling?

Perhaps let''s make it more general: Which framework I can use, if I
want to create a .NET application offering a visual modeling
environment (e.g. for UML, ER, ...)?

Any ideas, hints, suggestions?

Regards,
Max

William \(Bill\) Vaughn

5/21/2007 4:01:00 PM

0

The diagramming tool will automatically build a diagram from an existing
schema--mapping the relationships and all.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker''s Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker''s Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<send.me.all.email@googlemail.com> wrote in message
news:1179700557.838473.128700@a26g2000pre.googlegroups.com...
> On 18 Mai, 22:45, "William \(Bill\) Vaughn"
> <billvaRemoveT...@betav.com> wrote:
>
>> You mean besides the Database Diagrams supported in SQL Server EM and MS
>> and
>> since VB classic?
>
> Database Diagrams would be a good option for visualizing a database
> schema. But if I decide to offer this representation to the users of
> an application, the question arises, how to automatically generate a
> Database Diagram from a given database and how Database Diagrams can
> be (re)used to offer the user a visual design environment in my own
> application. The user of the application should be able to browse/
> navigate the database schema in a graphical way, select some tables
> and perform some (nontrivial) operations on them.
>
> I''m quite interested in any way to embed such a kind of visualization
> or design environment in a .NET application. Which frameworks can I
> use, to minimize my development effort? Is it possible to reuse /
> embed some specialized components for this from SQL Server or BI
> Development Studio in a .NET application?
>
> Regards,
> Max
>


send.me.all.email

5/21/2007 8:32:00 PM

0

On 21 Mai, 18:01, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.com> wrote:

> The diagramming tool will automatically build a diagram from an existing
> schema--mapping the relationships and all.

This seems to be some kind of misunderstanding. I''m aware of the fact,
that there are tools which offer the possibility to read the schema
and build visualizations of it. That''s not the point. The point is,
that I''m planning to develop a .NET (C#) application and need to add a
small "design environment" to this application which shows such a
database / schema diagramm and offers the user the possibility to
browse the schema in a graphical way, select some tables and perform
operations on it. (Note that the operations I mentioned are very
special and not offered by any exiting tool.)

The question is, which .NET frameworks exist to simplify this and cut
down development efforts. As I figured out, reading the meta-data is
quite easy, but until now I have no idea how to start building the
"design/modeling environment" (e.g. creating dragable graphical tables
and a neat layout of connecting relationship lines). Perhaps there is
a possibility to reuse the frameworks or components the Microsoft
tools are based on?

Any suggestions? (Apart from suggesting the use of some closed-source
tools? :-)

Regards,
Max