Thursday, August 16, 2007

The latest release of Notepad++ (Version v4.2.2) is available

 

   Notepad++ is a free source code editor (and Notepad replacement), which supports several programming languages, running under the MS Windows environment. I use this notebook for many years and was very pleased. Simple and easy! Ideally HTML, XML, Log Editor and Viewer. Very useful tool. Recommended for all!

 

Here are the features of Notepad++ :

Syntax Highlighting and Syntax Folding

Supported languages :

C C++ Java C# XML HTML PHP CSS makefile ASCII art (.nfo)  doxygen ini file batch file Javascript ASP VB/VBS  SQL Objective-C  RC resource file Pascal Perl Python
Lua TeX TCL Assembler Ruby Lisp Scheme  Properties Diff Smalltalk Postscript VHDL Ada  Caml AutoIt KiXtart Matlab Verilog Haskell InnoSetup CMake

WYSIWYG

User Defined Syntax Highlighting

Auto-completion

Multi-Document

Multi-View

Regular Expression Search/Replace supported

Full Drag ‘N' Drop supported

Dynamic position of Views

File Status Auto-detection

Zoom in and zoom out

Multi-Language environment supported

The Chinese, Japanese, Korean, Arabic and Hebrew Windows environments are supported.
Bookmark

Brace and Indent guideline Highlighting

Macro recording and playback

 

 

Screenshots:

 HomePage

 Download page

 

kick it on DotNetKicks.com

Monday, August 13, 2007

List of commands for F1-F9 for command prompt

List of F1-F9 Key Commands for the Command Prompt

F1 / right arrow: Repeats the letters of the last command line, one by one.
F2: Displays a dialog asking user to “enter the char to copy up to” of the last command line
F3: Repeats the last command line
F4: Displays a dialog asking user to “enter the char to delete up to” of the last command line
F5: Goes back one command line
F6: Enters the traditional CTRL+Z (^z)
F7: Displays a menu with the command line history
F8: Cycles back through previous command lines (beginning with most recent)
F9: Displays a dialog asking user to enter a command number, where 0 is for first command line entered.
Alt+Enter: toggle full Screen mode.
up/down: scroll thru/repeat previous entries
Esc: delete line
Note: The buffer allows a maximum of 50 command lines. After this number is reached, the first line will be replaced in sequence.

Helpful accessibility keyboard shortcuts

Switch FilterKeys on and off. Right SHIFT for eight seconds
Switch High Contrast on and off. Left ALT +left SHIFT +PRINT SCREEN
Switch MouseKeys on and off. Left ALT +left SHIFT +NUM LOCK
Switch StickyKeys on and off. SHIFT five times
Switch ToggleKeys on and off. NUM LOCK for five seconds…..Source

by Geek Zone

How To Remove CD Scratches With A Banana


Yes-yes, this is not a joke - this is work!

Sunday, August 12, 2007

The Blogger backup

Everyone knows how painful to lose the information, that does not happen we do backup, but what if you have a blog in blogger.com blog? Beautiful and free solution proposed team of developers from  CodePlex - Blogger Backup!
Elementary and simply no worries. Last realese  of utility is v1.0.7.16.

Screenshots

Download page

"The Code Project" Browser Add-in for Visual Studio 2005

This add-in is used to browsing, downloading and managing "The Code Project" samples directly in VS 2005 by SlickEdit

 

Download add-in

Project Page

Thursday, August 09, 2007

AdSense Watch Toolbar

AdSense Watch is a free Windows Explorer toolbar displaying your current Google AdSense report - Page impressions, Clicks, Page CTR, Page eCPM and Earnings. The data is updated automatically or on demand.

Download

HomePage

kick it on DotNetKicks.com

SQL Function to Parse AlphaNumeric Characters from String

