473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Read (and Visualize) DB Schema from SQL Server

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

May 17 '07 #1
8 4084
Max,

http://support.microsoft.com/kb/309488

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

Kerry Moorman
"se***************@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

May 17 '07 #2
On 17 Mai, 15:10, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
http://support.microsoft.com/kb/309488

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

May 18 '07 #3
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
"se***************@googlemail.com" wrote:
On 17 Mai, 15:10, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
http://support.microsoft.com/kb/309488

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

May 18 '07 #4
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)
-----------------------------------------------------------------------------------------------------------------------

<se***************@googlemail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.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

May 18 '07 #5
On 18 Mai, 22:45, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
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

May 20 '07 #6
On 18 Mai, 18:02, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
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

May 20 '07 #7
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)
-----------------------------------------------------------------------------------------------------------------------

<se***************@googlemail.comwrote in message
news:11**********************@a26g2000pre.googlegr oups.com...
On 18 Mai, 22:45, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
>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

May 21 '07 #8
On 21 Mai, 18:01, "William \(Bill\) Vaughn"
<billvaRemoveT...@betav.comwrote:
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

May 21 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stefan Rotter | last post by:
Hi, I'm trying to load a schema into an XmlSchema object with the Read and Compile methods. I use Read with a ValidationEventHandler. No errors occurs but when I look at the XmlSchema properties...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
7
by: Enrico Castagnola | last post by:
Hi, I have a problem. How can I print a file pdf on server without to visualize it? Thanks Best regard
5
by: Arvind P Rangan | last post by:
Hi, i like to read an existing xml file which has a schema defined to it, and then write or add data to the existing xml file using vb.net/c#. May be this Question has been answered earlier....
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
8
by: fireball | last post by:
I wihsh to discuss whether to use fully qualified names: ..object of objects to operate (create, query..) on is good or not? If someone change order of sql code blocks in my script - this may...
0
by: =?Utf-8?B?c3FsZXh0cmVtZQ==?= | last post by:
Hi Asp.net has some problem to read schema colletion of Sql Server 2005 or can read it as a xml normal? Thank Cristián
8
by: send.me.all.email | last post by:
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...
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.