Tip-3: Exciting SSMS features derived from Visual Studio


In this series of posts, we’ll see few great yet less known and under utilized tips/features those are there since earlier versions of Visual Studio and later made their way to SSMS (SQL Server Management Studio). I am sure, you’ll love these tips.
Tip 3: Transact SQL Code Snippet – Insert Code Snippet

 

Have you used code snippet feature in Visual Studio? Aren’t they very useful?

What are code snippets?
Code Snippets are reusable code templates those help to write code faster.

What are Transact SQL code snippets?
“A Transact-SQL code snippet is a template containing the basic structure of a Transact-SQL statement or block. You can use snippets as a starting point when adding statements in the Database Engine Query Editor. You can insert the pre-defined snippets supplied with SQL Server, or create your own.”MSDN

We’ll discuss about how we can create a Transact SQL code snippet of our own on a later blog post. For now, we’ll see how we can use them.

You can do it either way-801800

  • Right click on the query window and click Insert Snippet…
  • Using keyboard shortcuts CTRL+K, CTRL+X802

Then choose the appropriate category and then the appropriate template to insert it in to your query window.

 

Hopefully, you liked this tips. Please stay tuned to learn few more exciting tips in this series. Will love to hear from you. Thanks for reading 🙂

 

Tip-2: Exciting SSMS features derived from Visual Studio


In this series of posts, we’ll see few great yet less known and under utilized tips/features those are there since earlier versions of Visual Studio and later made their way to SSMS (SQL Server Management Studio). I am sure, you’ll love these tips.


Tip 1: Clipboard Ring – Copy Paste rediscovered
Tip 2: Box Selection – Select and Edit text easily

90Have you ever imagined to select a particular portion of the text or rectangular region of the text from multiple rows like the figure -1 ?
Box selection?
Why I need that ? Oh ! Believe me, many times while executing queries for various tests you’ll need it.

Is this really possible?
Sad, with traditional horizontal selection system you can’t do that.

If you are known to Visual Studio 2010 (release: 12 April 2010) or newer environment, probably you already know this. Since Eclipse 3.5 (release: 24 June 2009), this facility is there. If you have SQL Server 2014 (not sure about SQL Server 2012), you have the power to do columnar selection also known as box selection.

box-selectionYou can do it either way-

  • Holding down the ALT key and dragging mouse to select text as we do for normal selection.
  • Using keyboard shortcuts ALT + SHIFT + ARROW KEYS

You can do following actions through Box Selection

  • Copy : Copy rectangular region/box of text
  • Text Insertion: Select the box and start typing to replace the selection with typed in new text on every selected line.
  • Paste:
    • Single Copy – Box Paste: On box selection pasting some text will be applied to every line
    • Box Copy – Box Paste: Paste contents of one box selection to another box selection
    • Box Copy – Single Paste: Little weird though. Check what is happening !
  • Zero-Length boxes: Vertical selection of zero characters wide to create a multi-line insertion point for new or copied text. To do this, just hold down the ALT key and keep pressing down/up key till the length you want.  This will create a multi-line insertion point.

 

Hopefully, you liked this tips. Please stay tuned to learn few more exciting tips in this series. Will love to hear from you. Thanks for reading 🙂

 

Tip-1: Exciting SSMS features derived from Visual Studio


In this series of posts, we’ll see few great yet less known and under utilized tips/features those are there since earlier versions of Visual Studio and later made their way to SSMS (SQL Server Management Studio). I am sure, you’ll love these tips.


Tip 1: Clipboard Ring – Copy Paste rediscovered

How many times it has happened that you have copied some text and before pasting it on the desired position /location, copied another chunk of text and then you realized that you lost the previous copy?
Have you ever wished for a feature which can help you accessing text previously copied to clipboard and which should be as simple as the popular copy paste shortcuts?

If you are using Visual Studio 2010 or newer, probably you already know this. Since SSMS 2012, this feature know as “Clipboard Ring” has been introduced. Either of the following two simple keyboard shortcuts will do the job.

