Pages

Thursday, November 20, 2014

How to see all break points in visual studio 2012 and 2013



Method 1
--------------
Navigate to Debug->Windows->Breakpoints



Method 2
-----------
You can find the breakpoints window beside output window on the bottom left side as shown in below.





Monday, November 10, 2014

How to write debug info onto console in MVC in visual studio



I wanted to debug a piece of code which was not working in my MVC site .To write debug statements onto output window,Simply add the following code

System.Diagnostics.Debug.WriteLine("Test statement");
 
Later start the  website using Debug mode - and check for the statements in the Output tab in Visual Studio
This is what I do for a lot of MVC 3,4,5 applications and it works perfectly.

deepstutorials:how to Track Active Item in Solution Explorer in visual Studio



I found it very annoying to search the file in the solution explorer of the Visual Studio.Came to know that there is a shortcut to highlight the file in the Solution explorer.This tip works from VS 2010 and above.

Navigate to Tools->options->Select Project and Solutions and check the option on or off as per your requirement(If its checked, we are able to see the active item in visual studio)



Open a file and the file is highlighted in the solution explorer as shown below in the following snapshot.

File Highlighted in the solution explorer


Monday, November 3, 2014

#deepstutorials:The type or namespace name 'Required' could not be found



A rookie problem i encountered and wanted to document . Hopefully this saves someone out there some time.  I wasn’t able to resolve it automatically in Visual Studio 2013.

If you hit the errors:

The type or namespace name 'RequiredAttribute' could not be found”

“The type or namespace name 'Required' could not be found”


Make sure you add

using System.ComponentModel.DataAnnotations;

You can refer to this documentation link 


Sunday, November 2, 2014

#deepstutorials:change potrait layout to landscape layout in MS Word




 The following document is in potrait mode which is the default mode in MS Word



To change the document from potrait layout to landscape layout  Select Page layout ->orientation and choose potrait or landscape orientation accordingly as shown in the below screenshot




Thursday, October 30, 2014

deepstutorials:How to remove unused Usings using visual studio



To remove the unused Usings ,Visual Studio provides a shortcut i.e You can do this by right clicking in the file, click Organize Usings, and then click Remove Unused Usings as shown in the below snapshot.






how to generate getters and setters in visual studio



My requirement was to generate 10 properties in the following format

public int ID { get; set; }

Visual studio has an shortcut for this, just type prop and then hit tab twice .


How to restore the default layout in Visual Studio



 Sometimes we keep changing the layouts and get lost trying to restore the default layout .Following is a way to do it.

Navigate to Window->Reset to Window Layout(ALT+W,R).
Click YES on the prompt box as shown below.






What is the difference between landscape and potrait orientation?

The orientation can be applied to printed documents, viewing documents , digital photos etc.Page orientation has 2 common types of orientation.

                                       Potrait (vertical orientation)





                                      Landscape (horizontal orientation)


Tuesday, September 9, 2014

Add custom code to report builder/SSRS



Sometimes ,your requirement may not be done with the default functions or custom expressions.This is when the custom code comes into picture.Following are the steps to embed the custom code in the Report builder/SSRS

1.In Design mode,right click outside the border of the report and click on Report properties
2.Click on code
3.Add the custom code to the window as shown below.
4.Click Ok.(Errors are only shown when you run the report)
5.Following is the way to call the code  in the  corresponding cell of the report.


=Code.BatchServiceStatusString(Fields!BatchServiceStatus.Value)


                The meaning of the above code snippet is for the corresponding Fields!BatchServiceStatus.Value there would be a corresponding return value based on the condition satisfied.


Thursday, September 4, 2014

To hide static columns in a matrix, list , or table(Report Builder/SSRS)



  1. In Design view, select the table, matrix, or list to display the row and column handles.
  2. Right-click the column handle, and then click Column Visibility.
  3. In the Column Visibility dialog box, follow the below steps
  4. In When the report is initially run, specify whether to hide the item when you first view the report:
    • To display the item, click Show.
    • To hide the item, click Hide.
    • To specify an expression that is evaluated at run-time, click Show or hide based on an expression. Type the expression or click the expression (fx) button to create the expression in the Expression dialog box.  




