Hot File

A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

View: 2981    Dowload: 0   Comment: 0   Post by: naruto  
Author: none   Category: PostgreSQL   Fields: Other

9 point/7 review File has been tested

Download   a-sql-management-console-for.rar (567.45 KB)

You need to Sign In to download the file a-sql-management-console-for.rar
If you do not have an account then Sign up for free here

Download error   Report copyright violation

Since MSSQL is not holding the lion share of the market yet, integration/interaction with other RDBMS like PL/Oracle, MySQL, FireBird, DB2, is inevitable. With the class System.Data.Common in ADO .NET 2.0, different data providers can write the assemblies, so that .NET application can communicate with them easily, they termed this as connector.

Introduction

When I first involved in a project that needed to interface with MySQL, FireBird, Oracle, OleDB, ODBC,..., I was totally lost. There're so many of them. It was like old times when different vendors were fighting for market share in OS war, C++ IDE war. Borland C++ was my first programming IDE, and now it's in museum. These wars were all history now but the database war is stil continue.

For each data provider, vendors provide the GUI query console for user to interact with the data visually. Though most of them come with no cost, to use them comfortably still another problem. For my personal point of view (please do not argue with me in the comment, this is only my opinion), SSMS (even Express Ed.) is the best management console of them all (I have been using MySQL Query Browser and an InterBase-like FireBird query browser, though maybe not long)

Purpose to create this? Haha, like any other developers: I feel there's no other tool fulfill my needs, so I created it. Kidding. Smile | :) The main purpose is to prepare MSSQL users a familiar IDE/management console for different databases. And one day, I hope my application can be on par with the tools like Red-Gate and myLittleAdmin.

Features

The features include in this version are :

  1. (IDE-wise) Open/Save/Drag-and-Drop
  2. (IDE-wise) query pane and result pane
  3. (MS SQL 2000 & 2005) Object browser for system objects (Scalar function, Stored procedure, System table, Table function, Trigger, User table, View)
  4. (MS SQL 2000 & 2005) Object browser for security (Users, Roles, Schemas)
  5. (MS SQL 2000 & 2005) Object browser for constraints, columns, parameters (Columns, Keys, Constraints, Triggers, Indexes, Parameters)
  6. (MS SQL 2000 & 2005) Dependencies viewer for objects (Scalar function, Stored procedure, System table, Table function, Trigger, User table, View)
  7. (MS SQL 2000 & 2005) Object scripting for non-encrypted objects (Scalar function, Stored procedure, Table function, Trigger, View)
  8. (MySQL 5.0) Object browser for system objects (Scalar function, Stored procedure, System table, Trigger, User table, View)
  9. (MySQL 5.0) Object browser for security (Users, Privilege)
  10. (MySQL 5.0) Object browser for constraints, columns (Columns, Keys, Triggers)
  11. (MySQL 5.0) Object scripting for non-encrypted objects (Scalar function, Stored procedure, Trigger, View)

Using the code

By using the information schema view in the database, you can easily browse to any objects in the MS SQL. (Seems Microsoft has additonal way to manipulate it, so what I implemented might not be 100% match with SSMS; Use at your own risk). Another ways is through System Tables. Microsoft use system tables to manipulate the system stored procedures in their SSMS, you can even open (in SSMS, it's located at Object explorer: Programmability>Stored Procedures>System Stored Procedures) and see how it works.

To integrate several type of RDBMS database into one IDE, the interface class is used so that each type of database is totally encapsulated from each other, yet they still have common signatures for IDE.

After gathering user input(or reading from app.config file), useful information like connection string and class name will be constructed and use for interface initializaztion.

    private void fnFindWindows(string strDBType, string strConnString, string strDataProvider)
        {
            // Clear out the collection
            _toolWindows.Clear();

            // Use reflection to look for types
            foreach (Type t in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (t.GetInterface("IToolWindow") != null)
                {
                    // load one database type per each session
                    if(t.Name.ToUpper().Equals(strDBType.ToUpper()))
                    {
                        // Try the empty constructor
                        if (t.GetConstructor(new Type[0]) != null)
                        {
                            _toolWindows.Add((IToolWindow)Activator.CreateInstance(t));
                        }
                        else
                        {
                            _toolWindows.Add((IToolWindow)Activator.CreateInstance(t, new object[] { this.rtbQueryConsole, this.tscbDBList, 
                                                                                                        strConnString, strDataProvider }));
                        }
                    }
                }
            }

            // Add toolwindows to each ToolWindowHost
            foreach (Control c in this.Controls)
            {
                ToolWindowHost host = c as ToolWindowHost;
                if (host != null)
                {
                    foreach (IToolWindow tw in _toolWindows)
                    {
                        host.AddToolWindow(tw);
                        host.ShowToolWindow(tw);
                        host.Dock = DockStyle.Left;
                    }
                }
            }
        }

When constructing the MSSQL object broswer; what you need will be something like this:

    private void fnChannelSysObj(TreeNode tnBaseNode, bool bRefresh)
        {
            string strXType = "";
            switch (tnBaseNode.Text)
            {
                // Need qualified name; New database in MSSQL 2005 needs to use "INFORMATION_SCHEMA"
                case SYSOBJ_USRTBL:
                    // ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2000.en/tsqlref/ts_ia-iz_56lv.htm
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.TABLES ",
                                        new string[] { "TABLE_SCHEMA", "TABLE_NAME" },
                                        IconType.SysObject, false);
                    break;
                case SYSOBJ_VIEW:
                ...
                //----------------------------------------------------------------
                case SYSOBJ_FUNC:
                    strXType = "'FN'";
                    break;
                ...
                //----------------------------------------------------------------
                case SECURITY_USER:
                    // ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/tsqlref9/html/5f0e6a8d-c983-44f6-97e9-aab5bff67d18.htm
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from dbo.sysusers"
                                        + " where isntuser = 1 or issqluser = 1",
                                        new string[] { "name" }, IconType.SysObject, true);
                    break;
                ...
                case SECURITY_SCHE:
                    // ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/tsqlref9/html/69617642-0f54-4b25-b62f-5f39c8909601.htm
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.SCHEMATA"
                                        + " where CATALOG_NAME = '" + tnBaseNode.Parent.Text + "'",
                                        new string[] { "SCHEMA_NAME" }, IconType.SysObject, true);
                    break;
                default:
                    break;
            }

            if (!strXType.Trim().Equals(""))
            {
                // use qualified name; use "dbo.sysobjects" instead of "sys.sysobjects" for backward compatibility
                // ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.SQL.v2005.en/tsqlref9/html/44fdc387-67b0-4139-8bf5-ed26cf640cd1.htm
                fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                    "Select name from dbo.sysobjects"
                                    + " WHERE xtype in (" + strXType + ") order by name",
                                    new string[] { "name" }, IconType.SysObject, false);
            }
        }

While constructing the MySQL object broswer; what you need will be quite similar:

    private void fnChannelSysObj(TreeNode tnBaseNode, bool bRefresh)
        {
            switch (tnBaseNode.Text)
            {
                case SYSOBJ_USRTBL:
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.TABLES " +
                                        " where Table_Schema = '" + tnBaseNode.Parent.Text + 
                                        "' and Table_Type in ('Base Table')",
                                        new string[] { "TABLE_NAME" },
                                        IconType.SysObject, false);
                    break;
                ...
                //----------------------------------------------------------------
                case SYSOBJ_FUNC:
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.ROUTINES " +
                                        " where ROUTINE_Schema = '" + tnBaseNode.Parent.Text + 
                                        "' and ROUTINE_Type = 'FUNCTION'",
                                        new string[] { "SPECIFIC_NAME" },
                                        IconType.SysObject, false);
                    break;
                ...
                case SYSOBJ_SYSTBL:
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.TABLES " +
                                        " where Table_Schema = '" + tnBaseNode.Parent.Text + 
                                        "' and Table_Type in ('SYSTEM VIEW')",
                                        new string[] { "TABLE_NAME" },
                                        IconType.SysObject, false);
                    break;
                //case SYSOBJ_TBLFUNC:
                //    strXType = "'TF'";
                //    break;
                case SYSOBJ_TRIG:
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select * from INFORMATION_SCHEMA.TRIGGERS " +
                                        " where TRIGGER_Schema = '" + tnBaseNode.Parent.Text + "' ",
                                        new string[] { "TRIGGER_NAME" },
                                        IconType.SysObject, false);
                    break;
                //----------------------------------------------------------------
                case SECURITY_USER:
                    // assume root user have the access of all tables
                    fnAddSysObj_SysCol(tnBaseNode, tnBaseNode.Parent.Text, bRefresh,
                                        "Select GRANTEE from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES " +
                                        "where TABLE_SCHEMA = '" + tnBaseNode.Parent.Text + "' " +
                                        "group by GRANTEE " +
                                        "UNION " +
                                        "SELECT CONCAT('''', usr.User, '''@''',  usr.Host, '''') as GRANTEE " +
                                        "FROM mysql.user usr where User = 'root'",
                                        new string[] { "GRANTEE" }, IconType.SysObject, false);
                    break;
                default:
                    break;
            }
        }

