We help IT Professionals succeed at work.

asp.net code review

pma111
pma111 asked
on
240 Views
Last Modified: 2013-11-05
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.
Comment
Watch Question

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.
Ayman AboualnourSoftware Developer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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
ROMA CHAUHANProject Lead
CERTIFIED EXPERT

Commented:
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

Author

Commented:
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.
ROMA CHAUHANProject Lead
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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.

Author

Commented:
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.

Author

Commented:
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.
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
ROMA CHAUHANProject Lead
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.