CREATE FUNCTION dbo.ParseAlphaCharsByString
(
@text VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @IncorrChachIndex SMALLINT

SET @IncorrChachIndex = PATINDEX('%[^0-9A-Za-z]%', @text)
WHILE @IncorrChachIndex > 0
BEGIN
SET @text = STUFF(@text, @IncorrChachIndex, 1, '')
SET @IncorrChachIndex = PATINDEX('%[^0-9A-Za-z]%', @text)
END
RETURN @text
END
GO

Manual how-to use Subversion and Tortoise SVN with Visual Studio and .NET

This article is a quick step by step for tuning up Subversion with Tortoise SVN. This walkthrough is general with a slight side concentrated on operation with .NET and Microsoft Visual Studio projects. It covers repository creation, creating new source control branches for projects, creating a local copy and the basics of common operations. Focus is on getting up and running quickly with the essential steps.

Saturday, August 04, 2007

Learn about 12 coding languages that never quite made it and the reasons they failed.

There are about 8,500 languages (not surprised, are not exaggerated), but despite this diversity, the number of languages in which the majority says, barely passes for a dozen. The reason why a language does not become popular, no less than the languages themselves. This division between their creators, and poorly organized sale process, and the emergence of new technologies, and simply frank "bends". In this article we review 12 programming languages, which are not popular among developers, as well as the causes of the "dislike".
Click here to read the article

Wednesday, August 01, 2007

'Loading' indicator for Ajax

Do you want an indicator 'loading...' 
like that there is for Google Analytics loading?


Or like this ajax asp.net?

Or this ajax?

Or this asp.net

Go to ajaxload.info and create your 'Load' indicator!

If you want to use this indicator in ASP.NET AJAX project click here

Sunday, July 29, 2007

Monday, July 23, 2007

Regionerate - a automatic creator of #region in C#

Regionerate - an automatic layout enforcement tool for the C# programming language. This great tool alone identifies parts of code (enums, properties, variables and etc.) and fences them in the #regions.

HomePage

Screencast (on flash)

Download stable version or latest version

Sunday, July 22, 2007

Mr. Bool

Nice site that includes a video tutorials, online courses and articles.
Mr. Bool
After 'Read more'

Thursday, July 19, 2007

App.Config and Custom Configuration Sections

Detailed explanation how to define and to use.

Click here

A replacement Switch to Delegates.

Excellent model how to substitute Switch Statement in Anonymous delegates in C#.

Click here

AjaxDaddy - Amazing AJAX collection.

A huge collection of  ajax scripts. Source and examples in action. Reveals greatest ajax solutions for professional developer.

A collection include follows controls:

Animate
Effects
Draggables
Droppables
Sortables
Selectables
Resizables
Slider
Tooltips
Slideshow
Imagebox
Autocompletion
Autoscrolling
Autoexpander
Accordion
Tabs in Textareas
3D Carousel
Fisheye menu

and other....

Home Page

Wednesday, July 18, 2007

Utility methods, utility classes, common classes - a blob is not an abstraction

Very interesting important article on a definition of right names what it this "Utility". Written by Jeffrey Palermo [MVP].
To reading click here

Monday, July 16, 2007

ASP.NET AJAX Control Development

An in depth guide to developing controls with the ASP.NET AJAX Framework by Kazi Manzur Rashid.
Read full guide

Download Sample Code

Solution to Method error 500 in CascadingDropDown

1. In WebService add attribute [System.Web.Script.Services.ScriptService()] to class.
2. If you use another asp controls in the same aspx page add in <%@ Page .... EnableEventValidation="false" ...%>

3. If yet you get error - try ValidateRequest="false" in the tag <%@ Page ...%>

Good luck :-)

Review - Google Applications for your Domain.

Google ApplicationsShort review of google apps for domains after a using during 2 weeks. General glimpse,positive and negavtive characteristics and other. To reading of the full review click here.

Thursday, July 12, 2007

Validation with Enterprise Library 3.x

Usually object validation requires writing a lot of code that examines properties and returns validation result. With VAB this scenario becomes extremely easy and simple. Let us consider sample class: link

Starting ASP.NET Development Server from a right click in explorer

Great solution to litlle trouble. Run Development Server from a right click:
ASP.NET

Link

Wednesday, July 11, 2007

Powerful/Free Download: Refactor! for ASP.NET 2.2

Refactor! for ASP.NET version 2.2 is shipping. Built by Developer Express, this FREE code refactoring tool includes 29 time-saving refactorings and is available to all developers working in Visual Studio 2005 and Orcas Beta 1.
Link

New Data Access Tutorials: A Custom Site Map Provider, and Working with Batched Data

Scott Mitchell adds five new tutorials to his series that explores common data access patterns in ASP.NET 2.0. In the first tutorial we learn how to build a custom database-driven site map provider. We then learn how to batch update, delete, and insert operations within a database transaction. Link

Wednesday, June 20, 2007

What's the Right Number of Assemblies/Libraries?

