Sign in to follow this  
potato2008

[.net] debug in asp.net

Recommended Posts

hi, i create a function like this private void xxx() { int x = 0; sqlconnect cn; string sql = "insert ......"; ..... execute sql command } i debug it in step over, when the program run and stop at first line, i stop it, but the following code still run util exit function, why?

Share this post


Link to post
Share on other sites
I am not quite sure whether I understand your question or not.

Can you trace the database? By adding tracing you could make sure that you are correctly connecting to the database. Try running the query directly in the database so you know that the query is correct.

Share this post


Link to post
Share on other sites
It doesn't stop the execution of the page because you're only debugging the web application, you're not debugging the server that is executing the application. If all you did was hit F5 without any extra setup, then you're using the built-in ASP.NET Development Server, in which case it *should* stop when you stop the debugger. However, if you set up your application to execute in IIS, then the debugger can't shut down IIS when you stop the debugger, so IIS will finish processing the last request while Visual Studio closes the browser window.

BTW, stop building queries in strings in your application code. Use a stored procedure.

Share this post


Link to post
Share on other sites
right click your project in the Solution Explorer in Visual Studio and select "Properties". In this window, select the "Web" tab. Under the "Servers" selection, check the "Use Visual Studio Development Server" radio button.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this