Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

Visual Studio.NET 2005 comes with many cool features and one of them is Code Snippet Manager. Remember all the time writing boring code well, now you can make use of the Snippet Manager and hence paste the code in seconds.

All you need to do is to [YourSnippetFile].snippet file to the My Code Snippets folder and that's it. Here is one of my Snippet File which is use to create a BindData method which fills the dataset and return it to the client.

<?xml version="1.0"?>
<CodeSnippets xmlns="
  <CodeSnippet Format="1.0.0">
      <Title>Bind Data from DataSet</Title>
          <Default>SELECT * FROM Categories</Default>
      <Code Language="csharp">
private DataSet $METHOD$
// make the query 
string $QUERY$ = "$QUERYTEXT$";
      SqlConnection $SQLCONNECTION$ = 
new SqlConnection($CONNECTIONSTRING$);  
      SqlDataAdapter $ADAPTER$ = 
new SqlDataAdapter($QUERY$,$SQLCONNECTION$); 
      DataSet $DATASET$ = 
new DataSet(); 
return $DATASET$; 

You will get your snippet in the intellisense of Visual Studio.NET 2005:

 And the code generated for the Snippet will be:

Pretty cool!

powered by IMHO


Posted on Sunday, November 27, 2005 12:16 AM | Back to top

Comments on this post: Code Snippet Manager in Visual Studio.NET 2005

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Mohammad Azam | Powered by: