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 !

Windows: Copy only files recursively from a folder containing sub folders


windows
What this post is all about?
This post is basically to serve a way to copy all or some files at once from a folder containing one or multiple sub-folders.

Which OS are supported?
Windows 7, Windows 8, Windows 8.1

What is the situation, by the way? Can we have an example ?
Let’s create two folders named Folder1 and Folder2 on desktop. Then copy some files in to Folder1. Create few sub-folders inside this folder and again copy few files to each of the sub-folders. Now what we may want to do are:

  • Copy all the files from Folder1 and its sub-folders to Folder2
  • Copy specific types of files from Folder1 and its sub-folders to Folder2

Is there any solution to this requirement?
Yes ! :)

Is it a simple one?
Yes ! Very much. Indeed, You know this already :P .It’s just a simple trick to what you already know.

Then you are waiting for what? Show me !
Okay. I have few pdf files in each level of the folder hierarchy in Folder1 as shown the fig. below .
a1     a2   a3

Now I want all these pdf files to be copied to a4Folder2 at once. Here is the trick then: open Folder1 and search for *.*

Select all files (by pressing CTRL+A) and exclude all the sub-folders, copy (CTRL+C) and paste (CTRL+V) on Folder2 . This solves our first purpose.

For the second purpose, you only need to change the search pattern to *.<file extension> instead of *.* .For Example- *.pdf . This will list only the pdf files automatically excluding the sub-folders.

Hopefully you liked reading this little post. I really welcome all kind of feedbacks and suggestions.

Thanks for reading !

Photoshop: 10 simple steps to create soft edged border effect


fadeedgeThere are very few simple steps need to follow if you want to have fade out kind of effect which makes the edges look soft using Adobe Photoshop. This is a very popular effect when you want to merge an image to another background so that the new image fits or adapts to it’s new environment resulting a WOW effect.

I have tried all my best to keep this post simple so that even a guy who has no experience of Photoshop can do the trick. What you need to do is to walk through the procedure step by step.

Tools Needed : :) You are right !   Adobe Photoshop
Skills Needed : :( You are wrong ! Nothing

Now, without twisting the story much, let’s get started with step 1.

STEP 1:
Choose 2 Images. For this demo I have picked following two images, first is a simple one with a beautiful quote and the sweet smiling kid borrowed from source: http://www.adorabletab.com .

sweetkid

Image 2

quotedimage

Image 1

You may download these images to your PC by simply clicking each of them or you may choose any other two images of your choice.

STEP 2: Open Image 1 with Photoshop.

STEP 3: Drag Image 2 and place just on the Image 1 opened with Photoshop.
901

STEP 4: Drag/Move this image to your preferred location on the Image 1 . You can resize the image too by stretching the corners of the Image 2 (with shift key to maintain the aspect ratio) . Then press Enter key to place the image.
902

STEP 5: Select the Elliptical Marquee Tool .
903

STEP 6: Create a marquee selection by dragging around the area of the Image 2 you want to keep which will be visible above the Image 1.
904

STEP 7: Click on the Add layer mask button at the bottom of the layers palette.
905   906

STEP 8: Go to Filter Menu and select Blur and then Gaussian Blur .
907  

STEP 9: You can use the slider to increase or decrease the intensity of blur .
909

STEP 10: WAIT ! Are you seriously waiting to follow the 10th step ? :D :D Okay. Just click the Save from File menu and save the file to the format you want.

And yes, don’t forget to drop few lines for me regarding how you liked :) or disliked :( the post.

Thanks a lot for reading !

CSS: Drop Caps


css-dropcapsDrop caps is a very old technique of styling first letter of the paragraph or article, commonly used by News Papers, Magazines etc. With CSS we can achieve this requirement. Let’s have a look on the following example.

The pesudo-element :first-letter will do our job. This CSS selector can only be used with block level elements.
Example:

CSS
<style>
    p:first-letter {
        font-size: 400%;
        float:left;
    }
</style>
HTML
<div style="width: 40%;">
    <p>
       MVC framework will really helps you to develop the project rapidly, if you know one framework well then you’ll never worry about the project deadline. You will write less code, which means less time spent typing. You will not have to chase down 3rd party libraries all the time for every new project because most of them will come with the default framework install.
    </p>
 </div>
RESULT

blog1
You can apply other CSS styling too like background-color,, color, border etc to make it more beautiful.

Hopefully, this short little tip will be helpful.
Thanks !