how to hide static rows in report builder and SSRS

  1. In report design view, click the table, matrix, or list to display the row and column handles.
  2. Right-click the row handle, and then click Row Visibility. The Row Visibility dialog box opens.
  3. To set the visibility, follow  the below steps
  4. In When the report is initially run, specify whether to hide the item when you first view the report:
    • To display the item, click Show.
    • To hide the item, click Hide.
    • To specify an expression that is evaluated at run-time, click Show or hide based on an expression. Type the expression or click the expression (fx) button to create the expression in the Expression dialog box. 


Hide an Item (Report Builder and SSRS)

In report design view, right-click the report item and open its Properties page.
  1. Click Visibility.
  2. In When the report is initially run, specify whether to hide the item when you first view the report:
    • To display the item, click Show.
    • To hide the item, click Hide.
    • To specify an expression that is evaluated at run-time, click Show or hide based on an expression. Type the expression or click the expression (fx) button to create the expression in the Expression dialog box. 
3.       Click Ok twice.



how to see the properties pane in report builder

Sometimes we accidentally close the properties pane .To get the properties pane back you need to click on the view tab and check the properties as shown below in the figure.




How to repeat headers in Report Builder/SSRS




Following is the process to repeat the headers on every page in the report Builder 

Select the arrow to the bottom right corner to get the advanced as shown in the figure.

Click on the Advanced  Mode Button in the Column Groups.Once you click the Advanced Mode you would be able to see the static rows in the row groups as shown below.
  

Select the header which you want to repeat on each page and set the properties KeepwithGroup to After and RepeatOnNewPage to True as shown below.


Apply the report properties to all the static rows that you want to repeat on every page.This should repeat headers on every page .


An item with the same key has already been added.

When i got this issue  i cross checked the query for the repetition of  the column names.I have removed the repeated column names that has already been added  and this solved my issue.




Friday, June 27, 2014

Step by Step installation to install report builder 3.0 for sql server 2014




Uninstall the standalone version of Report Builder


To uninstall the standalone version of the Report Builder  ...
  • Navigate to Control Panel->Add/Remove Programs.
  • Do a quick search for the Report builder and select the report builder to highlight the uninstall option as shown below.
  • Click the uninstall button.
  • Confirm the uninstall by pressing Yes in the pop up box as shown below .This will uninstall the tool completely.


Friday, May 23, 2014

The prefix "util" for element "util:set" is not bound.



If you get the following error in while executing a Spring program.Following are the steps to resolve it.

Add the namespaces (the ones that are highlighted below in your spring configuration file)

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:util="http://www.springframework.org/schema/util"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  http://www.springframework.org/schema/util
  http://www.springframework.org/schema/util/spring-util-2.5.xsd">

This will resolve the issue
    public class HelloWorld {
       private String message;
     
       public void setMessage(String message){
          this.message  = message;
       }
     
       public void getMessage(){
          System.out.println("Your Message : " + message);
       }
    }



How to install adventureworks2012 database



  • Download the zip file at link.

Unzip the folder .The folder contains  two files with .mdf and .ldf extension.Login to SQL Server using the management studio.Right click on the databases and select Attach.It opens a dialog box as shown below.



Click on the ADD button of the dialog box and give the path of the mdf file . Click OK . The mdf file gets attached. Click OK to close the dialog box as shown in the below.

Below is the screenshot after the database gets sucessfully attached.



Wednesday, May 21, 2014

How to create a java project in eclipse




  • Create a java project by selecting File->New->Java Project.It opens a window as shown below.
  • Fill in the name of the project and the location (if you want to change)



  • Click on Next and then Click on Finish .If it asks for perspective change click on yes.This creates the HelloWorldSpring  java project.

Set the libraries:

Configure the build path.To do this,go to package explorer view ,right click on the project ,select build path  ->Configure Build path->select Libraries tab and select add external jars.





Monday, April 7, 2014

How to display line numbers in visual studio






  • Click on Tools tab and click on options .It opens a window.
  • Expand the text editor node and select the language(For Ex:C#) for which the line numbers have to be displayed or select All languages if you want to apply the settings to all of the languages .
  • I wanted to change it for C# so expanded C# node and clicked on General. Check the line numbers option and click OK as shown in the below screenshot.


Saturday, April 5, 2014

eclipse installed but cannot start java returned exit-code = 1



I have got this error in the Android Sdk .The following Fix worked for me.

Edit the eclipse.ini file .Point the vm to the correct jdk.In my system i had two versions of jdk installed. I have pointed it to the initial installed version. Please see the highlighted code in the below screenshot.



Wednesday, March 12, 2014

How to Install MongoDB on windows



To install MongoDB we don`t have to run ant exe file.All we have to do is download the zip file from the official MongoDB website.Depending upon the OS download 32 or 64 bit version zip files.

Unzip it and place the folder in a location .For Ex:D:\mongodb

 How to start the MongoDB server 

  • Open a command prompt and navigate to the mongodb\bin  and issue the highlighted command.
  • MongoDB needs a data folder to flush the data .So we need to create the folder manually(any location For Ex: D:\mongodb\data\db ) .Refer the screenshot for any doubts.

mongod --dbpath "D:\mongodb\data\db"

  • Once the server starts successfully the cursor starts blinking at the end .

Connect to MongoDB

  • Open another command prompt without closing the first command prompt(as this will close the server).
  • Navigate to the bin folder of the mongodb folder and issue the command as shown in the below screenshot.
mongo


Instead of navigating each and every time to the installation location you can set in the PATH varaible to execute it from any location.

Unable to install Maven: “JAVA_HOME is set to an invalid directory”

Sometimes when we try to run mvn -version command it gives the following error in the command prompt .

Solution:

ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_51\bin" .Please set the JAVA_HOME variable in your environment to match the location of your Java installation

JAVA_HOME should be set to C:\Program Files\Java\jdk1.7.0_51.  PATH should be set to include %JAVA_HOME%\bin.

Hope this helps.:)

Tuesday, March 11, 2014

How to install maven on Windows




  • For installing maven we don`t have to run any exe(executable) file.All we need is to download the zip file , unzip and edit the PATH in environment variables.
  • Before you start the installation make sure java is installed in the system and JAVA_HOME system variable is set in System variables as below.

  • Download the zip file from Official Maven website.Depending on whether your system is 32 bit or  64bit you can download the zip file.for Ex:(apache-maven-3.2.1-bin.zip ).I have unzipped at c:\apache-maven-3.0.5 and set the system variable  as  shown  in the screen shot below.


  • Also edit  the system variable Path/PATH  so that it has your maven location as the below screenshot so that you can execute maven from any directory.







  • Test the installed maven by issuing the command mvn -version.The output should be as follows.That means Maven has been successfully  installed on your computer.



While testing sometimes you may encounter error :Unable to install Maven: “JAVA_HOME is set to an invalid directory.To solve this,you can go to following link .


Monday, January 6, 2014

The import javax.servlet can't be resolved

You need to add the Servlet API to your classpath. In Tomcat7.0, this is in a JAR called servlet-api.jar in Tomcat's lib folder. You can either add a reference to that JAR to the project's classpath, or put a copy of the JAR in your Eclipse project and add it to the classpath from there.
If you want to leave the JAR in Tomcat's lib folder:
  • Right-click the project, click Properties.
  • Choose Java Build Path.
  • Click Add External JARs...
  • Browse to find servlet-api.jar and select it.
  • Click OK to update the build path.
Or, if you copy the JAR into your project:
  • Right-click the project, click Properties.
  • Choose Java Build Path.
  • Click Add JARs.
  • Find servlet-api.jar in your project and select it.
  • Click OK to update the build path.

Thursday, January 2, 2014

Step by Step Installation for MySql database on Windows


 Hello All,

I have made a office presentation on how to install MySQL open source database on windows 8.
Below is the power point presentation to the installation.
Once you download the installer .Unzip it and double click on it .Follow the steps below.The installation while doing this presentation was 5.6.You can even find the same presentation on youtube at link.