CTRL + SHIFT + V
CTRL + SHIFT + INS

Using these shortcuts you can cycle through the clipboard ring which stores maximum of 20 copy actions.

Hopefully, you liked this tips. Please stay tuned to learn few more exciting tips in this series. Will love to hear from you. Thanks for reading 🙂

 

Book: Visual Studio 2013 and .Net 4.5 Expert Cookbook


Let’s start with a very short story. Oh ! It’s about you. You bought a latest mobile phone from the market that you haven’t used earlier. Excited to use it. Did some phone calls and text messages. What’s so exciting about it? After all, every mobile phone is supposed to provide those basic functionality. What else? How to learn other features? Yes, you need a guide or references or help manual.

Earlier this month, I got installed Visual Studio 2013 in my laptop and found this particular book to be my true guide in application development and learning new features introduced with Visual Studio 2013 & .Net framework 4.5. It has uncovered many exciting and time saving new features of VS 2013.

News: You can download Visual Studio 2013 Community Edition for free [from here]

The book is authored by Abhishek Sur, a Microsoft MVP since last 4 years who is also a renowned public speaker and also the author of book Visual Studio 2012 and .NET 4.5 expert Development Cookbook. You can purchase the book from Packtpub or Amazon.in . You can even view few pages for free [here] .

If you want to be more productive and upgraded to the changes in .Net 4.5 & VS 2013 then this is just that perfect book you are looking for.

 

With the first chapter the book teaches, how to debug better with your new IDE. You’ll find a great in-depth analysis of each features. Debugging is a very essential part of Application Development and one can definitely use these tips to sharpen their debugging skill.
For Example, I was unknown about
“The debugger stores the information of the line number and source code file inside the DB file (known as the program database)

Second chapter is about the Enhancements to WCF. It also teaches to write RESTful services with WCF with few simple and excellent examples. There is a separate chapter on developing Windows Phone 8 apps . Again there is also a separate chapter on “Extending the Visual Studio IDE” which teaches procedure to extend the IDE by applying your changes. From other chapters, you can learn about TFS enhancements, Testing using VS2013, Windows Azure with in-depth analysis and suitable examples.

It was a very good learning experience for me and if you are a passionate .Net developer who loves to learn more then my recommendation is to get it quickly.

Thanks !

Book: Visual Studio 2012 and .NET 4.5 Expert Development Cookbook


book
Book Title
: Visual Studio 2012 and .Net 4.5 Expert Development Cookbook
Author: Abhishek Sur (www.abhisheksur.com)
About Author: Abhishek Sur is a Microsoft MVP in Client App Dev since 2011. He is an architect in the .NET platform.  He is also a renowned public speaker and owns one of the most active  Microsoft user group named Kolkata Geeks.  His website abhisheksur.com guides both budding and experienced developers to understand the details of languages and latest technology. You may also follow him at Facebook or Twitter .

The very first thing I like about this book is its conciseness. Even though it is a 380 pages book you will find every aspect of the enhancement & new features introduced with Visual Studio 2012 and .Net 4.5 has been  explained extensively with proper examples. Starting with the Visual Studio IDE features, author marches us through the enhancement to ASP.Net, WPF etc. It has a dedicated chapter on memory management too.


I always go for the shortcuts while developing applications and also love to use features provided by my IDE for faster development. This book is a good educator of  IDE features and shortcuts introduced in Visual Studio 2012 which will help you in saving development time.
The key component of the book is, everything comes with a proper example. With this book, one can also learn –

  • In-depth memory management helps to to grasp under the hood happenings.
  • Asynchronous programming has become very important in the last few years and the book explains all about the necessity and usage of Asynchronous Programming in .Net
  • Enhancement to ASP.Net includes support for HTML5, Web Socket, JQuery and been explained beautifully.
  • Enhancement to WPF
  • Building Windows 8 style applications and communication & sharing between apps and devices.

In case you want to check it out before buy, you can download Chapter-1: Introduction to Visual Studio IDE features for free.