Deciding how to physically partition up your application isn't a .NET specific topic, but I'll use the word "Assemblies" and use .NET terminology since we work largely in .NET.

What's the right number of assemblies? When do you split up functionality into another assembly? Should you use ILMerge to make a single über-assembly? Perhaps one class or one namespace should be inside each assembly?

Here's my thinking...organized very simply.

Link to full item

Tuesday, June 19, 2007

Using TortoiseSVN with Team Foundation Server

This is a new and very interesting project at CodePlex. This bridge allows clients (such as TortoiseSVN) work against a TFS server. This is a group of developers CodePlex itself because of the popularity of clients. The bridge works at the protocol, making SVN protocol TFS protocol and vice versa. The development is in its infancy and it is monitored.
Link

Tuesday, June 12, 2007

New ASP.NET AJAX Control Toolkit Release

The ASP.NET AJAX Control Toolkit is a shared-source community project consisting of samples and components that make it easier than ever to work with AJAX-enabled controls and extenders. The Control Toolkit provides both ready-to-run samples and a powerful SDK to simplify creating custom ASP.NET AJAX controls and extenders. Make sure you install ASP.NET AJAX 1.0 first!

Download Page


Thanks to ScottGu's Blog

Tuesday, May 01, 2007

Pre-Release .NET Framework 3.5 – Beta 1 available

Microsoft has released the Beta of the .NET Framework 3.5

А new features:
  • Deep integration of Language Integrated Query (LINQ) and data awareness
  • ASP.NET AJAX for quickly creating more efficient, more interactive and highly-personalized Web experiences that work across all the most popular browsers
  • New web protocol support for building WCF services including AJAX, JSON, REST, POX, RSS, ATOM and several new WS-* standards
  • Full tooling support for WF, WCF and WPF including the new workflow-enabled services technology
  • New classes in the base class library (BCL) for the .NET Framework 3.5 address the most common customer requests.
and more...

Download page

kick it on DotNetKicks.com

Sunday, April 22, 2007

Saturday, April 21, 2007

Convert ASCII to Unicode in C#

private string Convert(int asciiCode)
{
    Encoding ascii = Encoding.UTF32;
    
     char c = (char)asciiCode;
     Byte[] b = ascii.GetBytes(c.ToString());

    return ascii.GetString((b));
}


kick it on DotNetKicks.com

Sorting Generic Lists With Anonymous Methods and Reflection



Link to item

Thanks to Kevin Castle .Net

WinMerge - visual text file differencing and merging tool.

Great tool for visual comparison text documents in Windows to change them. WinMerge know how to work with DOS, UNIX and MAC file formats, supports Unicode and has Syntax. It might be very useful, for example, to determine what has changed in one version of the draft over another, as well as for mergers changes to the various versions. Integrates into the Windows shell. Supported expansion plugins.
WinMerge is open-source code and distributed under licence GNU / GPL.

HomePage

Screenshots






More screenshots


Download WinMerge 2.6.6

kick it on DotNetKicks.com

Wednesday, April 18, 2007

C# 2.0 Nullable Data Readers

.NET 2.0 introduced nullable types into the CLR which, for the first time, provided the ability for value types to be assigned a null value. However, ADO.NET 2.0 did not introduce any new features specifically for dealing with nullable types. Therefore, one of the primary goals for the classes presented in this article is to provide a simple API for working with nullable types within the persistence layer.

Link

Monday, April 09, 2007

Foxit PDF Reader Pro

Foxit PDF Reader Pro 2.0 Build 1606 is a freeware program for viewing PDF files. Excellent replacement Acrobat Reader. Compact and fast working programme for the documentary PDF format that does not require the large, and therefore slow launching Adobe Reader. Releases and copy text to the clipboard, as well as to search on the text. Normally working with any language.

Home Page (1.8 MB)
Download

New Features

