NinethSense oWnZ mE!: Praveen’s drawing book

Choose a Topic:

Fri
24
Aug '07

SQL Server Profiler with Dotnet

My latest article on SQL Server Profiler with Dotnet is available at CodeProject now -http://www.codeproject.com/useritems/TSQL-profiler.asp

This article describes how to develope a Microsoft SQL Profiler with Dotnet. I use c# to in this article.

This article is an introduction to the implementation of a ‘profiler like thing’ with dotnet. I would like to call it as ‘SQL Tracer’ since it is out of scope of this page to develop all the functionalities of a SQL Profiler. I choose C# for the demonstation.


Also, I am happy to see I have the gold member status in CodeProject now.
Fri
17
Aug '07

QTraZe - A developer’s sql tracing tool with C#

My new hobby product is ready for using.



QTraZe is a tool which can give fast tracing results to help you in development process. You can trace the sql queries being executed while running your applications. QTraZe is not an alternative to Microsoft’s SQL Server Profiler.


Technical Information
- QTraZe is done with Microsoft C# v2.0.50727.
- Microsoft.SqlServer.Management.* namespace is used
- Registry operations are carryout with Microsoft.Win32 namespace (so remember last server details)
- No third party controls used.

Requirements
- Microsoft SQL Server Profiler components must be installed.
- Microsoft Dotnet Framework 2.x



I will be publishing the source code of this application once I feel this tool is stable. :)



For more details and download, check http://qtraze.ninethsense.com/
Mon
13
Aug '07

BlogEngine.NET released

BlogEngine.NET is a full-featured blogging platform that is a breeze to set up, customize, and use. BlogEngine.NET works with your choice of data source; you may use SQL Server, or you may take the plug’n’play approach using XML files.

BlogEngine.NET


Check this link for more details: http://www.asp.net/downloads/starter-kits/blog-engine/
Wed
8
Aug '07

Checkbox - Check All, None

This sample code demonstates the working of ‘check all’ and ‘check none’ checkbox behaviours in a Windows Forms application


 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void CheckCheck(object sender, EventArgs e) 
        {
            bool flag = true;
            foreach (Control ctrl in Form1.ActiveForm.Controls)
            {
                if (ctrl is CheckBox && ctrl.Name != “chkNone” && ctrl.Name != “chkAll”)
                {
                    CheckBox chk = (CheckBox)ctrl;
                    if (chk.Checked) flag = false;
                }
            }
            chkNone.Checked = flag;
        }
 
 
        private void chkNone_MouseClick(object sender, MouseEventArgs e)
        {
            CheckAll(false);
        }
 
        private void chkAll_MouseClick(object sender, MouseEventArgs e)
        {
            CheckAll(true);
        }
        private void CheckAll(bool b)
        {
            foreach (Control ctrl in Form1.ActiveForm.Controls)
            {
                if (ctrl is CheckBox && ctrl.Name != “chkNone” && ctrl.Name != “chkAll”)
                {
                    CheckBox chk = (CheckBox)ctrl;
                    chk.Checked = b;
                }
            }
        }
 
     }
}



Notes:

CheckCheck() method must be attached to CheckedChanged event of ALL the checkboxes except “None” and “All”.
chkNone_MouseClick() method is for the MouseClick event of “None” checkbox.
chkAll_MouseClick() method is for the MouseClick event of “All” checkbox.
Thu
2
Aug '07

Visual SourceSafe Programming

This sample script will list a sourcesafe folder with the name of user who checked out a file

 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualStudio.SourceSafe.Interop;
 
namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            VSSDatabase db = new VSSDatabase();
            db.Open(@\Machine1\vssfolder\srcsafe.ini”,“praveen”,“praveen”);
            VSSItem folder = db.get_VSSItem(“$/myproject”, false);
            IVSSItems items =  folder.get_Items(false);
            foreach (VSSItem item in items)
            {
                if (item.Type == 1) // files
                {
 
                    string chkuser = string.Empty;
                    foreach (VSSCheckout checkout in item.Checkouts)
                    {
                        chkuser = ” ======>>>[” + checkout.Username + “] “;
                    }
                    listBox1.Items.Add(item.Name + chkuser);
                    
                }
            }
            
        }
    }
}



Note that this is just a sample and this will show only single folder. Make it rescursive to show sub folders also.
'

My New Article - The Accidental Developer

My new article is available at - http://ninethsense.com/content/view/53/59/

This article belongs to Project Management.

I have gone though different kinds of developers during my career. Different skill levels, different technologies, different view ports, different habits. This article is about “How to become a successful developer” for those who are now/going to become a developer from some unexpected accidental situation.
'

Know the KeyCode

To know the KeyCode of key which you pressed in keyboard use e.KeyCode

 
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
    label1.Text = e.KeyCode.ToString();
}


This was useful for me in a kiosk applicaiton development for recognising which keys I must disable.
The CodeProject Microsoft Developer Network Official ASP.NET Forums Microsoft .NET Framework Community Microsoft Most Valuable Professional Kidoos forums Microsoft Visual Studio Developer Home Professional Information Technology Solutions Microsoft Research Home Trivandrum Microsoft Users Group Community Website