Visual studio tips

We can put frequently used code snippet in Toolbox and use whenever required example SQL connection string.

Steps to add code snippet in toolbox are

1. Write down code which need to put in Toolbox.

this.ConnectionString = “Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx”;

2. Go to View -> Toolbox


3. Drag code to toolbox. See rectangle in above screen shot.

4.  You can give name to code also. like Items in above screen shot.


In .Net only horizontal selection is possible.


We can select code vertically by selecting code along with ALT key press


Remove unused using statements.

We can remove unused code by below method

Right mouse -> Organize Usings -> Remove Unused Usings


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s