Foxit Reader 2.0 introduces many exciting new features listed below:
- Interactive form filler: Now you don’t have to print out PDF forms first and then manually fill out paper forms. Instead, you can use PC to fill out interactive forms directly, and then print them out, save them, email them or export the form data into FDF file for further processing.
- Multi-language UI that can be dynamically switched: The user interface of Foxit Reader now can be switched to different languages dynamically, thanks to the generous help from our user community.
- On-demand download of add-on: With add-ons, the function of Foxit Reader can be extended unlimitedly. New function modules and seldom used modules are packed as add-on. Users only download them when needed. Foxit Reader highly respects the security and privacy of users and will never connect to Internet without users’ permission. While Acrobat Reader often silently connect to the Internet in the background.
- Self-upgrade: In the past, when you want to upgrade Foxit Reader, you have to frequently visit Foxit website, check for new release, and then manually download the new version, uninstall the old version and re-install the new version. Now this whole process is simplified and you only need to click on the menu item “Check for update now”.
- Javascript support: Advanced users are able to use Javascript to create complex logic for PDF forms, to validate user input and process data.
- Improved printing speed: Printing a PDF file with many images in it to a PostScript printer used to be slow. Version 2.0 has been optimized for such printing.
- Streamlined UI: Version 2.0 comes with a neat UI. Annotation tool buttons are grouped together, instead of being showed on several toolbars.

Free Reader

Foxit Reader 2.0 itself is free. For add-ons, the critical add-ons are free while advanced add-ons are non-free. For example, you can use the following functions for free:
- View or print PDF document
- Fill out PDF forms and save them
- Convert PDF document into text file
- Critical add-ons, such as UI language package, JPEG2000/JBIG decoder, CJK package, GDI+ for early Windows version, etc

The followings are several examples of non-free, advance add-ons:
- You can try out annotation tool for free. However when you save the annotated document, it will be stamped with an evaluation mark on the top-right corner of the annotated pages. If you purchase a Pro Pack add-on, then there will be no evaluation mark.
- Foxit Converter which allows you to convert non-PDF file into PDF file is non-free.
- Foxit Editor which allows you to modify contents of a PDF file is non-free.

Tuesday, February 20, 2007

Personal Wallpapers and Screensavers for mobile phones

For the first time, the Internet site for a personal wallpapars and screensavers for mobile phones. Absolutely free.

Free mobile phone wallpaper generator

Example:
Personalized wallpapers and screensavers for mobile phones

Thursday, February 15, 2007

.NET Cheat Sheets

.NET Format String Quick Reference
Download (PDF) size: 123 KB

ASP.NET 2.0 Page Life Cycle & Common Events
Donwload (PDF) size: 64 KB

