How to identify data source for a web form

0 Answers 389 Views
Ajax Grid
Brian
Top achievements
Rank 1
Brian asked on 14 Apr 2023, 02:08 PM

I inherited an intranet that was developed by one of our in-house developers years ago, he has since left.  When he left his duties passed on to someone else and after various forms of attrition, have fallen to me. Any documentation he may have provided never made its way down to me so I'm completely flying blind. Anyway, I had managed to fix an issue with one of the other Telerik pages because I found the section in the aspx that referred to the <asp:SqlDataSource and then was followed by a bunch of SQL code so I was able to update the parts of that that needed to be updated and that one works fine now. But a new problem has creeped up with another page that looks like it pulls data from our ERP regarding timesheet data. I would assume it must be getting that from some sort of SQL statement as that is the only way into that system but there is no SQLDataSource tag on this page.

Where should I be looking in the apsx file to identify where the data is coming from for that page? Since there is no SQL call on the page itself I assume that its calling something else and that has the SQL query in it, but I can't find it for my life.

Thanks.

Rumen
Telerik team
commented on 18 Apr 2023, 01:52 PM

Hi Brian,

If there is no explicit SQLDataSource tag on the page, there could still be a few ways the data is being retrieved and displayed in an ASP.NET Web Forms (AJAX) application/website. Here are a few areas you could check in the ASPX file to identify where the data is coming from:

  • Check the web.config file: The connection string used to connect to the database may be defined in the web.config file. Look for a connection string in the <connectionStrings> section of the file.
  • Check for any other data source controls: Even if there isn't an SQLDataSource control on the page, there may be another data source control being used such as an ObjectDataSource or XmlDataSource. Look for any tags that start with "<asp:ObjectDataSource" or "<asp:XmlDataSource" to see if there are any data source controls being used.
  • Check the code-behind file: The data retrieval logic may be contained in the code-behind file associated with the ASPX page. Look for any method calls in the code-behind file that retrieve data, such as calls to stored procedures or other data access code.
  • Look for custom controls: The page may be using a custom control that retrieves data from the database. Check the ASPX file for any custom control tags that might be displaying the data. 
  • Look in the App_Data and App_Code folders.
  • Use the Visual Studio debugging tool: If none of the above approaches work, you could try using a debugging tool to step through the code and see where the data is being retrieved. This will require access to the source code for the application.

No answers yet. Maybe you can help?

Tags
Ajax Grid
Asked by
Brian
Top achievements
Rank 1
Share this question
or