Gee, talking about debugging in Visual Studio, and wondering what your options are? One of the premiere developer tools available?
Might as well walk into a big garden supply depot, and wonder if they will have lawnmowers and lawn care products!!
So, first up, and there are MORE choices then flavors of ice cream here, but I tend to send my output(s) to the immediate window. That reuslts in when I am building windows apps, console apps, web apps, or whatever to send out my debug.print statements to the immediate window. (I tend to do this, since I am flpping between desktop software development, console development, and even building com .net objects for ms-office).
So, this:
tools->options->debugging
Then this:

The other reason, is that immediate window opens when you hit f5 to run/start your code.
As for having to use debug.print? Well, often you don't have to.
I assume you working a "copy" and have VS setup to run this project on your dev box.
So, say I have some simple markup in a page, simple grid.
<asp:Button ID="cmdLoadData" runat="server" Text="Load Grid Data"
CssClass="btn" OnClick="cmdLoadData_Click"/>
<br />
<asp:GridView ID="GridView1" runat="server" CssClass="table table-hover"
width="40%" DataKeyNames="ID" AutoGenerateColumns="false" >
<Columns>
<asp:BoundField DataField="FirstName" HeaderText="FirstName" />
<asp:BoundField DataField="LastName" HeaderText="LastName" />
<asp:BoundField DataField="City" HeaderText="City" />
<asp:BoundField DataField="HotelName" HeaderText="Hotel" />
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Description") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
And code behind is this for the button:
protected void cmdLoadData_Click(object sender, EventArgs e)
{
Debug.Print("Load grid data");
LoadData();
}
void LoadData()
{
string sCon = ConfigurationManager.ConnectionStrings["TEST4"].ConnectionString;
Debug.Print(sCon);
using (SqlConnection conn = new SqlConnection(sCon))
{
string strSQL = @"SELECT * FROM tblHotelsA ORDER BY HotelName";
using (SqlCommand cmd = new SqlCommand(strSQL, conn))
{
conn.Open();
DataTable rstData = new DataTable();
rstData.Load(cmd.ExecuteReader());
GridView1.DataSource = rstData;
GridView1.DataBind();
}
}
However, lets assume I not YET put a debug.print in for the number of rows sql returns.
Well, really, don't need debug.print, I can just put in a break-point, say on the first line of the button click, and now single step code.
So, say I have this code, but I ALSO clicked on the left side - you see the red break-point.
So, this code:
But, in the editor, I have a break point set, so it looks like this:

So, when I hit f5 to run/debug, my code will run to the breakpoint above,
I want to see the data columns, and also want to know/see the number of rows returned by the query. And I do NOT even need any debug.prints
So, I single step. And you can just hover your cursor over any object - VS will like "magic" peel open that object like a onion!
So, I single step (F8), It looks like this:

so, in above, I did see/check the columns, and then I took a quick look at the rows property, and got my row count.
So the debug window (now the immedage window looks like this:

And there are bunch more windows that you can have open.
So, say the Immedate window - (where debug.print goes).
So, this:

Now, I barely scratched the surface.
but, as a general idea, if you have a button on a web form, you run to that page, and set a break-point in the code behind. At that point, you can single step as I did above (f8).
But, in place of a boatload of debug.prints, I just hover the cursor over the object (in this example a data table), and I was able to see/view the columns, and then I moved over to the row object to get a row count.
of course on the browser side, I get this:
