.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Post New Resource Bookmark and Share   

What is meant by StepInto, StepOver and StepOut (Debugging technique) in .NET?

Posted By:Shivprasad koirala       Posted Date: September 20, 2011    Points: 200    Category:    URL: http://www.questpond.com  

This article will explain about debugging .NET.


Visit our site and get more interview questions which covers SOA, UML, ASP.NET, Design patterns, WCF, SharePoint, OOPs etc.

Debugging: - Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece code thus making it behave as expected.

So let me first explain what does the words StepInto, StepOver and StepOut means where exactly they present and what are the shortcut keys to use them.

1. StepInto : - step into is the process of running one statement at a time.

In order to run a code of statement at a time, choose StepInto from the debug menu (F11).

2. StepOver : - Step Over is the same as Step Into, except that when it reaches a call for another procedure, it will not step into the procedure. The procedure will run, and you will be brought to the next statement in the current procedure.

To step through code one statement at a time, choose Step Into from the Debug menu (F10).

3. StepOut : - If you are using Step Into and have been moved to a called procedure, you can automatically run the current procedure, and return to the procedure it was called from by pressing the Step Out (Ctrl+SHIFT+F11) on the Debug menu.

Now, let's demonstrate a simple example to understand it in better manner.

In order to perform practically, just follow the following steps.

Step1: - Create a new project of ASP.NET Empty Web Application and a new Web Form to it, later adds a GridView control to the form.

Step2: - Just add below code snippet in to WebForm.aspx.cs file in order to bind data to the GridView.

protected void Page_Load(object sender, EventArgs e)




public void LoadGridView()


SqlConnection Con = new SqlConnection(str);


SqlCommand Com = new SqlCommand();

Com.CommandText = "select * from Employee";

Com.Connection = Con;

SqlDataAdapter Adap = new SqlDataAdapter(Com);

DataSet ds = new DataSet();


GridView1.DataSource = ds;



Step3: - Now just add RowDataBound event of the GridView to the WebForm1.aspx.cs like below code snippet.

protected void GridView1_RowDataBound(object sender,

GridViewRowEventArgs e)


if (e.Row.RowType == DataControlRowType.DataRow)


double Salary =



if (Salary > 10000)


e.Row.Cells[4].BackColor = System.Drawing.Color.Red;




e.Row.Cells[4].BackColor = System.Drawing.Color.Green;




Once you have completed all the above steps now put a small debug pointer on the LoadGridMethod like below diagram.

Now, when you run your application you will see something like below diagram.

In the above diagram you can see that the debug pointer is now turned in to yellow color this indicates that the pointer is waiting for your instruction.

Let's first see the difference in debugging between using the Step Into (F11) and Step Over (F10).

Note: - we have not put the debug pointer on the RowDataBound event.

1. Debugging using the StepInto (F11).

In the above diagram you can see that now the debug pointer has been moved to the RowDataBound event also as we have not put a debug pointer on that event.

Conclusion: - When we use StepInto (F11) to perform debugging it basically perform debugging on the all the statement even if there is debug pointer placed or not.

2. Debugging using the StepOver (F10).

In the above diagram you can clearly see that now the debug pointer has not been moved to the RowDataBound event as compared to StepInto (F11).

Conclusion: - this indicates that when we use StepOver (F10) to perform debugging it debugs only those statements where the debug pointer has been placed.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend