5,666,132 members and growing! (14,010 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » .NET Framework » Applications     Beginner License: The Code Project Open License (CPOL)

Simple Query Tool to Extract Data from Database

By Mohammad Hamed Akhter

This is a simple user friendly query tool which helps end-users to extract data from the database. The UI looks similar to query windows in Team Foundation Server, this is a modest beginning which can be enhanced and used more effectively.
C#, .NET, ADO.NET, Dev

Posted: 9 Oct 2008
Updated: 9 Oct 2008
Views: 4,010
Bookmarked: 27 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
13 votes for this Article.
Popularity: 4.08 Rating: 3.67 out of 5
2 votes, 15.4%
1
1 vote, 7.7%
2
2 votes, 15.4%
3
2 votes, 15.4%
4
6 votes, 46.2%
5
QueryTool_V1

Introduction

The are various ways to design a UI that helps users to extract specific information from the database. This tool whose UI design is similar to the queries windows in TFS helps users to extract specific data by helping the user to create or form a query.

Background

This idea is similar to the query tools available in SQL server and TFS, but it is customized to the user's needs.

Using the Code

The Query tool hosts various controls in the grid, which get added on the fly while the user clicks through each of the cells, but still makes sure the user doesn't end up creating a garbled query.

Event based Asynchronous programming is done in case the query execution turnaround time is more, so for good user experience a progress bar is added to show the user that the query is been processed.

Interesting articles would be the following ones from MSDN:

  1. How to: Host Controls in Windows Forms DataGridView Cells

    This tools hosts Calender, ComboBox and Treeview controls in a ComboBox.

    QueryTool_V1_Pic3.Jpg

    QueryTool_V1_Pic4.Jpg

  2. How to: Wrap a Windows Forms Control with ToolStripControlHost

  3. Safe, Simple Multithreading in Windows Forms

    //
    // Hosting the Controls in the Grid View
    //
    public class CalendarColumn : DataGridViewColumn
    {
      
    }
    public class CalendarCell : DataGridViewTextBoxCell
    {      
    }
    class CalendarEditingControl : DateTimePicker, IDataGridViewEditingControl
    {
    }
    
    //
    // Asynchronous Programming to Update the UI
    //
    class ShowProgressDelegate : MulticastDelegate {
      public void Invoke(int digits);
      public void BeginInvoke(string txtDisplay, AsyncCallback callback,
                              object asyncState);
      public void EndInvoke(IAsyncResult result);
    }
    
    public class ToolStripControlHost : ToolStripItem 

Points of Interest

While developing the tool, it helped me in learning the various properties of control, hosting those controls in the grid view and do asynchronous programming.

History

  • 10th October, 2008: Initial release

This is just a fast track beginning, the future release would include all the fixes and an additional feature to group the clause.

License

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

About the Author

Mohammad Hamed Akhter


My Skills are C#.NET 2.0 and ASP.NET 2.0
Occupation: Software Developer
Location: India India

Other popular .NET Framework articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Oct 2008
Editor: Deeksha Shenoy
Copyright 2008 by Mohammad Hamed Akhter
Everything else Copyright © CodeProject, 1999-2008
Web17 | Advertise on the Code Project