Visual Studio 2005 Built-in Code Snippets (C#) Link

ASP.NET Page Life Cycle Diagram Link

Microsoft ASP.NET AJAX Library Download (PDF)

Other cheat sheets Link

kick it on DotNetKicks.com

Tuesday, February 13, 2007

Monday, February 12, 2007

IE7pro - an extension for IE 7



IE7pro is an extension for IE 7, which increases functionality by adding :-Fast proxy servers, Modification identification line browser, expanded dran n record, the manager, safe browsing web pages, - Fast Save graphics, and more.
Freeware ~ 0.5 MB

Download

Home page

kick it on DotNetKicks.com

Tuesday, January 30, 2007

Visual C# 2005 Keyboard Shortcut Reference Poster

Visual C#, Visual Basic and Visual C++ 2005 Keyboard Shortcuts Reference Posters

If you prefer not to take your hands off the keyboard when working in Visual Studio, then you will appreciate this post. You can download and print for your convenience color posters of shortcuts:


Download C# color poster


Download C++ color poster


Download VB color poster

kick it on DotNetKicks.com

Sunday, December 24, 2006

Maximum URL length in HTTP request.

Previously, there were limitations on the maximum length of URL - 256 characters.
But now, in HTTP 1.1 length of URL is 2,083 characters.
Limiting only to GET. For POST a length is not limited.
Original

Monday, December 11, 2006

Custom object and ToString()

It is known that in the C # any object can be shown in the form of string by the method ToString () but what to do if you need to make such an operation with custom object?
That is one solution :

public int Id
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private DateTime birthday ;
public DateTime Birthday
{
get { return birthday ; }
set { birthday = value; }
}


//Constructor
public Customer()
{
this.id = 5;
this.name = "John Smith";
this.birthday = new DateTime(1945, 10, 12);

Console.WriteLine(this.ToString());
}



To continue press "read more"....




public override string ToString()
{
StringBuilder builder = new StringBuilder();

Type type = this.GetType();
PropertyInfo[] propertiesInfo =
type.GetProperties();
foreach (PropertyInfo property in propertiesInfo)
{
builder.AppendFormat("{0} = {1} \n",
property.Name,
property.GetValue(this, null));
}

return builder.ToString();
}


Output:



kick it on DotNetKicks.com

Thursday, November 30, 2006

Writing log message to file via Message Queue



using System;
using System.Configuration;
using System.Messaging;
using System.IO;

namespace Test
{
public class QSend
{
private System.Messaging.MessageQueue mq;
private string exQ;

public QSend()
{
try
{
mq = new System.Messaging.MessageQueue(
@".\Private$\MyQ");
LogItems inLogItems = new LogItems();
inLogItems.FileName = @"d:\mgslog\Log.txt";
inLogItems.Message = " my message";
mq.Send(inLogItems);
}
catch(MessageQueueException ex)
{
exQ = ex.Message;
}
}
}

public class QRecieve
{
private System.Messaging.MessageQueue mq;
private string exQ;

public QRecieve()
{
try
{
mq = new System.Messaging.MessageQueue (@".\Private$\MyQ");
mq.Formatter =
new System.Messaging.XmlMessageFormatter (
new Type[] {typeof (LogItems)}) ;
System.Messaging.Message msg = mq.Receive();
LogItems outLogItems = (LogItems) msg.Body;
using( StreamWriter sw =
new StreamWriter(outLogItems.FileName,true))
{
sw.WriteLine(DateTime.Now.ToString()
+ outLogItems.Message);
sw.Flush();
}
}
catch(MessageQueueException e)
{
exQ = e.Message;
}

}
}

public class LogItems
{
private string _fileName;
private string _message;
public string FileName
{
get {return _fileName;}
set {_fileName = value;}
}
public string Message
{
get {return _message;}
set {_message = value;}
}
}
}




kick it on DotNetKicks.com

Debugging and Tracing Your Website C# (Video)

Tuesday, November 21, 2006

Convert any possible type to T in .Net 2005

private T TryConvert <T>(object o, T defaultValue, bool isThrowException)
{
    T convertedValue = defaultValue;
    try
    {
     if (o != null)
      {
       convertedValue = (T)Convert.ChangeType(o, typeof(T));
      }
     else
      throw;
    }
    catch
    {
     if (isThrowException)
      {
       throw;
      }
    }
   return convertedValue;
}

How to use:


Let us suppose you have HttpRequest with some parameters:
ID , Name and Flag
Example 1. Simple using
private void Examle()
{
int id =
TryConvert<int>(Request["id"], -1,
true);
string name =
TryConvert<string>(Request["name"], string.Empty,
true);
bool flag =
TryConvert<bool>(Request["Flag"], default(bool),
true);
}


Example 2. Using in enum


 public enum Week
{
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday
}

private void Examle2(Week w)
{
Week day = TryConvert<Week>(w, Week.Sunday, true);
}





Thursday, October 26, 2006

NMock

NMock is a dynamic mock object library for .NET. Mock objects make it easier to test single components—often single classes—without relying on real implementations of all of the other components. This means we can test just one class, rather than a whole tree of objects, and can pinpoint bugs much more clearly.
Home page

Comparison of logging services.

We have lead comparison 3 popular services:
Microsoft Enterprise Library
Log4net
Syslog


The scenario of the test:
1. Reading of a line from a DB.
2. Record of a line in a DB.

Here results on 500 inquiries:

Log4NetEnerprise LibrarySyslog
Concurrency Level252525
Time taken for tests1.617758 seconds1.794552 seconds1.270281 seconds
Complete requests500500500
Failed requests000
Write errors000
Total transferred566968 bytes701000 bytes695000 bytes
Requests per second309.07 [#/sec] (mean)278.62 [#/sec] (mean)393.61 [#/sec] (mean)
Time per request80.888 [ms] (mean)89.728 [ms] (mean)63.514 [ms] (mean)
Time per request(mean, across all
concurrent requests)
3.236 [ms] 3.589 [ms] 2.541 [ms]
Transfer rate341.83 Kbytes/sec] 381.15 [Kbytes/sec]533.74 [Kbytes/sec]

Wednesday, September 20, 2006

HttpHandler in WebSite VS 2005

This example intended to case, when classes located in App_Code.

HttpHandler:

public class TestHandler : IHttpHandler
{
public TestHandler() {}

public void ToDo()
{
//....
}

public bool IsReusable
{
get { return true; }
}
void IHttpHandler.ProcessRequest(
               HttpContext context)      
{
ToDo();
}
}
 



Web.Config:
 <httpHandlers>
<add path="test.test" verb="*"
 type="TestHandler, App_Code" />
</httpHandlers>

Thursday, July 27, 2006

Add an uninstall and him shortcut to .NET deployment project in VS2005

1. Create simple project UninstallApp.
2. Add in Main()

{
string[] arguments = Environment.GetCommandLineArgs();

foreach(string argument in arguments)
{
string[] parameters = argument.Split('=');
if (parameters[0].ToLower() == "/u")
{
string productCode = parameters[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
Process proc = new Process();
proc.StartInfo.FileName = string.Concat(path,"\\msiexec.exe");
proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
proc.Start();
}

}


3. Create new setup project
4. Add UninstallApp.exe to "Application Folder" in 'File System' part
5. In "User's Program menu" create shortcut to UninstallApp.exe and in properties of this shortcut in parameter 'arguments' insert value "/u=[ProductCode]".
6.Rebuild deployment project.

Good luck ;)

Friday, June 16, 2006

ILoveJackDaniels.com

ILoveJackDaniels.com This is very good site for Web Programmers. If you use in CSS,PHP,MySQL,ASP / VBScript,mod_rewrite,JavaScript,HTML Character Entities,RGB Hex Colours you must to add this site to your favorites. Also very recomended to web developers in any platform.

Sunday, June 04, 2006

Intellisense for SQL Query Analyzer

SQL Prompt™ is freeware tool which is а intellisense for SQL Query Analyzer.

HomePage

Buttons

Here extremely simple service for creation of buttons "On the fly"...
http://www.buttonator.com/

Clean AJAX

*AJAX - Asynchronous JavaScript and XML.
Clean AJAX - is an open source engine for AJAX which, is technology of creation asynchronous HTTP requests. Clean AJAX is open source and released under a GNU General Public License, download is available from souceforge.

For more information : Click here

Wednesday, May 17, 2006

Event Log Explorer

The small freeware utility for monitoring and the subsequent analysis of the events which have been written down in system log of operational systems of family Windows NT (NT/2000/XP/2003). It is called to expand functionality of built in component Event Viewer from OS and to add new opportunities its Interface it is extremely simple, divided for convenience into two windows. In left the tree of magazines (by default in Windows XP them three is displayed: for appendices, safety and system), and in right - tables with brief data on events, somehow: date, time, a code of event, a source and other. The arrangement of windows in the right half is limited by nothing, it is possible to look through simultaneously set of logs without restrictions. Probably to organize the selected lists for the separate computers connected through removed access on a network. Functions archiving old logs are supported, there is an advanced system of a filtration by various criteria and text search, and also the expanded functions of a press and export to various formats (HTML, TXT or in Excel). The program is very useful, as by means of it it will be much easier (unlike a standard browser of events Windows) to trace failure of this or that appendix, systems or the driver.
Download(1.0 MB)

Wednesday, May 10, 2006

HTMLCrypt 2.60

HTMLCrypt is a software to protect your web pages and prevent others from viewing and reusing your web page source code, including HTML source code, JavaScript, VBScript, text, links and graphics, thus protect your hard work and unique design on the web. In addition to encrypt the source code and make it impossible for people to read, HTMLCrypt also takes some additional measures to further protect your web page, such as disable right mouse click, disable link display in status bar, disable text selection, disable off-line use, disable page printing, etc. The protected page by HTMLCrypt will have the same appearance as the original one.
Download

Thursday, May 04, 2006

SqlDependency in VS.NET 2005

SqlCommand command = new SqlCommand("Select * from Table");
// Clear any existing notifications
 command.Notification = null;
.
.
.
// Create the dependency for this command
 SqlDependency dependency = new SqlDependency(commmand);
 
// Add the event handler
dependency.OnChange += new OnChangeEventHandler(OnChange);




voidOnChange(object sender, SqlNotificationEventArgs e)
{
    SqlDependency dependency = sender as SqlDependency;
    dependency.OnChange += OnChange;
    //Handler for Object
    OnAnyEvent();
}

Monday, May 01, 2006

Storing Code Snippets in VS.NET

Add a code snippet to a tab of the Toolbox as follows:

  • 1.Select the code snippet in the code file
  • 2.Copy the text.
  • 3.Click the desired tab on the Toolbox.
  • 4.Right-click the area below the tab.
  • 5.Select "Paste" from the context menu.