You can buy it from packtpub.com or amazon.com

Honestly speaking, I have been immensely benefited from C# internal series by the author on his blog DOT NET TRICKS and this book further helped me to discover the roots.
It is not conclusive by any means and there is a much more to grab. At last, if you are a .Net developer and a technology loving person then you’ll definitely love to add this book to your bookshelf.

Visual Studio 2013 Preview: New Features (Part-II)


You may also like to read Visual Studio 2013 Preview: New Features (Part-I) about the reference tracker in Visual Studio 2013 Preview

Annotated Code Editor Scroll Bar : vs5With the availability of Visual Studio 2013 Preview, now software development will be more faster using our very own code editor. One of such feature is the annotated vertical scroll bar of code editor window. Here is a very informative article about how one can customize the scroll bar to draw the benefits out of it, at MSDN with title “How To: Track Your Code by Customizing the Scroll Bar” .  In this post I am trying to create a visual reference of what can be tracked using this new vertical scroll bar of code editor window (hereinafter, I’ll call just ‘Scroll Bar’). Basically, there are two modes of scroll bar are available i.e, Bar Mode and Map Mode. The default mode is Bar Mode and one can change it to the other by just right clicking on the scroll bar and then selecting appropriate choices from scroll bar options. We can virtually consider the scroll bar consisting of three columns. The colored tracking signals/symbols for saved/unsaved changes will be displayed on the left column, Breakpoints,Bookmarks & Occurrence of Searched Phrase will be displayed on the middle column and  Warnings and Errors can be tracked from the right most column while current cursor position will span over all three columns. 

VS04

Scroll bar with Map Mode has no any other story to tell about these tracking symbols but keeps them left aligned. VS06

Note: Please note that I do not guarantee about the actual usage and behaviors of these features. This post is from my experience with VS 2013 preview and for actual usage one may refer msdn.microsoft.com. I will love to hear from you, if you have any other opinion or in case you want point out some mistake in this post. Thanks

Update (22nd July 2013): (Useful Tips)

With Visual Studio 2013 preview now you can navigate to required code blocks more easily with the help annotated scroll bar. For Example, Suppose you have an error in your code which can be easily distinguished by the red mark on the scroll bar. You can directly view the code snippet generating syntax error in a small pop-up like magnifier, only if you have enabled ‘map mode’ vertical scroll bar and checked for option ‘Show Preview Tooltip’ in the Scroll Bar Options. This is very useful when you are viewing code in a collapsed view where you will not be able to navigate to the line directly except clicking on the particular error in the error list window. Now, as you have a very informative scroll bar which shows you signs for errors, you can single click on it to bring the cursor to the method/block containing that error and you can also double click on the red error sign on the scroll bar to go directly to that line.

Visual Studio 2013 Preview: New Features (Part-I)


vs5Update:This is just the very basic information about CodeLens. If you want to know more, there is very good article describing it to depth is now available at MSDN(msdn.microsoft.com) . Believe me, CodeLens has much more usability than this small blog post and you will definitely love it.
The availability of Visual Studio 2013 preview was announced 1 day ago and one can download it from http://goo.gl/pioqg . After using it for few hours I have noticed, there are many new features (both UI and functionality) included in this preview version.
Note: Please note that I do not guarantee about the actual usage and behaviors of these features.

CodeLens:

vs2

Now, I don’t need to remember the no of reference count of any class, method, property, constructor etc. If you look at the above figure, there is a clear indication (1) above Class1 that it is being referenced in 2 places. Now, clicking on (1) 2 references pops out a detailed box describing the references, whether it is in the same file (2) or some other file (3) . We can also find a more detailed view (4) on mouse hover over the description to find details like file name, line no, column no & code snippet containing the reference.

I will love to hear from you, if you have any other opinion or in case you want point out some mistake in this post.

Thanks

You may also like to read Visual Studio 2013 Preview: New Features (Part-II) about the Annotated Scroll bar