And rest of the job is just normal windows programming and you get all data provider in one IDE. Great, huh?

A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,... Posted on 07-05-2014  Since MSSQL is not holding the lion share of the market yet, integration/interaction with other RDBMS like PL/Oracle, MySQL, FireBird, DB2, is inevitable. With the class System.Data.Common in ADO .NET 2.0, different data providers can write the assemblies, so that .NET application can communicate with them easily, they termed this as connector. 1.2857142857143/10 2981

Comment:

To comment you must be logged in members.

Files with category

  • Accessing: MySQL Database using MySQL C API

    View: 2266    Download: 2   Comment: 0   Author: none  

    Accessing: MySQL Database using MySQL C API

    Category: PostgreSQL
    Fields: Other

    0.75/6 review
    This article was written for beginners, developers that do not know how to access MySql database using MySQL C API and would like to have a small introduction.

  • Full Database Abstraction Layer Generator

    View: 2351    Download: 0   Comment: 0   Author: none  

    Full Database Abstraction Layer Generator

    Category: PostgreSQL
    Fields: Other

    0/23 review
    This article presents yet another Data Abstraction Layer generator (popular topic). The DAL structure is directly inspired from the DotNetNuke, DAL document and the SQL generation is done using SQLpp. The generator takes care of pretty much...

  • Code .NET 2.0; Build Java; Run Linux

    View: 1902    Download: 0   Comment: 0   Author: none  

    Code .NET 2.0; Build Java; Run Linux

    Category: PostgreSQL
    Fields: Other

    1.5/3 review
    This article is in the Product Showcase section for our sponsors at CodeProject. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers. This is a showcase review for...

  • Postgres Database Backup/Restore From C#

    View: 2749    Download: 2   Comment: 0   Author: none  

    Postgres Database Backup/Restore From C#

    Category: PostgreSQL
    Fields: Other

    0/9 review
    This article provides Postgres database backup/restore functionality. By using this application we can check whether a Postgres database is installed or not in a system. If a Postgres database is installed then the Postgres databases list is...

  • Installing Redmine on Windows in production

    View: 5143    Download: 0   Comment: 0   Author: none  

    Installing Redmine on Windows in production

    Category: PostgreSQL
    Fields: Other

    0/9 review
    This is a very simple step by step guide to install Redmine on Windows server in production. This guide is applicable to IIS 7+ based servers, which include Windows Server 2008, 2008 R2, Windows Vista and Windows 7. Latter two should not be used for...

  • A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

    View: 2981    Download: 0   Comment: 0   Author: none  

    A SQL Management Console for MSSQL 2000 & 2005, MySQL 5.0,...

    Category: PostgreSQL
    Fields: Other

    0.64285714285714/7 review
    Since MSSQL is not holding the lion share of the market yet, integration/interaction with other RDBMS like PL/Oracle, MySQL, FireBird, DB2, is inevitable. With the class System.Data.Common in ADO .NET 2.0, different data providers can write the...

  • Creating an Interactive Map in ASP.NET 2.0 Using SharpMap

    View: 4081    Download: 5   Comment: 0   Author: none  

    Creating an Interactive Map in ASP.NET 2.0 Using SharpMap

    Category: PostgreSQL
    Fields: Other

    0/2 review
    Showing maps on the web is becoming more and more common. The most well-known ones are Google Maps and Microsoft's Virtual Earth. Creating your own websites with interactive maps require you to get hold on the map-data and convert this data to...

  • DevShot - Database Snapshots for Developers

    View: 810    Download: 0   Comment: 0   Author: none  

    DevShot - Database Snapshots for Developers

    Category: PostgreSQL
    Fields: Other

    0/2 review
    A few weeks back, I got an idea of writing a simple tool for switching database states between coding cycles. I thought this would be a good tool for anyone who is working on database related projects and have to switch between database states since...

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd