Click here to Skip to main content
12,882,493 members (30,960 online)
Click here to Skip to main content
Articles » Database » Database » SQL Server » Downloads

Tagged as


7 bookmarked
Posted 1 Oct 2012

Using SQL Server Metadata and Statistics to Build a Table Explorer Application

, 1 Oct 2012 CPOL
Develops an analogy between database table and file directory information and argues that it could be very useful if it were possible to have a similar application to Windows Explorer for database tables. Demonstrates how to obtain the information from Sql Server system tables and dynamic management
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DbView
	public partial class DatabaseSelectionForm : Form
		String m_DatabaseSelectedOnOk = ""; 
		public DatabaseSelectionForm(List<String>DatabaseNames, String CurrentName)
			foreach (String dbName in DatabaseNames)
			this.listDatabases.SelectedIndex = listDatabases.Items.IndexOf(CurrentName);
			if (this.listDatabases.SelectedIndex == -1)
				this.listDatabases.SelectedIndex = 0;
		public String SelectedDatabase
			get { return m_DatabaseSelectedOnOk; }

		private void btnOk_Click(object sender, EventArgs e)
			m_DatabaseSelectedOnOk = listDatabases.Items[listDatabases.SelectedIndex].ToString();
			this.DialogResult = DialogResult.OK;

		private void btnCancel_Click(object sender, EventArgs e)
			this.DialogResult = DialogResult.Cancel;

		private void listDatabases_DoubleClick(object sender, EventArgs e)
			this.btnOk_Click(sender, e);


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170422.1 | Last Updated 1 Oct 2012
Article Copyright 2012 by DaveDbViewSharp
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid