Link to home
Start Free TrialLog in
Avatar of Pau Lo
Pau Lo

asked on

asp.net code review

Can I ask some questions in relation to interpreting web application code. I am trying to reconcile which of my Microsoft SQL stored procedures are being fired off based on specific user actions in an asp.net / C# web application  problem being, I am not a web developer I am more from a Database background. Is there any easy way to view the applications (view > source in IE) source code and determine which SQL query is being fired off when someone for e.g. hits a submit button to send in some data, hits a search button to search data etc?  Any pointers hugely welcome on how to attack this task. If theres any automated way of doing this that would help me no end also, i.e. search is firing off this query, submit data is firing of this query etc.
Avatar of AnkMannen
AnkMannen

If the websolution is a layered solution there is no way by looking at generated html code to figure out what SP is executed.

I would think that the easiest way would be to fire up SQL Query Analyzer and look at what commands get executed at server level.
SOLUTION
Avatar of Ayman Aboualnour
Ayman Aboualnour
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pau Lo

ASKER

First of all please let me know are you the developer of the C# web application and you have the code of it or no?

Hi - No I'm not unfortunately but can access the Databases
Avatar of ROMA CHAUHAN
Hi pma111, tell me I m the developer how can i help you ?
Can u explain you problem in brief so i can help you
Avatar of Pau Lo

ASKER

Hi roma2208, I want to get a list of stored procedures our application relies on, for stuff like searching, passing form data etc. I want to tie up the two, web code with database procedures. But it seems an impossible task.
If you cannot access the code, then the only solution is to set up a sql server trace and let it run for a while to filter out the SP getting called.

If you need more exact mapping, then the query analyzer will come in handy as you can watch what tsql gets executed when moving around the web interface.
If you don't have the code then i think you can not get the list of all the stored procedures used by your application.
Avatar of Pau Lo

ASKER

Can you explain to a beginner the difference between "the code", and what I see when I got view > source in IE. Thanks
If the webpage contains some kind of serverside script, that is code that is executed on the server, then it will produce html that you see in the source in IE.

Most database access takes place on the serverside and the code is producing html.

For example, lets say you have this code on the server:

<%
    var db = GetDatabase();
    foreach(var c in db.customers)
        Response.Write(c.CustomerName + "<br>");
%>

Then the html you see in view source would look like this

Enron<br>
Microsoft<br>

There is no connection left to the original code and you cannot determine what mechansism created the html that you are viewing.
Avatar of Pau Lo

ASKER

So the actual .net code doesnt appear in the html through view > source?

And the .net code would give better pointers to the actual database type stuff?

Thanks AnkMannen
Yes, that is correct.
Avatar of Pau Lo

ASKER

Does the .net code also contain the html code. Excuse my ignorance, but if I asked for a copy of the .net code I would need to be able to view it in a browser so I can see which page in the application it relates to.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial