Archive

Archive for August, 2007

SQL Server Profiler with Dotnet

August 24th, 2007 No comments

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.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: C#, DOTNET, SQL

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

August 17th, 2007 No comments

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/

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: C#, General, SQL

BlogEngine.NET released

August 13th, 2007 No comments

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/

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: General

Checkbox – Check All, None

August 8th, 2007 No comments

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.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Web Design

Visual SourceSafe Programming

August 2nd, 2007 No comments

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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(@"Machine1vssfoldersrcsafe.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.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: C#, DOTNET, General

My New Article – The Accidental Developer

August 2nd, 2007 No comments

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.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: General

Know the KeyCode

August 2nd, 2007 No comments

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.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: C#, DOTNET