Link to home
Start Free TrialLog in
Avatar of Ben Conner
Ben ConnerFlag for United States of America

asked on

Finding a filter on a table in a website that uses C#

Hi,

I'm trying to get an understanding on the filtering mechanism used in a website written in C#.  It uses SQL Server as a back end.  I have all the site's content and a backup copy of the database.  Unfortunately I don't code in C# nor in ASP.net.

The site has 2 main areas: equipment and parts.  The code has some method of sub-setting a single table that contains data for both web pages.  I need to find out how it does that and am coming up empty.

There are no views nor stored procedures in the database.

I can post the source code for one of the pages if that would be helpful.

Thanks much!

--Ben
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

From C#: How about just searching for the table name or something that might resemble a SQL snippet  'FROM tableName' in your code editor?

From SQL Server: You can start SQL Profiler on the SQL Server with a TextData filter for the name of the table. Running the search page at this time will enable you to see the queries being executed against the database which refer to this table. You can then search for that SQL in your C# code. Trying different ways.
Avatar of Ben Conner

ASKER

Already tried searching for just the word 'From' with Ultraedit against all files in the site.  Nothing popped up.

I can only get a copy of the database; I don't have access to SQL server itself, as it is on a shared host.

--Ben
ASKER CERTIFIED SOLUTION
Avatar of Dirk Strauss
Dirk Strauss
Flag of South Africa 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
Hi Dirk,

That looks interesting; I would assume it gets installed on the web server.  Is that correct?  If it installs on my workstation, how would it get access to the code being executed on the server?

--Ben
Found the field & value that distinguished between the pages.  The equipment page had a bunch of sub-categories in it; the parts page did not.  I pulled a bunch of part ids off the website and displayed them in SSMS.  There was a common field that remained constant down that list and that is what separates content between the two web pages.

Thanks much for the help!

--Ben
As a follow-up to this thread, apparently I didn't have all the pieces to this database; there were also number of stored procs that were missing from the backup I was given originally that were critical to how it was mapped out.  Also didn't have several source code modules from the site itself.  Other than that it was very straightforward. :)

Thanks for the guidance!

--Ben