Hey folks, I've been teaching myself ASP.net for the past 8 months as I've been taking over an existing application running ASP.net 1.1. I've been testing successfully on my local machine using a small data set but I recently found an issue when the same code was being used on the production server. In production, the data set (SQL Server 2000, btw) being queried is quite large and the stored procedure is fairly complex. This adds up to a run-time for the stored procedure of around 2 hours.
The expected behavior of the page is as follows (and it works in ASP.net 1.1 mode):
-
Choose criteria in the form and submit.
-
Build stored procedure call and execute ( adapter.Fill(ds) ).
-
Bind DataGrid to DataSource.
-
Update a few labels, etc.
What is happening is that when IIS is configured to use ASP.net 2.0, it basically seems to stop after step 2. The page churns for about an hour and a half and then stops as if it is finished. However, the DataGrid is not displayed and none of the labels are updated. It's almost as if it gave up interacting with the web controls. Funny thing is, some steps ARE executed after the database call such as a write to the log file (see orange and green highlighting below). So basically it looks like it finishes executing but anything referencing a web control is unable to complete.
While I come from an environment of responsive web applications, this one is used by only one or two people at a time and thus they are accustomed to clicking, leaving, and checking back later for the results. Therefore I'm not looking for suggestions about asynchronous DB calls, which I'm sure would be a good end goal and the 'ideal' user experience for many.
Posting some of the code (not complete) below to give you an idea. I appreciate anyone's insight into what may be causing this.
1 strSqlCode = "Execute " & strRepCode & " '" & sTaxYear & "','" & intCorrType & "','" & sSubFile & "', '" & sServCent & "', '" & sTreats & "'"
2
3 Write2Log(strSqlCode)
4 ' get report from SQL server
5 connx= New SqlConnection(Application("DSN"))
6 connx.Open()
7 cmdSelect = New SqlCommand(strSqlCode, connx)
8 cmdSelect.CommandTimeout = 10 * 60 * 60
9
10 Dim myAdapter As SqlDataAdapter = New SqlDataAdapter()
11 myAdapter.SelectCommand = cmdSelect
12 Dim ds As DataSet = New DataSet()
13
14 DataGrid2.Visible = True
15 'Load Data Set from XML file or refresh from Database
16
17 myAdapter.Fill(ds)
18
19 'Write out schema representation
20 ds.WriteXmlSchema(schemaFileName)
21 'Write out XML data form relational data
22 ds.WriteXml(reportFileName, XmlWriteMode.IgnoreSchema)
23 f = New IO.FileInfo(reportFileName)
24 modified = f.LastWriteTime
25 lblSavedReport.Text = "(Last Refreshed " & modified.ToShortDateString() & " " & modified.ToShortTimeString() & ")"
26 BtnRefreshReport.Visible = True
27 lblSavedReport.Visible = True
28
30 DataGrid2.DataSource = ds
31 DataGrid2.DataBind()
32
33 conAUR.Close()
34
35 Finish = Timer ' Set end time
36 TotalTime = Finish - Start ' Calculate total time
37 sMsg = "Tool took " & Format(TotalTime, "###0.00") & " seconds to display " & lblResults.Text & ". More info: " & lblTYCorr.Text
38 Call Write2Log(sMsg)